我的项目中,FLASHA已经被bootloader占用,用户程序只能放到FLASHA以外的FLASH,实际中发现.cinit段放到FLASHC以后的段,代码运行异常,放到FLASHB可以运行,请TI的工程师帮忙验证一下问题,谢谢。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
是在PAGE0的,事实上,我所有FLASH都放到PAGE0了。
跟踪代码发现 在RTS库的boot28.inc文件中初始化cinit部分的代码跑飞了。因为.cinit段放到FLASHB功能正常,没有深究这段代码。
MOVL XAR7,#cinit ; point XAR7 at start of table
CLRC TC ; reset TC bit used as far flag
B START, UNC ; jump to start processing
LOOP:
MOVB AH,#0 ; zero out upper addr bits
PREAD AL,*XAR7 ; load address of variable to be inited
ADDB XAR7,#1 ; point to initialization data
B GET_DATA,NTC ; get data if variable is not far
CLRC TC ; reset TC bit used as far flag
PREAD AH,*XAR7 ; otherwise, get hi bits of 22-bit addr
ADDB XAR7,#1
GET_DATA:
MOVL XAR6,ACC ; address
RPT AR1 ; repeat length + 1 times
|| PREAD *XAR6++,*XAR7 ; copy data from table to memory
MOVL ACC,XAR7 ; using ACC as temp, point XAR7 to
ADD ACC,AR1 ; next cinit record since PREAD
ADDB ACC,#1 ; doesn't change value of XAR7.
MOVL XAR7,ACC
START:
PREAD AL,*XAR7 ; load length
B GET_ADDR,GEQ ; a length < 0 denotes far data
NEG AL ; negate value to get real length
SETC TC ; flag that the address field is 32-bits
GET_ADDR:
MOVZ AR1,AL ; copy length value to loop register
ADDB XAR7,#1 ; point to address field
BANZ LOOP,AR1-- ; if (length-- != 0) continue