Skip to main content
Ahmed.Waqar
Associate III
February 24, 2018
Solved

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

  • February 24, 2018
  • 4 replies
  • 2609 views
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
    This topic has been closed for replies.
    Best answer by Andrew Neil
    Posted on February 24, 2018 at 13:17

    Essentially the same question:

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

    4 replies

    Andrew Neil
    Andrew NeilBest answer
    Super User
    February 24, 2018
    Posted on February 24, 2018 at 13:17

    Essentially the same question:

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

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Tesla DeLorean
    Guru
    February 24, 2018
    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 VenmoUp vote any posts that you find helpful, it shows what's working..
    Ahmed.Waqar
    Associate III
    February 24, 2018
    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?

    Andrew Neil
    Super User
    February 24, 2018
    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.

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Ahmed.Waqar
    Associate III
    April 20, 2018
    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.

    Tesla DeLorean
    Guru
    April 20, 2018
    Posted on April 20, 2018 at 14:27

    The conversion has been forked to this thread

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

    This seems to describe more RAM than is physically available in the F103C8, ie 20KB 0x20000000..0x20004FFF

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Ahmed.Waqar
    Associate III
    April 21, 2018
    Posted on April 21, 2018 at 10:37

    Thanks Sir

    Turvey.Clive.002

    . Now I am using STM32F103RE that has 64k ram. But when I configure its clock, debugger gets struct in while loop at

    if (HAL_RCC_OscConfig(&oscinitstruct)!= HAL_OK)

    {

    /* Initialization Error */

    while(1);

    }

    Please check the following modification for 8 MHz HSE. Am I doing it wrong?

    0690X0000060AeGQAU.png

    I am using following IAP example

    .\AN4657-STM32Cube_IAP_using_UART\Projects\STM3210C_EVAL\IAP_Main\EWARM\STM3210C_EVAL\

    Ahmed.Waqar
    Associate III
    April 21, 2018
    Posted on April 21, 2018 at 10:46

    Even it is getting struct with following configuration as well

    0690X0000060AiHQAU.png