How do you combine PSoC® Creator™ dual-application bootloadable hex files (PSoC 3, PSoC 4, and PSoC 5LP) for production programming using the command prompt?
For production programming and testing, you may need to merge dual-application bootloadable hex files. This will enable the device to be programmed with a combined hex file, which will contain a bootloader and both applications. Follow these steps to merge the hex files using the command prompt:
1. Open a Command Prompt window.
- In Windows® XP, click Start and Run, and type cmd.exe.
- In Windows Vista and Windows 7, click Start, select All Programs and Accessories; double-click Command Prompt
- In Windows 10, click Start, select Windows System, and double-click Command Prompt.
2. Change the current directory to the folder containing the combined workspace file of the bootloader project. The syntax for the command is: cd "path of the workspace file"—for example:
cd "C:\Users\geon\Documents\PSoC Creator\TestBootloader"
Note: In this case, the “TestBootloader” folder contains the workspace file (TestBootloader.cywrk).
3. To combine the project, type this command in command prompt:
“[Path of installation folder of PSoC Creator]\[version of PSoC Creator]\PSoC Creator\bin\cyelftool.exe" -M "[Path of first bootloadable_1.elf file]" "[Path of second bootloadable_2.elf file]" “[Path to save combined hex file]" --flash_size [FlashSize] --flash_row_size [FlashRowSize]
- For 32-bit operating systems, the default path of cyelftool is:
"C:\Program Files\Cypress\PSoC Creator\[version of Creator]\PSoC Creator\bin\cyelftool.exe"
For 64-bit operating systems, the default path of cyelftool is:
"C:\Program Files (x86)\Cypress\PSoC Creator\[version of Creator]\PSoC Creator\bin\cyelftool.exe"
Note: Replace [version of PSoC Creator] with the PSoC Creator version for combining, such as “4.1” or “4.2”.
Replace the [FlashSize] with the size of flash in bytes. Substitute [FlashRowSize] with flash row size in bytes—for example, the final command for a 64-bit system and 256 kB (row size = 256 bytes) device could be:
"C:\Program Files (x86)\Cypress\PSoC Creator\4.2\PSoC Creator\bin\cyelftool.exe" -M "DualApp1.cydsn\ARM_GCC_541\Debug\DualApp1_1.elf" "DualApp2.cydsn\ARM_GCC_541\Debug\DualApp2_2.elf" CombinedHex.hex --flash_size 262144 --flash_row_size 256
4. The CombinedHex.hex file will be available in the workspace folder; in this case, the “TestBootloader” folder (C:\Users\geon\Documents\PSoC Creator\TestBootloader).
5. For more information on the command line merging parameters, type this command:
“[Path of installation folder of Creator]\[version of Creator]\PSoC Creator\bin\cyelftool.exe" -h
For example, the final command for a 64-bit system could be:
"C:\Program Files (x86)\Cypress\PSoC Creator\4.2\PSoC Creator\bin\cyelftool.exe" -h
Figure 1 shows the command prompt screen combining the hex files.
Figure 1. Command Prompt Screen