www.久久久久|狼友网站av天堂|精品国产无码a片|一级av色欲av|91在线播放视频|亚洲无码主播在线|国产精品草久在线|明星AV网站在线|污污内射久久一区|婷婷综合视频网站

當(dāng)前位置:首頁 > 公眾號精選 > strongerHuang
[導(dǎo)讀]關(guān)注星標(biāo)公眾號,不錯過精彩內(nèi)容編排?|strongerHuang微信公眾號|?嵌入式專欄手機(jī)升級系統(tǒng),下載完系統(tǒng)都會存在一個校驗(yàn)過程:其實(shí),在MCU升級過程中,也是需要校驗(yàn)hex文件,如果要想升級更可靠,還可以在hex或bin升級文件后再增加校驗(yàn)信息。我們之前公司做的一個遠(yuǎn)程升級...

關(guān)注 星標(biāo)公眾,不錯過精彩內(nèi)容

編排?| strongerHuang

微信公眾號 |?嵌入式專欄


手機(jī)升級系統(tǒng),下載完系統(tǒng)都會存在一個校驗(yàn)過程:


其實(shí),在MCU升級過程中,也是需要校驗(yàn)hex文件,如果要想升級更可靠,還可以在hex或bin升級文件后再增加校驗(yàn)信息。
我們之前公司做的一個遠(yuǎn)程升級的產(chǎn)品,就是在升級文件之后增加了CRC16校驗(yàn)信息,在接收完整個升級文件之后,進(jìn)行校驗(yàn),這樣做的目的就是使升級更可靠。

今天來講講hex文件的校驗(yàn)和驗(yàn)證校驗(yàn)的內(nèi)容。
關(guān)于Hex

hex 格式文件由 Intel 制定的一種十六進(jìn)制標(biāo)準(zhǔn)文件格式,是由編譯器轉(zhuǎn)換而成的一種用于下載到處理器里面的ASCII文本文件。
1.解釋維基百科解釋https://en.wikipedia.org/wiki/Intel_HEX

Intel HEX?is a file format that conveys binary information in ASCII text form. It is commonly used for programming microcontrollers, EPROMs, and other types of?programmable logic devices. In a typical application, a compiler or assembler converts a program's source code (such as in C or assembly language) to machine code and?outputs it into a HEX file. The HEX file is then imported by a programmer to "burn" the machine code into a ROM, or is transferred to the target system for loading and?execution.
Keil官網(wǎng)解釋https://www.keil.com/support/docs/1584/

The Intel HEX?file is an ASCII text file with lines of text that follow the Intel HEX file format. Each line in an Intel HEX file contains one HEX record. These records are made up of hexadecimal numbers that represent machine language code and/or constant data. Intel HEX files are often used to transfer the program and data that would be stored in a ROM or EPROM. Most EPROM programmers or emulators can use Intel HEX files.

2.格式hex行格式:

:BBAAAATT 【D···D】CC


其中:

:?代表行開始,固定為冒號:

BB代表Bytes,數(shù)據(jù)長度

AAAA代表Address,地址

TT代表Type,數(shù)據(jù)類型(標(biāo)識)

D···D代表Date,數(shù)據(jù)

CC代表CheckSum,校驗(yàn)和


說明:

BB數(shù)據(jù)長度,也就是D···D這個字段的數(shù)據(jù)長度;


AAAA地址,起始地址、偏移地址,根據(jù)數(shù)據(jù)類型(TT)有關(guān);


TT數(shù)據(jù)類型(標(biāo)識):

  • 00:數(shù)據(jù)標(biāo)識

  • 01:文件結(jié)束標(biāo)識

  • 02:擴(kuò)展段地址

  • 04:線性地址

  • 05:線性開始地址

(地址代表高16位地址,也就是要向左移16bit)


CC校驗(yàn)和計(jì)算公式:

CheckSum = 0x100 - (Sum
本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除。
關(guān)閉
關(guān)閉