cancel
Showing results for 
Search instead for 
Did you mean: 

FWUPDATE Algorithm

florian239955_st
Associate II
Posted on April 22, 2016 at 17:06

Hi Gerry,

I need to update the firmware of my devices (not the firmware of the module) over the air. Can you give an example which commands the firmware update with at+s.fwupdate uses and how the firmware update works?

Regards,

Flow
4 REPLIES 4
Posted on April 24, 2016 at 11:53

Hi Flow,

FWUPDATE command must be used to update module's FW over the air.

If you want to update your MCU application, you can use the FSUPDATE command. Something like this:

1 - download new MCU FW image by FSUPDATE command. Include new FW inside a *.img file

2 - switch MCU to ''bootloader'' mode (if STM32, follow

AN2557

)

3 - call FSR command, and collect bytes to write #1 MCU ''main application'' flash page (if STM32F1, 2048 bytes)

4 - repeat step 3, till whole application is replaced (page by page)

5 - switch MCU to ''application'' mode

If SPWF02S is used, without FWUPDATE and FSUPDATE commands, use raw sockets to download new FW image.

Hope it helps

j

florian239955_st
Associate II
Posted on April 24, 2016 at 13:46

Hi Gerry,

thank you - that helps :)

The image of my firmware will be up to 1MByte, so the module memory is not big enough, so I will need to use raw sockets...

I watched the traffic during a FWUPDATE. Can you tell me which AT commands are behind  the FWUPDATE. First a httpget and then something with TCP...

Best regards,

Flow

Posted on April 25, 2016 at 18:14

Use all available socket's commands.

HTTP is based on TCP, so, open a TCP socket client, and write your http request to remote webserver. Then read and store received bytes into some external flash, or flash MCU application on the fly. Your decision. Enjoy.

florian239955_st
Associate II
Posted on April 27, 2016 at 17:51

Hi Gerry,

thank you for your reply.

I use following commands

AT+S.SOCKON=www.example.com,80,t,ind

AT+S.SOCKW=00,98

GET /downloads/examples HTTP/1.1

....

and so on and then I read the socket. But if my file contains 0x0D 0x0A I receive only 0x0A... I tried different content-types in the header, but with no success. Do you have an idea?

Cheers,

Flow