Official Code Red and LPCXpresso Documentation
Code Red provides two links with information on how to convert your program into a usable .hex for FlashMagic.
- Generating srec (Motorola S format), binary, ihex (Intel Hex) files
- Post-processing your linked application
Changing the project settings
In order to begin, you need to open your project settings. Once the project properties are open, choose 'C/C++ Build' -> 'Settings'. On the right, select the 'Build Steps' tab.
Now, edit the 'Post-build steps' command and add the steps to create a .hex that FlashMagic can use.
Steps to go from a ELF to a FlashMagic compatible HEX file
I got these steps from a thread on NXP's user forum. They agree with the knowledge base article.
Add the following steps to your Post-build Steps -> Commands
- ELF=>BIN without CRC:
arm-none-eabi-objcopy -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin";
- BIN=>BIN with CRC (this is useful for USB ISP mode with LPC13xx parts):
checksum -v "${BuildArtifactFileBaseName}.bin";
- BIN with CRC => HEX with CRC:
arm-none-eabi-objcopy -I binary "${BuildArtifactFileBaseName}.bin" -O ihex "${BuildArtifactFileBaseName}.hex";
- Save your project properties, and then repeat for your other Build Configurations (Debug/Release).
Now, when you rebuild your project, LPCXpresso should generate a .hex file that FlashMagic will be able to use.
Next, getting your code to actually run...
It helps to add " around the filename parts, otherwise you can have problems with paths including spaces.
ReplyDeleteGood call. I've always avoided spaces and special characters from my command line days so I've never run into this. I'll update my instructions to reflect it.
DeleteWonder Ful. Excellent, Cool, Good Job. Thanks.
ReplyDeleteSucceeded to make HEX with CodeRed LPC Expresso
I cant get hex file.... what is this error
ReplyDeleteInvoking: MCU Archiver
arm-none-eabi-ar -r "libUARThome.a" ./src/main.o ./src/serial.o
c:\nxp\LPCXpresso_5.0.14_1109\lpcxpresso\tools\bin\arm-none-eabi-ar.exe: creating libUARThome.a
Finished building target: libUARThome.a
make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-objcopy -I binary "libUARThome.bin" -O ihex "libUARThome.hex";
c:\nxp\LPCXpresso_5.0.14_1109\lpcxpresso\tools\bin\arm-none-eabi-objcopy.exe: 'libUARThome.bin': No such file
make[1]: [post-build] Error 1 (ignored)
Sounds like you are trying to convert a library file to a HEX file. This won't work, because a library is not a valid ELF executable. You only need to convert your final executable (that has been linked to your libUARThome.a) into the HEX that you can then transfer to your target.
DeleteGreat..!!! It worked thanks a lot..!!! But the I found like, the CRC mismatches. It throws me error like checksum command not found. Which exe do I link the checksum..? Objcopy..?
ReplyDeleteI am getting this error
ReplyDeletemake: *** [SPI_Master.axf] Error 1
How am I gonna resolve it????
I am getting this error.
ReplyDeletePlease help me out
Building target: SPI_Master.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"C:\ALL_LPC1768\SPI_Workspace\CMSISv2p00_LPC17xx\Debug" -Xlinker -Map="SPI_Master.map" -Xlinker --gc-sections -mcpu=cortex-m3 -mthumb -T "SPI_Master_Debug.ld" -o "SPI_Master.axf" ./src/cr_startup_lpc176x.o ./src/main.o -lCMSISv2p00_LPC17xx
c:/nxp/lpcxpresso_5.2.6_2137/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7-m\libcr_c.a(fpprintf.o): In function `printf':
fpprintf.c:(.text.printf+0x3a): undefined reference to `__sys_write'
c:/nxp/lpcxpresso_5.2.6_2137/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7-m\libcr_c.a(_deferredlazyseek.o): In function `__flsbuf':
_deferredlazyseek.c:(.text.(float, long, short, bool, float __restrict)+0x8a): undefined reference to `__sys_istty'
c:/nxp/lpcxpresso_5.2.6_2137/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7-m\libcr_c.a(_writebuf.o): In function `_Cwritebuf':
_writebuf.c:(.text._Cwritebuf+0x16): undefined reference to `__sys_flen'
_writebuf.c:(.text._Cwritebuf+0x2a): undefined reference to `__sys_seek'
_writebuf.c:(.text._Cwritebuf+0x52): undefined reference to `__sys_write'
c:/nxp/lpcxpresso_5.2.6_2137/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7-m\libcr_c.a(alloc.o): In function `malloc':
alloc.c:(.text.malloc+0x70): undefined reference to `_sbrk'
alloc.c:(.text.malloc+0x90): undefined reference to `_sbrk'
c:/nxp/lpcxpresso_5.2.6_2137/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7-m\libcr_c.a(alloc.o): In function `_Csys_alloc':
alloc.c:(.text._Csys_alloc+0xe): undefined reference to `__sys_write'
alloc.c:(.text._Csys_alloc+0x12): undefined reference to `__sys_appexit'
c:/nxp/lpcxpresso_5.2.6_2137/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/lib/armv7-m\libcr_c.a(fseek.o): In function `fseek':
fseek.c:(.text.fseek+0x1a): undefined reference to `__sys_istty'
fseek.c:(.text.fseek+0x3c): undefined reference to `__sys_flen'
collect2: ld returned 1 exit status
make: *** [SPI_Master.axf] Error 1
Another abnormal (yet intriguing) thing is that, however I've stacked Macromedia's Flash Player from the Internet I can't really discover the 'player' anyplace on my PC. anyconv.com
ReplyDeleteI am very enjoyed for this blog. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy. hex To decimal Online convertor
ReplyDeleteYour blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging, Free TikTok Fans
ReplyDeleteI am grateful that I was able to learn something useful from this article. After reading it, I believe you possess excellent expertise. Thank you for sharing Hex To Decimal Converter. Keep up the good work.
ReplyDeleteI am pleased that this article provided me with some important information. Thank you so much for sharing it. Keep up the good work. tool polishing India
ReplyDeleteI always prefer to read the quality content and this thing I found in your post. I am really thankful to you for this post. Best Metal Polish Services India
ReplyDeleteWow, your post is very useful thanks for sharing. It's informative. keep sharing more with us. find out Best Metal Polish Services India for more info visit our site.
ReplyDeleteI like this article. I was searching over search engines about Metal Polish India and found your blog and it really helps thank you very much.
ReplyDeleteExtremely useful information which you have shared here. This is a great way to enhance knowledge for us, and also helps to understand how we can increase followers on Instagram with polishing company India. Thankful to you for sharing an article like this.
ReplyDeleteI am grateful to this blog site providing special as well as useful understanding concerning this subject. Metal Polish company India
ReplyDeleteCan we use any kind of patch file to generate .hex files from Code Red's LPCXpresso? If so, what are the possible harms we may face? Coursework Writing Services
ReplyDeleteThis post can help you in all your code-x files and how to generate them. Cheap assignment writing service uk.
ReplyDelete• In 2009, Bitcoin was presented on the lookout, that turned into the first crypto cash that was acknowledged across the globe. In 2011 and later, a progression of a few other crypto monetary standards were presented. A portion of the well known ones incorporate, Litecoin, Dogecoin, Ethereum, Ripple, Zcash, Dash, etc. NFT Droppers
ReplyDelete