We have problems when comparing CRC result against calculated by IAR. The CRC generated by IAR is stored in -Z(CODE)CHECKSUM#00DF. -- FAULTY CASE: The FLAS addressing is not done correctly by the compiler uint16_t __far *pMyChecksum; pMyChecksum = __segment_begin("CHECKSUM"); if (g_crcASM != *pMyChecksum) { g_resultBool = 1U; } Assembrer code: MOV ES, #0X0F MOVW HL, ES:0X00DE -- CORRECT CASE: The FLAS addressing done correctly by the compiler if (g_crcASM != *(__far uint16_t *)(0x00DEU)) { /* Fail CRC value does not match reference value calculated by IAR */ test_result = 1U; } Assembrer code: MOV ES, #0X00 MOVW HL, ES:0X00DE
↧