cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 flash-reprogram throught memory stick

bfeixas
Associate II
Posted on July 06, 2011 at 13:38

Hi,

I am trying to reprogram the flash memory of an ARM (STM32F105RC) trhought a memry stick (USB OTG) and I would know if it is possible and someone has any experience on that.

Reading the documentation it seems it should be possible but I'm not sure.

Any help?

#usb-host-iap-flash
6 REPLIES 6
Posted on July 06, 2011 at 14:51

Yes, it should be possible.

You need a USB Host and (presumably) a filesystem to read the image from the stick. There should be plenty of examples of this.

You also need to write the image to Flash, and then run it; which is what a Bootloader does.

Bootloader examples are available.

One potential issue is the amount of code space that all this will take - which will limit the size of image that you can load...

Posted on July 06, 2011 at 15:22

Any time you can see and touch data in your system, you should be able to use that as a source for an update.

So you'd need a USB stack, a mass-storage driver, and a minimalist file system (ie find one specific file in the root directory) for FAT 16/32. As Andrew points out the foot print (FLASH and RAM) to do this will likely be quite substantial.

People have done similar things with MMC cards, serial flash, ethernet networks, wireless modems, etc. Basically any data conduit you have access to.

If you have enough memory, you could use application code to get the data into the system, and then the boot loader would then just need to copy that into FLASH, simplifying the boot loader significantly.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
bfeixas
Associate II
Posted on July 06, 2011 at 18:43

Ok, I will start looking for some examples then, thanks :)

alok472
Associate II
Posted on July 07, 2011 at 14:46

The USB Host library example (UM1021  STM32F105/107xx USB Host library  ) for mass-storage already has the code for reading files from the USB-Disk. I have used this FW. Once the file is read, you can use this to program the flash. For this, use the IAP related examples. for example refer to AN3226  (& also UM0462)

Posted on July 07, 2011 at 16:07

The USB Host library example (UM1021  STM32F105/107xx USB Host library  ) for mass-storage already has the code for reading files from the USB-Disk. I have used this FW. Once the file is read, you can use this to program the flash. For this, use the IAP related examples. for example refer to AN3226  (& also UM0462)

Out of curiosity, How large was the footprint you ended up with?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Nickname12657_O
Associate III