Some programs require multiple images to be flashed simultaneously, such as programs with the over-the-air (OTA) upgrade functionality, which must be flashed together with MCUboot to function properly. Such projects can be debugged in CCS by following the steps below.
Take the MCUboot and basic_ble_oad_dual_image projects in CC2340R5 as an example:
- First, use UniFlash to flash both the MCUboot and basic_ble_oad_dual_image projects into the CC2340 simultaneously. For the detailed procedure, see also OAD Target Setup.
- Right-click the targetConfigs/CC2340R5.ccxml file in the MCUboot project or the basic_ble_oad_dual_image project, and select Start Project-less Debug from the menu:
- CCS opens the Debug view, expands the THREADS menu, and shows that the target chip is currently in the DISCONNECTED state. Right-click on DISCONNECTED and click Connect Target from the menu to connect to the target chip:
- Once the connection is successful, the status changes to HALTED, and the top row of debug buttons turn on, allowing you to perform debug operations. However, the CALL STACK field only displays the address of the current program pointer and cannot display the corresponding code because we have not loaded the symbol file for the program images:
- Click Run → Load → Load Symbols and select Browse in the pop-up dialog. Locate the .out file for the project (for example, mcuboot_LP_EM_CC2340R5_nortos_ticlang.out), and click OK to load it. Note that the symbol file here must be in .out format, and other formats (hex or bin) do not contain symbol information:
- After loading the symbols, we can debug normally in CCS, such as adding breakpoints in the program, single-stepping, viewing variables and registers, and so forth. Note that loading symbols simply loads the mapping of variables, functions, and addresses into the project and does not re-flash the program. Therefore, the program that was previously flashed by UniFlash is still running on the chip. If the program has been modified, re-flash it using UniFlash and load symbols by following the steps above; otherwise, the symbols in CCS may not be the same as those in the program actually running on the chip:
- Now we have loaded the symbols for MCUboot only. Once the program jumps from MCUboot to basic_ble_oad_dual_image, it is also necessary to add the symbol file for the basic_ble_oad_dual_image project. Click Run → Load → Add Symbols (note to click Add Symbols, not Load Symbols) to load basic_ble_oad_dual_image_LP_EM_CC2340R5_freertos_ticlang.out into CCS. You can now debug both projects simultaneously:
Tips: To check the ROV information for the basic_ble_oad_dual_image project, select basic_ble_oad_dual_image_LP_EM_CC2340R5_freertos_ticlang.out in the Load Symbols step, and then add mcuboot_LP_EM_CC2340R5_nortos_ticlang.out. Otherwise, the ROV information may not be displayed properly because the two projects are configured differently.