- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm developing for a 4200M-based target system, and I'm using Creator v4.2 with the ARM GCC 5.4 toolchain.
Question: Is there a way to tell the linker to output a flat binary load image instead of hex and elf files?
Thanks,
Mike Holmes
MPE Design Inc.
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"C:\Program Files (x86)\Cypress\PSoC Creator\4.4\PSoC Creator\import\gnu\arm\5.4.1\bin\arm-none-eabi-objcopy" -S -O binary ".\CortexM0p\ARM_GCC_541\Debug\Design01.elf" ".\CortexM0p\ARM_GCC_541\Debug\Design01.bin"
To generate standard intel hex file instead of cypress hex file, please use script:
"C:\Program Files (x86)\Cypress\PSoC Creator\4.4\PSoC Creator\import\gnu\arm\5.4.1\bin\arm-none-eabi-objcopy" -O ihex ".\CortexM0p\ARM_GCC_541\Debug\Design01.elf" ".\CortexM0p\ARM_GCC_541\Debug\Design01_intel_hex.hex"
To generate .s19 file instead of hex file, please use script:
"C:\Program Files (x86)\Cypress\PSoC Creator\4.4\PSoC Creator\import\gnu\arm\5.4.1\bin\arm-none-eabi-objcopy" -O srec ".\CortexM0p\ARM_GCC_541\Debug\Design01.elf" ".\CortexM0p\ARM_GCC_541\Debug\Design01.s19"
To generate bin file use ARM MDK compiler, please use script:
"C:\Keil_v5\ARM\ARMCC\bin\fromelf" --bincombined --output=".\CortexM0p\ARM_MDK_Generic\Debug\Design01.bin" ".\CortexM0p\ARM_MDK_Generic\Debug\Design01.elf"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mike,
You can generate any binary or hex file using objcopy (arm-none-eabi-objcopy in most ARM toolchains used in embedded development).
have a look at the man page for it so you see all the possibilities.
To generate binaries out of elf files comming from the linker:
arm-none-eabi-objcopy -S -O binary final.elf final.bin
Instead of -S you may want to use -R <pattern> or -j <pattern> to specify what sections do you not want or want included in the binary.
Use --info on its own to see all the formats you can convert from and to (usually ihex, srec, binary, etc).
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have encountered similar problem, my steps are somewhat complicated (not optimized), for reference only.
GCC Compiler
Assuming the current project name is Design01, and the Design01.elf file directory generated by the GCC compiler is
C:\Users\xzng\Desktop\Workspace04\Design01.cydsn\CortexM0p\ARM_GCC_541\Debug
Assuming the arm-none-eabi-objcopy utility file directory for the default GCC compiler is
C:\Program Files (x86)\Cypress\PSoC Creator\4.2\PSoC Creator\import\gnu\arm\5.4.1\bin>
Then you need to use the following steps to generate BIN file
1 Open the DOS interface with the CMD command.
2 Set the directory where the arm-none-eabi-objcopy tool is located to the current directory. cd C:\Program Files (x86)\Cypress\PSoC Creator\4.2\PSoC Creator\import\gnu\arm\5.4.1\bin\
3 Enter command arm-none-eabi-objcopy -O binary C:\Users\xzng\Desktop\Workspace04\Design01.cydsn\CortexM0p\ARM_GCC_541\Debug\Design01.elf Design01.bin
4 The generated BIN file is located in the directory C:\Users\xzng\AppData\Local\VirtualStore\Program Files (x86)\Cypress\PSoC Creator\4.2\PSoC Creator\import\gnu\arm\5.4.1\bin
MDK Compiler
Assuming the current project name is Design01, the Design01.elf file directory generated by the MDK compiler is
C:\Users\xzng\Desktop\Workspace04\Design01.cydsn\CortexM0p\ARM_MDK_Generic\Debug\
Assuming that the formelf tool file directory of the MDK compiler is C:\Keil_v5\ARM\ARMCC\bin\
Then you need to use the following steps to generate BIN files from ELF files in DOS environment.
1 Open the DOS interface with the CMD command.
2 Set the directory where the formelf tool is located to the current directory. cd C:\Keil_v5\ARM\ARMCC\bin\
3. Enter command fromelf --bin --output=Design01.bin C:\Users\xzng\Desktop\Workspace04\Design01.cydsn\CortexM0p\ARM_MDK_Generic\Debug\Design01.elf
4. Enter command fromelf --bincombined --output=Design01.bin C:\Users\xzng\Desktop\Workspace04\Design01.cydsn\CortexM0p\ARM_MDK_Generic\Debug\Design01.elf
Note: The fromelf option --bin generates one binary file for each load region of your application. if one complete binary file is needed, consider using the option --bincombined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"C:\Program Files (x86)\Cypress\PSoC Creator\4.4\PSoC Creator\import\gnu\arm\5.4.1\bin\arm-none-eabi-objcopy" -S -O binary ".\CortexM0p\ARM_GCC_541\Debug\Design01.elf" ".\CortexM0p\ARM_GCC_541\Debug\Design01.bin"
To generate standard intel hex file instead of cypress hex file, please use script:
"C:\Program Files (x86)\Cypress\PSoC Creator\4.4\PSoC Creator\import\gnu\arm\5.4.1\bin\arm-none-eabi-objcopy" -O ihex ".\CortexM0p\ARM_GCC_541\Debug\Design01.elf" ".\CortexM0p\ARM_GCC_541\Debug\Design01_intel_hex.hex"
To generate .s19 file instead of hex file, please use script:
"C:\Program Files (x86)\Cypress\PSoC Creator\4.4\PSoC Creator\import\gnu\arm\5.4.1\bin\arm-none-eabi-objcopy" -O srec ".\CortexM0p\ARM_GCC_541\Debug\Design01.elf" ".\CortexM0p\ARM_GCC_541\Debug\Design01.s19"
To generate bin file use ARM MDK compiler, please use script:
"C:\Keil_v5\ARM\ARMCC\bin\fromelf" --bincombined --output=".\CortexM0p\ARM_MDK_Generic\Debug\Design01.bin" ".\CortexM0p\ARM_MDK_Generic\Debug\Design01.elf"