CN-121979815-A - IIC communication-based head-up display storage management and firmware upgrading control method
Abstract
The invention discloses a head-up display storage management and firmware upgrade control method based on IIC communication, which realizes partition management by dividing a storage medium into a Bootloader area, an Application Data area, a User Data area and a Backup Data area, and the IIC communication protocol is adopted to realize the linkage of storage and upgrading, a verification mechanism is arranged for Data transmission, and when an IGN power-off signal is detected, user parameters are written into the EEPROM and a power-on mark is arranged in parallel and is FALSE. The method solves the problems of poor cooperation of storage and upgrading in the prior art, realizes storage refinement, upgrading standardization and data security, and is convenient to operate and controllable in cost.
Inventors
- HU YANSONG
- YANG XINYI
- WANG JINZHU
- JIANG HAO
Assignees
- 沂普光电(福建)有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260331
Claims (10)
- 1. The method for controlling the storage management and firmware upgrading of the head-up display based on IIC communication comprises the basic processes of communication establishment between the head-up display and a host, data reading and writing of a storage medium and firmware upgrading, and is characterized by further comprising the following steps: s1, dividing a storage medium into a Bootloader area, an Application Data area, a User Data area and a Backup Data area, and realizing storage resource partition management; S2, adopting an IIC communication protocol to realize integrated linkage of storage parameter reading and writing and firmware upgrading; s3, verifying the data integrity by adopting a verification mechanism in the data transmission process; And S4, when the IGN power-off signal is detected, writing the current user parameters into the EEPROM and setting the power-on mark as FALSE.
- 2. The method for controlling storage management and firmware upgrading of a head-up display based on IIC communication according to claim 1, wherein IIC communication parameters are configured such that the baud rate is 100Kbits/s, the head-up display is used as a slave, the address is set to 0x36, and the host is a vehicle-mounted ECU or upgrading equipment.
- 3. The method of claim 1, wherein the partition address range of the storage medium is set to be Bootloader 0x000000 to 0x00FFFF,Application Data 0x010000 to 0x07FFFF,User Data 0x080000 to 0x08FFFF,Backup Data 0x090000 to 0x09FFFF, and the partition address ranges are continuous and non-overlapping.
- 4. The method for controlling storage management and firmware upgrade of a head up display based on IIC communication according to claim 1, wherein the verification mechanism is accumulation and verification, the accumulation and verification is the lowest byte of transmission data after byte accumulation operation, the transmission data includes an instruction ID and corresponding data D1 to Dn, and the length of the data D1 to Dn is 1 byte to 255 bytes.
- 5. The method for controlling storage management and firmware upgrading of a head-up display based on IIC communication according to claim 1, wherein the firmware upgrading is performed by an IIC protocol instruction, wherein the host sends a 0xC7 instruction to inform of upgrading data types, total package numbers and total length, the host transmits firmware data in packages through a 0xC8 instruction, each package transmits 8 bytes of data, after all packages are transmitted, the host sends a 0xC9 instruction, the head-up display checks a file total checksum, and after the check passes, the host restarts and loads new firmware.
- 6. The method for controlling the storage management and firmware upgrading of the head-up display based on IIC communication according to claim 1, wherein when the volume of the firmware exceeds 1MB, a checking mechanism is replaced by CRC32 check, the CRC32 check is operated on data through a preset polynomial to generate a 32-bit check value for verifying the integrity of data transmission or storage, the polynomial of the CRC32 check is 0xEDB88320, the check range covers all the packet data and instruction IDs of the firmware, the head-up display compares the CRC32 result calculated by the head-up display with the CRC32 result sent by a host, if the comparison is consistent, the data transmission is confirmed to be correct, and if the comparison is inconsistent, an error signal is fed back.
- 7. The method for controlling storage management and firmware upgrade of a head up display based on IIC communication according to claim 1, wherein the EEPROM is newly added with a fault log area, the address range of the fault log area is 0x0a0000 to 0x0AFFFF, and the fault log area is used for recording upgrade failure information and parameter error information, each log record length is 32 bytes, and the record length comprises a time stamp field and a data field, and when the storage capacity reaches the upper limit, the earliest recorded log information is covered.
- 8. The method for controlling storage management and firmware upgrading of a head-up display based on IIC communication according to claim 5, wherein the upgrading function comprises breakpoint continuous transmission, wherein the head-up display records the transmitted packet number through a 0xCF command, the packet number is increased from 0, after the upgrading is interrupted, the host sends the 0xCF command to inquire the transmitted packet number, the head-up display returns the transmitted packet number and a verification result, and the host continues transmitting data from the next packet of the transmitted packet number.
- 9. The method for controlling storage management and firmware upgrading of a head-up display based on IIC communication according to claim 2, wherein the IIC communication protocol supports a high-speed mode, the baud rate of the high-speed mode is 400Kbits/s, the starting process is that a host sends a 0xCC instruction to the head-up display, the head-up display is switched to a high-speed communication state and returns an ACK response, the high-speed mode only adjusts the baud rate parameter, and the data transmission time sequence is consistent with the 100Kbits/s mode.
- 10. The method for controlling storage management and firmware upgrading of the head-up display based on IIC communication according to claim 1 is characterized in that storage management tasks are achieved based on RTOS, wherein the RTOS is an operating system capable of guaranteeing that a key task responds quickly and is executed preferentially according to preset time requirements, a memory_ TaskInit () function is called to create a storage task after equipment is powered on, the priority of the storage task is higher than that of an application task, a memory_ PowerOnHandle () function is called to initialize EEPROM and read a Backup Data area parameter, a user parameter is recovered from the Backup Data area when power failure abnormality is detected and set as TRUE, 10ms periodic scheduling is achieved through the memory_10ms_cycle () function, IIC read-write instructions are processed, EEPROM parameters are updated, feedback verification results are fed back, and synchronous Backup is carried out to the Backup Data area when the user parameter is modified.
Description
IIC communication-based head-up display storage management and firmware upgrading control method Technical Field The invention relates to the technical field of vehicle-mounted electronic equipment, in particular to a head-up display storage management and firmware upgrading control method based on IIC communication. Background The current storage management and firmware upgrading of the vehicle-mounted head-up display are designed separately, the storage module only bears the parameter storage function, and the firmware upgrading is required to depend on an independent communication interface and a special program. In the prior art, a linkage mechanism is lacking between reading and writing of storage parameters and firmware upgrading, effective backup of parameters is not performed in the upgrading process, and once upgrading is interrupted or equipment is accidentally powered off, user parameters are extremely easy to lose, so that the head-up display is started abnormally. Meanwhile, the storage medium is not reasonably partitioned, bootloader, application programs and user parameters are mixed, the risk of parameter loss is further increased, and the user experience is seriously affected. Based on the above problems, a technical scheme for realizing the coordination of storage and upgrading and guaranteeing the data security is needed. Disclosure of Invention The invention aims to solve the defects existing in the prior art, and provides a head-up display storage management and firmware upgrading control method based on IIC communication, which comprises the basic processes of communication establishment between a head-up display and a host, data reading and writing of a storage medium and firmware upgrading, and further comprises the steps of dividing the storage medium into a Bootloader area, an Application Data area, a User Data area and a Backup Data area, and realizing storage resource partition management; the integrated linkage of storage parameter reading and writing and firmware upgrading is realized by adopting an IIC communication protocol, the Data integrity is verified by adopting a verification mechanism in the Data transmission process, and when an IGN power-off signal is detected, the current User parameter is written into an EEPROM and a power-on mark is set as FALSE. Preferably, the IIC communication parameters are configured such that the baud rate is 100Kbits/s, the head-up display is used as a slave, the address is set to 0x36, and the host is a vehicle-mounted ECU or upgrading equipment. Further preferably, the partition address range of the storage medium is set such that Bootloader ranges from 0x000000 to 0x00FFFF,Application Data ranges from 0x010000 to 0x07FFFF,User Data ranges from 0x080000 to 0x08FFFF,Backup Data ranges from 0x090000 to 0x09FFFF, and the respective partition address ranges are continuous and non-overlapping. Further preferably, the checking mechanism is accumulation and checking, the accumulation and accumulation is the lowest byte of the transmission data after the byte accumulation operation, the transmission data comprises an instruction ID and corresponding data D1 to Dn, and the length of the data D1 to Dn is 1 byte to 255 bytes. Further preferably, the firmware upgrade is performed by the IIC protocol instruction that the host sends a 0xC7 instruction informing of the upgrade data type, total package number and total length, the host transmits firmware data in packets by the 0xC8 instruction, each packet transmits 8 bytes of data, after all the packets are transmitted, the host sends a 0xC9 instruction, the head up display checks the total checksum of the file, and after the check is passed, the host restarts and loads new firmware. Further preferably, when the firmware volume exceeds 1MB, the checking mechanism is replaced by a CRC32 check, the CRC32 check is operated on the data through a preset polynomial to generate a 32-bit check value for verifying the integrity of data transmission or storage, the polynomial of the CRC32 check is 0xEDB88320, the check range covers all the packet data and instruction IDs of the firmware, the head-up display compares the CRC32 result calculated by the head-up display with the CRC32 result sent by the host, the comparison is consistent, the data transmission is confirmed to be correct, and the comparison is inconsistent, and an error signal is fed back. Further preferably, the EEPROM is further provided with a fault log area, the address range of the fault log area is 0x0a0000 to 0x0AFFFF, and the fault log area is used for recording upgrade failure information and parameter error information, each log record length is 32 bytes, and includes a timestamp field and a data field, and when the storage capacity reaches the upper limit, the earliest recorded log information is covered. Further preferably, the upgrading function comprises breakpoint continuous transmission, wherein the head-up display records the transmit