When the clicker item is produced, the production information (production time, software version, etc.) needs to be included when the program is burned. If the clicker goes wrong afterwards, he can know which batch of clickers are produced to facilitate the positioning problem.
Technical feasibilityClicker nrf51822flash chip used a total of 256KByte, flash can not be used up, we can take a useless flash, burn production information is also written into it.
The Hex file is a file format that can be burned into the MCU and executed by the MCU. If you use Notepad to open it, you can find that the entire file is in line units, each line starts with a colon, and the contents are all hexadecimal codes (displayed in ASCII format). The Hex file can be split as follows to analyze the content:
For example "B1E0828092820280B1D0C280D2854" can be seen as "0x10 0x00 0x08 0x00 0x80 0x31 0x8B 0x1E 0x08 0x28 0x09 0x28 0x20 0x28 0x0B 0x1D 0x0C 0x28 0x0D 0x28 0x54"
The first byte 0x10 represents the length of the data in this line;
The second and third bytes 0x00 0x08 represent the starting address of the data in this line;
The fourth byte 0x00 indicates the data type. The data types are: 0x00, 0x01, 0x02, 0x03, 0x04, 0x05.
'00' Data Rrecord: used to record data, most of the HEX file records are data records
'01' End of File Record: used to mark the end of the file, put it at the end of the file, identify the end of the HEX file
'02' Extended Segment Address Record: Record used to identify extended segment address
'03' Start Segment Address Record: Start Segment Address Record
'04' Extended Linear Address Record: Records used to identify extended linear addresses
'05' Start Linear Address Record: Start Linear Address Record
Then the data, the last byte 0x54 is the checksum.
The checksum algorithm is: Calculate the sum of all hexadecimal codes before 0x54 (without carry), checksum = 0x100 - Accumulate sum
The last 2 records above are used to provide address information. Each time you hit these two records, you can calculate a "base" address based on the record. For subsequent data records, the addresses are calculated based on these "base" addresses.
HEX files are composed of records (RECORD). In the HEX file, each line represents a record. The basic format of the record is:
Record mark ':'
Length
Load offset
Record type
INFO or DATA
CHKSUM
1 byte
1 byte
2 bytes
1 byte
n bytes
1 byte
See an example:
F2
FF00A0E314209FE5001092E5011092E5A3
FF
Analysis of the above HEX file:
The first record has a length of 02, a LOAD OFFSET of 0000, and a RECTYPE of 04, indicating that the record is an extended segment address record. The data is 0008 and the checksum is F2. From the length and data of this record, we can calculate a base address, which is (0x0008, "16"). The following data records are based on this address.
The second record has a length of 10 (16), LOAD OFFSET is 0004, and RECTYPE is 00, indicating that the record is a data record. The data is FF00A0E314209FE5001092E5011092E5, a total of 16 BYTE. The checksum for this record is A3. The base address at this time is 0X80000. With OFFSET, the start address of the 16BYTE data in this record is 0x80000 + 0x0004 = 0x80004.
The length of the third record is 00, LOAD OFFSET is 0000, TYPE = 01, checksum is FF. Description This is an END OF FILE RECORD that identifies the end of the file.
In the above example, the actual data is only 16 BYTEs: FF00A0E314209FE5001092E5011092E5, whose starting address is 0x0004.
Vehicle Router,Vehicle 4G Router,Vehicle 4G Wireless Router,Vehicle Wifi Router
Shenzhen MovingComm Technology Co., Ltd. , https://www.movingcommiot.com