I download the USB Secondary ISP Bootloader example for LPC2148 to
use for Keil MCB2140 board at
The bootloader works as an USB Mass Storage to upload the user
application into flash by copy and replace the firmware.bin.
It works fine on window PC when I copy my binary file to replace
firmware.bin. After I reset the board, it will jump to the user
application location and run the user application.
But it does not work on Linux, I use opensuse 10.3, when I copy
binary file to replace firmware.bin. Sometime, it did not allow to
delete the firmware.bin and it never run after I reset.
Can anyone show me how to fix it?
you can convert axf file to bin file by fromelf.exe tool from
keil. It's locate at Keil/ARM/BIN31 folder.
the command is:
fromelf --bin -o outfile.bin infile.axf
To switch the usb mode from mass storage to hid you need to modify
the usbdesc.c and usbcfg.h file. You can open the example of usbhid
and usbmem of MCB2140 to see the different.
USB Secondary ISP Bootloader for lpc214x didn't work on linux
because the write flash address is different between window and
linux, for linux it's shift to the right some byte, not exactly at
0x2000. So we need to modify the write_flash function of sbl_iap.c to
make sure it write to flash at 0x2000 or the address we want.