LPC11U24 USB MSC bootloader and bin from Keil

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC11U24 USB MSC bootloader and bin from Keil

883 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Jeroen3 on Wed Oct 30 15:38:20 MST 2013
Hi,

I've a custom board with an LPC11U24, I've chosen this chip for its internal usb bootloader and mbed library support.
When I go into the USB MSC (Mass Storage) bootloader with the P0_1 button it successfully mounts as CRP_DISABLED.
I can remove the old .bin file and copy a new .bin file to it, and powercycle the board.

This all works great, but whenever I download a .bin created with Keil uVision the device boots in bootloader again. Indicating invalid user code accoring to the bootup sequence.
When I compile the identical project with the mbed online compiler the chip does boot properly.

I'm using an exported Keil uVision (4.70) project, I might have touched the optimizer, but restoring that didn't fix it.
I know the code Keil linked works because when I downloaded it with my uLink2 it runs fine.

Do I need some special linker command to make a keil binary valid when loaded with USB MSC DFU?




Labels (1)
0 Kudos
2 Replies

623 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Jeroen3 on Thu Oct 31 02:10:07 MST 2013
Adding the following to "Run User Programs After Build" in the User tab solved the issue:

Run #1: C:\Keil\ARM\BIN\ElfDwT build\SteppermotorBoard.axf
Run #2: fromelf --bin -o build\SteppermotorBoard_LPC11U24.bin build\SteppermotorBoard.axf

Thank you!
0 Kudos

623 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tha on Wed Oct 30 17:29:10 MST 2013
The BIN file created from Keil does not have the checksum added to it automatically.  You have to run a separate utility to insert the checksum into the BIN file.

First runt he elfdwt.exe to insert the checksum into the AXF file.
http://www.keil.com/support/man/docs/uv4/uv4_ut_elfdwt.htm

Then run the fromelf to convert the AXF to BIN file.
http://www.keil.com/support/man/docs/armutil/armutil_BABBDADD.htm

Before loading the BIN file into the device, you can check the BIN file to ensure the checksum was added.  You can do this by running the NXPISP utility that comes with AN11305:
http://www.lpcware.com/content/nxpfile/an11305-usb-system-programming-lpc11u3xlpc11u2x
0 Kudos