Upgrade ESA2GJK1DH1K articles: STM32 pong remote upgrade, AT command based GPRS module TCP transparent transmission mode, the timing to access the upgrade (containing parity data)

 

 

 

Realize the function summary

 

  SCM regular use http version of the program to access the cloud, if the version is inconsistent,

  Http then download the latest upgrade file, remote upgrade STM32 program.

  Compatible Air202, SIM800

 

Test preparation (default access my server, instead of their own server, see below explanation)

First, download BootLoader program (please to download)

  

 

 

Second, adjusting the position of the rocker switch, and the STM32 serial communication GPRS

  

  

Second, do not forget to insert the phone card, and install the antenna

  

 

III. Prepare two serial module, the RX serial two modules, each connected to the microcontroller PA9 and PA10.

  4.1 Note: This is the STM32 and monitoring data between GPRS, see the update process.

    

  4.2 schematic

    

    

start testing

A. Currently only downloaded BootLoader procedures, updated BootLoader program which requires the following operations

  Press PB5 about 4S, waiting lamp flash, release PB5, 3S LEDs shine after writing program update flag, and then restart 

    

II. Monitoring data

  

 

 

 

  

III. Use a pin practical application control module restart

  3.1 modify in each program file here (note, I did not lead the board now reset pin, the next batch of the board will follow)

    

  

  3.2 If there is no reset may occur has been sent AT + CIPSHUT, modules have to wait a long time reaction

  Now test can be artificially reset!

    

IV. Run user program, once every 30S access cloud version

 

  

 

Modified to connect their own servers

A, IP address changes BootLoader, and Web server program two user connections, port number information

  

 

 

  

 

 

  

 

 

 

Two, Http path to access the program files, modify according to their own, I follow my own instructions

  2.1 According to the path of the microcontroller to access, create a folder in the Web server

    

    

 

 

  

  2.2 Open the PC software to calculate the value of two SUM user program

    

    

 

    

 

  2.3 calculated first check value of the user program, and replace the field value SumBin1

    

 

 

    

 

 

 

 

 

 

 

  2.4 parts by computing a second checksum value of the user program, and replace the field value SumBin2

    

 

 

    

 

 

 

  2.2 拷贝记录设备版本的updatainfo.txt文件,和用户程序1文件(Progect.bin),用户程序2文件(Progect2.bin)到服务器

    

 

 

    

 

 

    

 

 

 

  最终效果

    

修改完了,然后按照文章一开始的测试

  升级成功以后用户程序里面在定时询问是不是有新版本

  咱刚升级进去的肯定是新版本.

  咱到云端修改下版本

四,修改云端版本

  

  

五,用户程序检测到新版本,写入更新标志,重启,BootLoader更新另一份程序,重启,运行新程序

  

 

 

 

其它

一,可先下载第一份程序到单片机,让单片机默认运行一份程序

  1.1 操作步骤是先下载BootLoader程序(下载进去就可以,不需要任何配置)

  1.2 下载第一份用户程序(程序默认加载第一份用户程序),请按照下面配置下载

    

 

 

 

此时单片机启动以后便会运行第一份用户程序.

  

 

 

 

    

Guess you like

Origin www.cnblogs.com/yangfengwu/p/11939476.html
Recommended