Rapid Prototyping for general microcontroller applications, Ethernet, USB and 32-bit ARM® Cortex™-M3 based designs

Field upgrading firmware using USB flash drive

01 May 2014

I'm trying to develop a product using the mbed lpc1768 HDK. Ultimately, it will be a custom board, deployed to customers in the field. It will act as a USB Host, reading and writing a USB flash drive. I'd like to be able to deploy any firmware updates as a file that the customer can load on the flash drive, plug into the device, and it would automatically update the firmware. Unlike the stock mbed device, I won't have another microcontroller to control the loading.

This would require it to reprogram itself using IAP. Either by copying some minimal loader code into SRAM or maybe the last on-chip flash sector and then execute from there.

Has anyone done something like this?

05 May 2014

?

05 May 2014

Is it possible? Yes. But I wouldn't be surprised if no one has done this before.

05 May 2014

It's possible, but you'll need a bootloader that's capable of acting as a USB MSD Host which isn't exactly "minimal loader code", and I doubt it'll be able to run out of SRAM. You'll probably have to go the traditional route and have two binaries: a bootloader that resides in the lower region of flash, and a user application that resides in the upper region of flash. The bootloader will run on reset and either jump to the user application or, if certain conditions are met, re-program the user application from a flash drive. None of this will be possible with the online compiler, you'll need to use an offline compiler and some custom linker maps. Good luck!

05 May 2014

Neil Thiessen wrote:

It's possible, but you'll need a bootloader that's capable of acting as a USB MSD Host which isn't exactly "minimal loader code", and I doubt it'll be able to run out of SRAM. You'll probably have to go the traditional route and have two binaries: a bootloader that resides in the lower region of flash, and a user application that resides in the upper region of flash. The bootloader will run on reset and either jump to the user application or, if certain conditions are met, re-program the user application from a flash drive. None of this will be possible with the online compiler, you'll need to use an offline compiler and some custom linker maps. Good luck!

Ok, thanks. I didn't want to reinvent if I didn't have to. I've done it on an LPC2212 with the Keil compiler using the two binary approach. I guess I'll need to do it again.

Please log in to post a reply.