cancel
Showing results for 
Search instead for 
Did you mean: 

Firmware upgrade using SPI - STM32F7

Omar Suárez
Senior
Posted on June 26, 2017 at 17:25

Hi everyone,

I am trying to understand how the firmware upgrading works in the STM32F7 using a STM32F769I Discovery board. I would need to use the UART or SPI peripheral to upgrade.

Does anyone know where to find example code?

Thanks in advanced,

Omar

#firmware-update #stm32f7 #bootloader
7 REPLIES 7
Posted on June 26, 2017 at 17:30

There are application notes on the USART and SPI boot loader protocol.

The 'Flash Loader Demonstrator' provides an example of the USART solution, and a number of open source implementations also exist. The protocol is documented, and not that complicated.

https://community.st.com/community/stm32-community/blog/2017/05/02/stm32-spi-bootloader-host

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 26, 2017 at 17:31

Can we fix it so cites pointing to ST.COM don't require moderation?

http://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Imen.D
ST Employee
Posted on June 29, 2017 at 18:10

Hi,

You may use the attacheda new version of FlashLoader demonstrator adding support of STM32F7 devices (STM32F76x/x7/x8/x9)

Regards

Imen

________________

Attachments :

STMFlashLoader Demo_V2.9.0RC4.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyZz&d=%2Fa%2F0X0000000b9m%2FTWbPqE6ai0bLmcSdgoFnx9eDH0dH68OlUWxAZmxJ_lE&asPdf=false
When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on June 29, 2017 at 17:32

Hi Clive,

thanks for the replies!

I am reading the AN2606t but I am still not sure what FSM need to implement. My MCU is a STM32F769 so in pages 184 and 185 are two flowcharts: one for Dual Bank Boot implementation and the other one explaning the Bootlioader V9.x selection.

Should then I implement both state machines in order to have access to the bootloader execution ? I guess is also necessary to configure the FLASH registers of the MCU, isn't?

thanks again,

Omar

Posted on June 29, 2017 at 17:54

I believe that the system loader should manage the FLASH registers. You get to erase blocks, and read/write data into the array.

It's not my battle, so I haven't spent hours digging into it, but the point at which built in ROM boot loaders cease to be helpful you typically push your own loader code into RAM which can have a better protocol and a richer implementation, that fully supports the specific facets of the board as implemented. This kind of staged or tiered loader model is very prevalent in SoC designs.

For these devices I'd recommend having your own boot loader which resides in the first 16KB block (can be bigger if need be), and have your application code separate, where the boot loader can validate the image before jumping into it. For the Dual bank model where you basically replicate the first MB into the second MB, the loader can still manage the image used, set the BPB bit, and fork to the appropriate one (figure a sequence number can determine the newest one).

I would recommend you start by getting comfortable with the system boot loader, you can do this in an interactive manner, and once you are comfortable with how it works, and how that fits with what you want to achieve, then decide how you want to partition the programming application vs the image you want to deliver to the part. Programming applications used for production programming tend to differ from those for field/user programming.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 30, 2017 at 10:42

Hi Imen,

I have been taking a look to this ST technical video about how to boot in system memory without using the BOOT pins. In the example it uses some code and the Flash Loader to do that. Is there any AN or any example code about the steps commented in this video in how to boot without those pins?

Thanks,

Omar

Posted on June 30, 2017 at 10:43

Sorry, I forgot the link to the video :

https://www.youtube.com/watch?v=cvKC-4tCRgw