EMERSON KJ4001X1-CK1質(zhì)量接線(xiàn)板
mageName無(wú)符號字符20用戶(hù)定義的ImageRamAddress無(wú)符號整數1 RAM地址ImageOffset無(wú)符號整數從標頭開(kāi)始到條目的偏移ImageFlags無(wú)符號整數參考第110頁(yè)的圖像標志ImageVersion無(wú)符號整數用戶(hù)定義的保留無(wú)符號整數8保留用于擴展校驗和算法校驗和算法是每個(gè)單詞的簡(jiǎn)單無(wú)符號單詞相加(4字節)位置。圖像長(cháng)度必須是4字節的倍數(字對齊)。標頭中校驗和位置的內容不是校驗和計算的一部分。計算假定位置為零。該算法使用以下代碼實(shí)現:無(wú)符號整數校驗和(無(wú)符號int*startPtr,/*起始地址*/無(wú)符號int endPtr/*結束地址圖像標志標頭的圖像標志定義了控制圖像執行方式的各種位選項。COPY_TO_RAM如果設置,則此標志表示在傳遞控制之前,圖像將復制到標頭中指定的地址處的RAM。如果未設置,則圖像將在閃存中執行實(shí)例中,控件將以標頭中指定的圖像偏移量從圖像底部傳遞。
mageName unsigned character 20 User defined
ImageRamAddress unsigned integer 1 RAM address
ImageOffset unsigned integer 1 Offset from header start to entry
ImageFlags unsigned integer 1 Refer to Image Flags on page 110
ImageVersion unsigned integer 1 User defined
Reserved unsigned integer 8 Reserved for expansion Checksum Algorithm
The checksum algorithm is a simple unsigned word add of each word (4 byte) location in
the image. The image must be a multiple of 4 bytes in length (word-aligned). The content
of the checksum location in the header is not part of the checksum calculation. The
calculation assumes the location to be zero. The algorithm is implemented using the
following code:
Unsigned int checksum(
Unsigned int *startPtr,/* starting address */
Unsigned int endPtr/* ending address Image Flags
The image flags of the header define various bit options that control how the image will be
executed.
COPY_TO_RAM
If set, this flag indicates that the image is to be copied to RAM at the address specified in
the header before control is passed. If not set, the image will be executed in flash. In both
instances, control will be passed at the image offset specified in the header from the base
of the image.