摘要
设计了一种基于RS485总线的IAP升级方法,基于IP地址和RS485总线地址,采用轮询+应答方式实现上位机和传感器之间点对点数据通信。上位机在轮询数据包中加载程序升级命令和新程序数据,传感器在应答数据包中加载程序升级确认信息,实现新程序数据可靠传输。基于STM32L151微处理器,设计Bootloader程序,实现在线IAP程序升级功能。实验结果表明,新程序数据传输可靠且不影响传感器正常工作,程序升级时间≤12 s,在上位机重启、链路中断等异常情况下,传感器均能以原始程序继续运行,该方法具有工作量小、可靠性高和适用性强等优点。
An IAP upgrade method is designed based on RS485 bus. This method adopts polling-response mode to realize point-to-point data communication between the host computer and sensors based on IP address and RS485 bus address. The upper computer loads the program upgrade command and new program data in the polling packet, and the sensor loads the program upgrade confirmation information in the response packet. Based on STM32L151 microprocessor, the Boot-loader is designed to realize the online IAP program upgrade function. The test results show that the data transmission of the new program is reliable and does not affect the normal operation of the sensor. The upgrade time of the program is less than 12 seconds, and the sensor can continue to run with the original program under the abnormal conditions such as the restart of the host computer and the link interruption. The method has the advantages of small workload, high reliability and strong applicability.
作者
王飞
刘芬
WANG Fei;LIU Fen(State Key Laboratory of the Gas Disaster Detecting,Preventing and Emergency Controlling,Chongqing 400037,China;CCTEG Chongqing Research Institute,Chongqing 400039,China)
出处
《自动化与仪器仪表》
2023年第2期12-15,共4页
Automation & Instrumentation
基金
中煤科工集团重庆研究院有限公司自立创新引导项目(2022YBXM04)。