Build and Flash Workflow¶
Day-to-day development is a loop: edit, build, flash, watch the console. In this tutorial you change the boot banner of the out-of-box firmware ipro7ai_reef_demo on the IPRO7AI Reef EVK, build, flash and monitor with one build_freertos.sh line, and see your text on the console; then you switch configurations, clean-build and read memory usage. For first-time installation and flashing, complete First FreeRTOS Application first.
Prerequisites¶
- First FreeRTOS Application is done: the board runs
ipro7ai_reef_demoand its console answersreef selftest. - macOS or Linux.
build_freertos.shneeds bash; on Windows, usebuild_freertos.ps1in PowerShell (same actions and options) or build and flash with the VS Code Extension, as in Windows Setup & VS Code — the loop is the same. - Run every command from the SDK root; examples use macOS.
Steps¶
-
Set the environment once in this terminal window; every later command uses it.
export IPRO_FLASH_TOOL=<IntelProCube>/ipro_iot_tool_macos export IPRO_SERIAL_PORT=/dev/cu.usbserial-XXXX export IPRO_FLASH_PT=<IntelProCube>/chips/ipro7/partition/partition_cfg_2M.tomlOn Linux use
ipro_iot_tool_linuxand/dev/ttyUSB0.IPRO_FLASH_PTapplies to everyflashin this window; when you move to an application with its own partition table, clear it withunset IPRO_FLASH_PTor override it with-P. -
Edit the code: open
apps/platform/ipro7ai_reef_demo/main.cand append your own text to the boot banner inmain(): -
Build, flash and monitor: close any terminal program that holds the port, then run:
The running firmware receives
reboot_dland enters download mode by itself, so no buttons are needed. The output, in order (excerpt):Project: ipro7ai_reef_demo (platform/ipro7ai_reef_demo) → Building ipro7ai_reef_demo... ✓ Build succeeded (14s) Binary: <SDK>/apps/platform/ipro7ai_reef_demo/build/build_out/ipro7ai_reef_demo_IPRO7.bin (244 KB) Log: <SDK>/apps/platform/ipro7ai_reef_demo/build/build.log → Entering download mode... reboot to download mode → Flashing ipro7ai_reef_demo_IPRO7.bin (--chip-variant IPRO7AI, --pt <IntelProCube>/chips/ipro7/partition/partition_cfg_2M.toml)... [...] - Chip name is ipro7 ... [...] - [All Success] ✓ Flash succeeded (…) → Opening serial monitor on /dev/cu.usbserial-XXXX at 115200... [serial_monitor] Sent: reboot ... I (…) REEF: IPRO7AI Reef carrier demo - my build ... [serial_monitor] TIMEOUT after 15s ✗ Action 'monitor' failed — stopping. Summary: ✓ build ✓ flash ✗ monitor (exit 2)monitorreads for the-tseconds and ends with exit code 2, which the script lists as a failure. That is expected: oncebuildandflashshow ✓, the new firmware runs on the board. -
Try it interactively: open the console in a terminal program (for example
screen /dev/cu.usbserial-XXXX 115200) and typereef statusorled 0 40 0to check that the new firmware answers. Close the terminal before the next flash. -
Repeat: after each change, run step 3 again. To check only that the code compiles, run
buildalone:
Verify¶
Summaryshows ✓ forbuildandflash.- The boot messages on the console include
IPRO7AI Reef carrier demo - my build. - SW3, SW4 and SW5 still light the LED red, green and blue, and
reef selftestprints the same as before the change.
build_freertos.sh actions and options¶
This tutorial uses build, flash and monitor, with -t (monitor time), -d (alternate configuration) and -P (partition table). Actions run in order and stop at the first failure. The other actions (clean, size, test) and every option and environment variable: macOS / Linux Command Line.
Alternate configurations and build directories¶
One application can have several configuration files. Choose an alternate one with -d; it builds in build_<name>/ and leaves the application's .config untouched:
./build_freertos.sh -d defconfig_wifi_ipro6s build ipro7ai_reef_demo # builds in build_wifi_ipro6s/
./build_freertos.sh -d defconfig_reef_ov5640 build flash ipro7_uvc_cam # USB webcam
flashandsizeuse-dto find the image: when you run them separately, give each the same-d.- The build copies the configuration to
build_<name>/.config; edit the original in the application directory. - After flashing
ipro7_uvc_camwithdefconfig_reef_ov5640and fitting an OV5640, a USB camera (3896:0701) appears on the Reef's USB-C; any camera application on the computer shows the picture. - Every Reef configuration and its build command: Reef build configurations. For applications that need boot2 or
mfgdata on the first flash, see Flashing & Serial Console.
Clean build¶
After changing .config or an alternate configuration — particularly flash size, PSRAM, AI or BLE controller options — clean before building. clean removes only the matching build directory:
./build_freertos.sh clean build ipro7ai_reef_demo # remove and rebuild build/
./build_freertos.sh -d defconfig_wifi_ipro6s clean build ipro7ai_reef_demo # remove and rebuild build_wifi_ipro6s/
clean prints ✓ Clean complete when done.
Reading memory usage¶
The link step prints how much of each memory region is used. With make it appears in the terminal; with build_freertos.sh it goes to build.log:
For ipro7ai_reef_demo with its default configuration:
Memory region Used Size Region Size %age Used
flash: 249944 B 1 MB 23.84%
psram: 45376 B 8 MB 0.54%
ocram: 32144 B 256 KB 12.26%
hbnram: 2460 B 4 KB 60.06%
flashis the flash limit used for linking.ipro7ai_reef_demolinks a 1 MB layout by default (the configure stage prints-- IPRO7 flash: 1M (default, on-chip)); if the Reef's in-package flash reports JEDEC0xEF4015(2 MB), addCONFIG_IPRO7_FLASH_2M=yto.configto use all of it.- A
flashpercentage under 100 does not mean the image fits the firmware partition: compare the.binsize shown afterBinary:with the firmware partition of the table you flash with. Inpartition_cfg_2M.tomlit is 1180 KB. ocramis the on-chip OCRAM. With AI off, the region is 256 KB minus theCONFIG_EM_SIZEused by BLE, and the configure stage prints a line such as-- AI disabled: OCRAM=256KB; with AI on the layout differs. Which settings size each region: Build System & Configuration.
The size action lists the total and per-section sizes of the .elf:
→ Size report for ipro7ai_reef_demo_IPRO7.elf
text data bss dec hex filename
235928 14008 49588 299524 49204 <SDK>/apps/platform/ipro7ai_reef_demo/build/build_out/ipro7ai_reef_demo_IPRO7.elf
...
The numbers come from a V2.2.0 build and change with the toolchain version and your edits.
What the script fills in¶
build_freertos.sh reads its flashing parameters from the application's configuration, so the Reef needs nothing extra:
| Parameter | Source |
|---|---|
--chip-variant |
IPRO7AI when the configuration has CONFIG_IPRO7AI_REEF=y; override with -c or IPRO_CHIP_VARIANT |
--pt |
-P or IPRO_FLASH_PT; with neither, no --pt and the tool uses its own default table |
Baud rate of reboot_dl and monitor |
CONFIG_PLATFORM_UART_BAUDRATE from the configuration, 115200 when unset (921600 for the Reef configuration of ipro7_jpeg_decode) |
| Flashing baud rate | always 921600 |
The script cannot pass boot2 or mfg data, and --chipname is fixed to ipro7; in those cases run IntelProCube directly, see Flashing & Serial Console.
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
✗ Build failed with compiler errors in the last 30 lines |
an error in the code | fix it from the messages; the full log is build.log |
✗ Flash failed; the tool stops at the handshake |
the firmware did not act on reboot_dl (no shell, hung, or another baud rate), or a terminal program holds the port |
close the terminal; hold SW1, press SW2, release SW1, then run flash alone |
✗ Flash tool not found: … |
a new terminal window without IPRO_FLASH_TOOL |
redo step 1, or add the export lines to your shell start-up file |
✗ Binary not found: … |
no build before flash, or -d missing |
add build, or the -d used for the build |
Several serial ports, pass -p PORT or set IPRO_SERIAL_PORT |
IPRO_SERIAL_PORT not set and several ports present |
set IPRO_SERIAL_PORT or add -p |
| The console does not show your text | flashing failed, or you are reading old output | check that flash shows ✓ in Summary; run step 3 again |
A .config change has no effect |
old build results remain | run clean build |
| Another application fails to flash or boot | IPRO_FLASH_PT still points at the previous application's table |
unset IPRO_FLASH_PT and give the right table with -P, see Partition tables |
Next steps¶
- Create Your First Application: start an application of your own.
- Test Your Application: check your application's output automatically.
- macOS / Linux Command Line: every action, option and limit of
build_freertos.sh. - Build System & Configuration:
.configkeys, linker scripts and memory layout.