Hi,
I have just started experimenting with the FRDM-KL25Z with Code Warrior 10.4 and I cannot for the life of me find the binary file to drag onto the device via the USB upload feature. I am brand new to this platform (I am assessing if I want to move away from Atmel) and this is doing my head in... :-)
Previously I have been using MBED and the BIN files it generates have worked just fine. Now I am trying to build the sample project in Code Warrior and I cannot work out which is the right binary file to download (or if I need to run another tool to convert a file to the right format).
I am playing with the sample project I2C_RGB Flash which is a Processor Expert project.
Once again - sorry for the dumb question....
Thanks
Bryon
Solved! Go to Solution.
Don't be affraid to ask questions: life is a learning opportunity :-)
I think you are using the MSD (Mass Storage Device) bootloader? The following article gives an overview about the MSD and debug application:
OpenSDA on the Freedom KL25Z Board | MCU on Eclipse
Keep in mind that you can download and debug with CodeWarrior too (something you cannot do with mbed). Again, the above article should help.
But what you need is the S19 file generated first. Not sure if your project has set this up. Otherwise here is how to do this:
S-Record Generation with gcc for ARM/Kinetis | MCU on Eclipse
It is just that gcc used .hex extension even if the file is an S19 one (you can open it with a text editor to confirm this).
I hope this helps.
Don't be affraid to ask questions: life is a learning opportunity :-)
I think you are using the MSD (Mass Storage Device) bootloader? The following article gives an overview about the MSD and debug application:
OpenSDA on the Freedom KL25Z Board | MCU on Eclipse
Keep in mind that you can download and debug with CodeWarrior too (something you cannot do with mbed). Again, the above article should help.
But what you need is the S19 file generated first. Not sure if your project has set this up. Otherwise here is how to do this:
S-Record Generation with gcc for ARM/Kinetis | MCU on Eclipse
It is just that gcc used .hex extension even if the file is an S19 one (you can open it with a text editor to confirm this).
I hope this helps.
Hi Erich -
I tried this, and it doesn't seem to work for me. Even after configuring the create flash image option, the console never shows the GNU create flash image command being invoked when I build my project. Have you discovered any other conditions which would keep this from running?
There are some warnings thrown by the compiler, but these don't keep the .elf file from being created, and I can debug the project on my target hardware.
I'm using CW10.4 SE for Kinetis K10.
Thanks,
Keith
Have you pressed 'Apply' in the build tools preference page as instructed by the tutorial?
If not, then the settings might not been applied.
Wow - quick reply - thanks!
Just to make sure, I went back and made sure I hit apply, explicitly following the instructions.
I cleaned and re-built the project w/ no luck. The final line on the console shows the linker building the .elf file, and that's it...
Any other ideas?
Thanks,
Keith
maybe you could post the text in your console?
Mine looks like this:
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" | @"INTRO_ZumoBot.args" -o"INTRO_ZumoBot.elf" |
'Finished building target: INTRO_ZumoBot.elf'
' '
'Executing target #70 INTRO_ZumoBot.hex'
'Executing target #71 INTRO_ZumoBot.siz'
'Invoking: ARM Ltd Windows GNU Create Flash Image'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-objcopy" -O srec INTRO_ZumoBot.elf "INTRO_ZumoBot.hex"
'Invoking: ARM Ltd Windows GNU Print Size'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-size" --format=berkeley INTRO_ZumoBot.elf
'Finished building: INTRO_ZumoBot.hex'
text | data | bss | dec | hex filename |
33416 | 44 14988 48448 | bd40 INTRO_ZumoBot.elf |
' '
'Finished building: INTRO_ZumoBot.siz'
' '
Sure, here you go:
**** Build of configuration FLASH for project K10-IR_SP2 ****
C:\Freescale\CW MCU v10.4\gnu\bin\mingw32-make -j6 all
'Building file: ../drivers/wdog/wdog.c'
'Building file: ../drivers/uart/uart.c'
'Building file: ../drivers/rtc/rtc.c'
'Building file: ../drivers/pit/pit.c'
'Building file: ../drivers/mcg/mcg.c'
'Building file: ../drivers/lptmr/lptmr.c'
'Executing target #1 ../drivers/wdog/wdog.c'
'Executing target #2 ../drivers/uart/uart.c'
'Executing target #3 ../drivers/rtc/rtc.c'
'Executing target #4 ../drivers/pit/pit.c'
'Executing target #5 ../drivers/mcg/mcg.c'
'Executing target #6 ../drivers/lptmr/lptmr.c'
'Invoking: ARM Ltd Windows GCC C Compiler'
'Invoking: ARM Ltd Windows GCC C Compiler'
'Invoking: ARM Ltd Windows GCC C Compiler'
'Invoking: ARM Ltd Windows GCC C Compiler'
'Invoking: ARM Ltd Windows GCC C Compiler'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../drivers/wdog/wdog.c" @"drivers/wdog/wdog.args" -MMD -MP -MF"drivers/wdog/wdog.d" -o"drivers/wdog/wdog.o"
'Invoking: ARM Ltd Windows GCC C Compiler'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../drivers/uart/uart.c" @"drivers/uart/uart.args" -MMD -MP -MF"drivers/uart/uart.d" -o"drivers/uart/uart.o"
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../drivers/rtc/rtc.c" @"drivers/rtc/rtc.args" -MMD -MP -MF"drivers/rtc/rtc.d" -o"drivers/rtc/rtc.o"
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../drivers/pit/pit.c" @"drivers/pit/pit.args" -MMD -MP -MF"drivers/pit/pit.d" -o"drivers/pit/pit.o"
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../drivers/mcg/mcg.c" @"drivers/mcg/mcg.args" -MMD -MP -MF"drivers/mcg/mcg.d" -o"drivers/mcg/mcg.o"
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../drivers/lptmr/lptmr.c" @"drivers/lptmr/lptmr.args" -MMD -MP -MF"drivers/lptmr/lptmr.d" -o"drivers/lptmr/lptmr.o"
'Finished building: ../drivers/mcg/mcg.c'
' '
'Finished building: ../drivers/uart/uart.c'
' '
'Finished building: ../drivers/rtc/rtc.c'
'Building file: ../drivers/adc16/adc16-2.c'
'Finished building: ../drivers/wdog/wdog.c'
'Building file: ../drivers/adc16/adc16.c'
' '
'Executing target #7 ../drivers/adc16/adc16-2.c'
' '
'Finished building: ../drivers/pit/pit.c'
'Executing target #8 ../drivers/adc16/adc16.c'
'Finished building: ../drivers/lptmr/lptmr.c'
'Building file: ../cpu/arm_cm4.c'
'Invoking: ARM Ltd Windows GCC C Compiler'
'Building file: ../cpu/sysinit.c'
' '
'Invoking: ARM Ltd Windows GCC C Compiler'
' '
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../drivers/adc16/adc16-2.c" @"drivers/adc16/adc16-2.args" -MMD -MP -MF"drivers/adc16/adc16-2.d" -o"drivers/adc16/adc16-2.o"
'Executing target #9 ../cpu/arm_cm4.c'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../drivers/adc16/adc16.c" @"drivers/adc16/adc16.args" -MMD -MP -MF"drivers/adc16/adc16.d" -o"drivers/adc16/adc16.o"
'Executing target #10 ../cpu/sysinit.c'
'Building file: ../common/io.c'
'Invoking: ARM Ltd Windows GCC C Compiler'
'Building file: ../common/printf.c'
'Invoking: ARM Ltd Windows GCC C Compiler'
'Executing target #11 ../common/io.c'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../cpu/arm_cm4.c" @"cpu/arm_cm4.args" -MMD -MP -MF"cpu/arm_cm4.d" -o"cpu/arm_cm4.o"
'Executing target #12 ../common/printf.c'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../cpu/sysinit.c" @"cpu/sysinit.args" -MMD -MP -MF"cpu/sysinit.d" -o"cpu/sysinit.o"
'Invoking: ARM Ltd Windows GCC C Compiler'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../common/io.c" @"common/io.args" -MMD -MP -MF"common/io.d" -o"common/io.o"
'Invoking: ARM Ltd Windows GCC C Compiler'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../common/printf.c" @"common/printf.args" -MMD -MP -MF"common/printf.d" -o"common/printf.o"
'Finished building: ../drivers/adc16/adc16-2.c'
'Finished building: ../drivers/adc16/adc16.c'
' '
'Finished building: ../cpu/arm_cm4.c'
' '
'Building file: ../common/stdlib.c'
'Building file: ../common/uif.c'
' '
'Executing target #13 ../common/stdlib.c'
'Finished building: ../cpu/sysinit.c'
'Executing target #14 ../common/uif.c'
' '
'Invoking: ARM Ltd Windows GCC C Compiler'
'Building file: ../Sources/main.c'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../common/uif.c" @"common/uif.args" -MMD -MP -MF"common/uif.d" -o"common/uif.o"
'Invoking: ARM Ltd Windows GCC C Compiler'
'Building file: ../Project_Settings/Startup_Code/__arm_end.c'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../common/stdlib.c" @"common/stdlib.args" -MMD -MP -MF"common/stdlib.d" -o"common/stdlib.o"
'Finished building: ../common/io.c'
'Executing target #16 ../Project_Settings/Startup_Code/__arm_end.c'
'Executing target #15 ../Sources/main.c'
'Invoking: ARM Ltd Windows GCC C Compiler'
' '
'Invoking: ARM Ltd Windows GCC C Compiler'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../Project_Settings/Startup_Code/__arm_end.c" @"Project_Settings/Startup_Code/__arm_end.args" -MMD -MP -MF"Project_Settings/Startup_Code/__arm_end.d" -o"Project_Settings/Startup_Code/__arm_end.o"
'Building file: ../Project_Settings/Startup_Code/__arm_start.c'
'Finished building: ../common/printf.c'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../Sources/main.c" @"Sources/main.args" -MMD -MP -MF"Sources/main.d" -o"Sources/main.o"
'Executing target #17 ../Project_Settings/Startup_Code/__arm_start.c'
' '
'Finished building: ../common/uif.c'
'Invoking: ARM Ltd Windows GCC C Compiler'
'Building file: ../Project_Settings/Startup_Code/kinetis_sysinit.c'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../Project_Settings/Startup_Code/__arm_start.c" @"Project_Settings/Startup_Code/__arm_start.args" -MMD -MP -MF"Project_Settings/Startup_Code/__arm_start.d" -o"Project_Settings/Startup_Code/__arm_start.o"
'Finished building: ../Project_Settings/Startup_Code/__arm_end.c'
' '
'Executing target #18 ../Project_Settings/Startup_Code/kinetis_sysinit.c'
' '
'Invoking: ARM Ltd Windows GCC C Compiler'
'Finished building: ../common/stdlib.c'
'Finished building: ../Sources/main.c'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" "../Project_Settings/Startup_Code/kinetis_sysinit.c" @"Project_Settings/Startup_Code/kinetis_sysinit.args" -MMD -MP -MF"Project_Settings/Startup_Code/kinetis_sysinit.d" -o"Project_Settings/Startup_Code/kinetis_sysinit.o"
' '
' '
'Finished building: ../Project_Settings/Startup_Code/__arm_start.c'
' '
'Finished building: ../Project_Settings/Startup_Code/kinetis_sysinit.c'
' '
'Building target: K10-IR_SP2.elf'
'Executing target #19 K10-IR_SP2.elf'
'Invoking: ARM Ltd Windows GCC C Linker'
"C:/Freescale/CW MCU v10.4/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc" @"K10-IR_SP2.args" -o"K10-IR_SP2.elf"
'Finished building target: K10-IR_SP2.elf'
' '
../drivers/mcg/mcg.c: In function 'pll_init':
../drivers/mcg/mcg.c:21:17: warning: 'pll_freq' may be used uninitialized in this function [-Wmaybe-uninitialized]
../Sources/main.c: In function 'main':
../Sources/main.c:38:5: warning: implicit declaration of function 'init_PIT0' [-Wimplicit-function-declaration]
../Sources/main.c:40:5: warning: implicit declaration of function 'enable_PIT0_int' [-Wimplicit-function-declaration]
../Project_Settings/Startup_Code/kinetis_sysinit.c: In function 'Default_Handler':
../Project_Settings/Startup_Code/kinetis_sysinit.c:34:2: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
../Project_Settings/Startup_Code/kinetis_sysinit.c: In function '__init_user':
../Project_Settings/Startup_Code/kinetis_sysinit.c:59:2: warning: implicit declaration of function 'sysinit' [-Wimplicit-function-declaration]
Do you think the warnings could be causing the problem?
Also, here's a screenshot of the flash image tool config. screen:
hmm, I don't see the problem. The warning should not cause such a problem at all. Would it be possible to post your project (as zip file)? I have sent you a direct message so you could send the project to me directly (if you can do this).
Otherwise, no sure what's going on. It looks like the additional utility somehow does not get called.
I have found the problem :-). To make a long story short. The problem was caused by custom per file/folder settings. As a result, the post build step with S19 file generation is not called.
The long story is here:
Traps and Pitfalls: No Hex/Bin/S19 File Created with GNU? | MCU on Eclipse
I hope this is useful for others who might run into that trap.
As a general advise: perform project option changes on the *project* root folder, not on files or source folders inside the project.
I hope this helps.
Thanks Erich,
I had a suspicion it was a project setting but just could not work out where to look.
It worked a treat. Thanks very much.
One final question. If I decide to no use Processor Expert and write all my own code is it just these settings that I will still need?
Thanks
Bryon
Hi,
I changed the title of this thread to make it easier for people searching for resolutions to this problem.
Thanks again Erich!
-Bryon
Hi Bryon,
yes, the settings are gcc specific and apply to any kind of gcc projects.
Erich