Hi,
I am trying to use the Keil specified steps in http://www.keil.com/support/docs/494.htm to generate checksum after I compile the code. I get following messages from Keil and wonder what I am doing wrong?
Program Size: data=50.5 xdata=0 code=2675 creating hex file from "..\output\bit_adc"... User command #1: "C:\Documents and Settings\fsiavoshi\My Documents\AC_Smart\Software\PhaseProc\BIT_ADC\source\genchksum.bat" C:\Documents and Settings\fsiavoshi\My Documents\AC_Smart\Software\PhaseProc\BIT_ADC\project>hex2bin bit_adc.hex /Q The system cannot execute the specified program. C:\Documents and Settings\fsiavoshi\My Documents\AC_Smart\Software\PhaseProc\BIT_ADC\project>check8 bit_adc.bin /s0x0000 /e0x7FFE /p0x7FFF /v0x80 The system cannot execute the specified program. C:\Documents and Settings\fsiavoshi\My Documents\AC_Smart\Software\PhaseProc\BIT_ADC\project>bin2hex bit_adc.bin a.hex /Q The system cannot execute the specified program. "..\output\bit_adc" - 0 Error(s), 1 Warning(s).\
Please let me know.
Thanks
I added a print statement in the main code to display the calculated checksum as follows:
checksum calculated: 1800
The value expected is 0x80 and that is why I get the failed result. I am not sure how to get the last address where actual code resides in the flash memory. I looked at the .m51 map file and see following but still not sure how to set the start address and end address for checksum calculation?
* * * * * * * C O D E M E M O R Y * * * * * * * CODE 0000H 0003H ABSOLUTE CODE 0003H 0027H UNIT ?PR?PUTCHAR?PUTCHAR 002AH 0001H *** GAP *** CODE 002BH 0003H ABSOLUTE CODE 002EH 035CH UNIT ?PR?PRINTF?PRINTF CODE 038AH 01E3H UNIT ?C?LIB_CODE CODE 056DH 0102H UNIT ?PR?STARTUPCALFNC?MAIN_ADC_EX CODE 066FH 00E8H UNIT ?PR?MAIN?MAIN_ADC_EX CODE 0757H 008CH UNIT ?C_C51STARTUP CODE 07E3H 0067H UNIT ?PR?_STARTUPSTARTCALFNC?MAIN_ADC_EX CODE 084AH 0055H UNIT ?CO?MAIN_ADC_EX CODE 089FH 0044H UNIT ?C?LDIV BL51 BANKED LINKER/LOCATER V6.22 02/23/2011 17:04:54 PAGE 2
CODE 08E3H 002EH UNIT ?PR?ADC0_INIT?INIT CODE 0911H 002DH UNIT ?PR?SPI_ARRAY_WRITE?MAIN_ADC_EX CODE 093EH 001EH UNIT ?PR?_FLASH_BYTEWRITE?MAIN_ADC_EX CODE 095CH 001EH UNIT ?PR?INIT_DEVICE?INIT CODE 097AH 001DH UNIT ?PR?_FLASH_PAGEERASE?MAIN_ADC_EX CODE 0997H 001DH UNIT ?PR?TIMER_INIT?INIT CODE 09B4H 001AH UNIT ?PR?PORT_INIT?INIT CODE 09CEH 0016H UNIT ?PR?MAIN_ADC_EX CODE 09E4H 0013H UNIT ?PR?UART0_INIT?INIT CODE 09F7H 0013H UNIT ?PR?SPI0_INIT?INIT CODE 0A0AH 0012H UNIT ?PR?_FLASH_BYTEREAD?MAIN_ADC_EX CODE 0A1CH 0012H UNIT ?C_INITSEG CODE 0A2EH 0010H UNIT ?PR?INTERRUPT_TIMER2_ISR?MAIN_ADC_EX CODE 0A3EH 000EH UNIT ?PR?SYSCLK_INIT?INIT CODE 0A4CH 000EH UNIT ?PR?VDDMON_INIT?INIT CODE 0A5AH 000BH UNIT ?PR?VOLTAGE_REFERENCE_INIT?INIT CODE 0A65H 000BH UNIT ?PR?PCA0_INIT?INIT CODE 0A70H 0004H UNIT ?PR?INTERRUPTS_INIT?INIT