cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any template or example program for implementing OTA? I have 2MB SPI EEPROM, SIM808 for GPRS communication and STM32F070 on board.

Ahmed.Waqar
Associate II
Posted on February 24, 2018 at 13:03

Hello,

Is there any template or example program for implementing OTA? I have 2MB SPI EEPROM, SIM808 for GPRS communication and STM32F070 on board.

I am using CoIDE and have little understanding about how to do it, such as

  • Receive binary file to the board form GPRS module

  • Save it in external flash memory then use IAP to flash the new firmware

  • Then finally use DFU mode for changing the start address of the MCU

But except receiving the binary file and storing it in EEPROM, I have no idea about how to proceed further. Please provide assistance. 

Regards,

#clive #clive1 #clive-one #andrew-neil
1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Evangelist III
Posted on February 24, 2018 at 13:17

Essentially the same question:

https://community.st.com/0D50X00009XkdnXSAR

View solution in original post

12 REPLIES 12
Andrew Neil
Evangelist III
Posted on February 24, 2018 at 13:17

Essentially the same question:

https://community.st.com/0D50X00009XkdnXSAR

Posted on February 24, 2018 at 15:59

Not sure there are end-to-end examples, this is typically specialize work product.

You'd want to break this into steps

Get an understanding of reading/writing/erasing your flash device.

Learn the AT and socket commands to implement an HTTP GET or FTP type interaction with the modem, cellular network and server resources.

Review the existing IAP (USART, CAN, ETHERNET) examples ST provides for assorted families and parts. These as Andrew points out in the other thread can be found under the resources for a given part or family, but now also exist in the Applications examples in the Cube/HAL software trees.

\STM32Cube_FW_F0_V1.9.0\Projects\STM32091C_EVAL\Applications\IAP\IAP_Main

(part of the CubeF0 ZIP file)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 24, 2018 at 16:30

Sir it looks similar to what I have already tested with arduino.cc. I have updated my flash with new programs using IAP-USART. Now I want to update my flash remotely, so I can have new firmware either in EEPROM or directly from Rx-Tx connected to SIM808. My question is how can I update my flash from either source? The above example(

\STM32Cube_FW_F0_V1.9.0\Projects\STM32091C_EVAL\Applications\IAP\IAP_Main

) works with physical serial port of PC.

Flow of my task would be as follows,

  1. Receive .bin file via GPRS and store it in EEPROM. (I have done it)
  2. Apply CRC to ensure correct reception of .bin file. 

     (I have done it)

  3. Now update flash with received firmware. (No idea how to do it)

Please guide me how to proceed further right from the point 3?

Posted on February 24, 2018 at 16:41

ahmed.waqar wrote:

Pleaseguide me how to proceed further right from the point 3?

That is covered in the other thread, and in the example that

Turvey.Clive.002

‌ just pointed you to.

Posted on February 24, 2018 at 16:45

Per the IAP examples there are basically two firmwares, one is the boot loader, and the other is the application. These are built to exist in two different memory spaces within the Internal Flash. ie 0x08000000 and 0x08008000 The size of the boot loader is dictated by the complexity required to support the devices being used and the amount of user interface you wish to provide. You should try to be as minimalistic as possible, ie just do enough to validate and manage the update and control transfer to the application.

The more complex task of downloading the new application image into the SPI Flash can be done by the application portion, where you have code/libraries to manage the modem, sockets, downloads, etc.

You need to review the IAP boot loader, and add in code to read your SPI Flash in place of the YMODEM stuff. So basically erase the Application space within the Internal Flash and then read blocks from SPI Flash and write them to the Internal Flash.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 24, 2018 at 17:00

Thank you Sir for your prompt support. I will study 

IAP boot loader in detail and try to follow your suggestions. Will get back to this post after some progress.

Posted on February 24, 2018 at 17:01

I'll check them in detail. thanks

Ahmed.Waqar
Associate II
Posted on April 20, 2018 at 11:29

Hello Sir

Turvey.Clive.002

‌,

Neil.Andrew

I followed your instruction and managed a successful IAP test with STM32F429 using support given in

.\STM32Cube_FW_F4_V1.0\Projects\STM324x9I_EVAL\Applications\IAP

However, I get error (attached as images) while doing same test with STM32F103C8 using support given in

.\STM32Cube_FW_F1_V1.6.0\Projects\STM3210E_EVAL\Applications\IAP

0690X0000060AdDQAU.png

0690X0000060AhYQAU.png

Sir I have STM32F103 on board therefore I need it.

Posted on April 20, 2018 at 10:44

I followed your instruction and managed a successful IAP test with STM32F429 using support given in

.\STM32Cube_FW_F4_V1.21.0\Projects\STM324x9I_EVAL\Applications\IAP

However, I get error (attached as images)  while doing same test with STM32F103C8 using support given in

.\STM32Cube_FW_F1_V1.6.0\Projects\STM3210E_EVAL\Applications\IAP

0690X0000060AguQAE.png0690X0000060AgzQAE.png

Sir I have STM32F103 on board therefore I need it.