2019-03-20 10:55 AM
This is for firmware Over the Air(FOTA) updates. This is an mbed-os based device.
My device will be told there is a new FW image and subsequently load it down to an on board SPI memory. I then need to load that image into Flash and make it active. This MCU has dual bank so I would imagine that can be used. All of the examples and references I have seen are ones where a bootloader has been written that will manage the process of moving the new binary from SPI to Flash. This seems like reinventing the wheel to me.
App Note AN2606 discusses a Bootloader that is already present in the STM32 devices.
According to this SPI1/SPI2 are supported serial peripherals for this device.
Can't I use this bootloader to pull my image in from SPI and move that to Flash?
If so, how?
I just cannot glean that information from this application Note.
How does my application cause the bootloader to take action?
Does it simply load from the address 0 of the SPI device?
How does it know when it's complete?
Am I completely off-track here?
Thank you so much!
2019-03-20 11:15 AM
>>Am I completely off-track here?
I think so.
It is not going to pull from random SPI memory devices. As far as I'm aware is just acts as a slave device and the STM32 loader protocol just uses the SPI as a transport for the bytes it would otherwise get via USART, etc.
>>How does my application cause the bootloader to take action?
It is code like any other, you can jump to it, it has a vector table defining the entry point. I personally would branch out of the Reset_Handler. You normally enter via a reset with BOOT0 pulled high.
Got some random SPI memory attached, you're going to have to code your on read/write support over the SPI, and pull the data, erasing/writing the STM32 Flash as you go.