EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Help for USB Secondary ISP Bootloader for lpc2148

Started by thonguyen02 July 18, 2008
Hi,

I download the USB Secondary ISP Bootloader example for LPC2148 to use
for Keil MCB2140 board at
http://www.standardics.nxp.com/support/documents/microcontrollers/zip/an10711.zip

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.
Look like the file copy over to the wrong flash location, not at 0x2000

Can anyone show me how to fix it?

An Engineer's Guide to the LPC2100 Series

I check the flash image and see that on window PC, when copy the
firmware.bin it writes image to address 0x2000, that is the location
where bootloader jump to user application.

But on linux, when I copy firmware.bin, it writes to address 0x2400
that is why the user application can't run when reset.

I try to edit the IAP source code to move the write address to 0x2000
by - 0x400 to the IAP destination address but that make my usb hanged.

Anyone has any idea how to fix?

I did ask NXP for help but they told me that they never test this
example on linux so they can't help.

--- In l..., "thonguyen02" wrote:
>
> Hi,
>
> I download the USB Secondary ISP Bootloader example for LPC2148 to use
> for Keil MCB2140 board at
>
http://www.standardics.nxp.com/support/documents/microcontrollers/zip/an10711.zip
>
> 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.
> Look like the file copy over to the wrong flash location, not at 0x2000
>
> Can anyone show me how to fix it?
>

I found a way to fix it to make it writes at address 0x2000 on both
window and linux version by hard code the address at 0x2000 and
increase at 256 at every IPA write command.
This pointer (firmware + (offset - (BOOT_SECT_SIZE + FAT_SIZE +
ROOT_DIR_SIZE ))) points to different location on linux and window.

--- In l..., "thonguyen02" wrote:
>
> I check the flash image and see that on window PC, when copy the
> firmware.bin it writes image to address 0x2000, that is the location
> where bootloader jump to user application.
>
> But on linux, when I copy firmware.bin, it writes to address 0x2400
> that is why the user application can't run when reset.
>
> I try to edit the IAP source code to move the write address to 0x2000
> by - 0x400 to the IAP destination address but that make my usb hanged.
>
> Anyone has any idea how to fix?
>
> I did ask NXP for help but they told me that they never test this
> example on linux so they can't help.
>
> --- In l..., "thonguyen02" wrote:
> >
> > Hi,
> >
> > I download the USB Secondary ISP Bootloader example for LPC2148 to use
> > for Keil MCB2140 board at
> http://www.standardics.nxp.com/support/documents/microcontrollers/zip/an10711.zip
> >
> > 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.
> > Look like the file copy over to the wrong flash location, not at
0x2000
> >
> > Can anyone show me how to fix it?
>
Hello thonguyen02,

Can you list the changes you made to the bootloader code to fix the address at 0x2000?

Thanks.
--- In l..., "thonguyen02" wrote:
>
> I found a way to fix it to make it writes at address 0x2000 on both
> window and linux version by hard code the address at 0x2000 and
> increase at 256 at every IPA write command.
> This pointer (firmware + (offset - (BOOT_SECT_SIZE + FAT_SIZE +
> ROOT_DIR_SIZE ))) points to different location on linux and window.
>


The 2024 Embedded Online Conference