TI中文支持网
TI专业的中文技术问题搜集分享网站

C6455自启动

通过CCS连接6455后,全速运行时,程序在0x001014AA和0x001014B0这几行之间反复运行,不会跳转到0x00800000,请问是什么原因?

使用CCS4.2debug时将.out文件加载到芯片内,可以正常调试。

0x001014AA附近的内部rom代码如下:

noaming:

0x001014AA和0x001014B0是位于芯片Internal ROM中,该区域固化有bootloader,芯片上电复位后立即运行,然后根据boot modes来选择boot的方式。根据你的描述,说明你的boot程序有问题。

doom legend:

回复 noaming:

;;this is the boot.asm

 .ref    _c_int00

.ref    FLASH_TEXT_START

.ref    RAM_TEXT_START

.ref TEXT_SIZE

.ref FLASH_CINIT_START

.ref RAM_CINIT_START

.ref CINIT_SIZE

.ref FLASH_CONST_START

.ref RAM_CONST_START

.ref CONST_SIZE

.ref FLASH_SWITCH_START

.ref RAM_SWITCH_START

.ref SWITCH_SIZE

 

 

.sect "bootload"

;; Copy the .text section from FLASH_TEXT_START to RAM_TEXT_START

_boot_start:

    mvkl  FLASH_TEXT_START,B4 ; B4 <- FLASH_TEXT_START

    mvkh  FLASH_TEXT_START,B4   

     

mvkl  RAM_TEXT_START,A4; A4 <- RAM_TEXT_START

mvkh  RAM_TEXT_START,A4

zero  A1

 

_boot_loop1:

ldb   *B4++,B5       ; Read Flash

mvkl  TEXT_SIZE,B6 ; B6 <- TEXT_SIZE

add   1,A1,A1          

||    mvkh  TEXT_SIZE,B6

cmplt  A1,B6,B0; Compare Size

nop    

stb   B5,*A4++; Store RAM

[B0]  b     _boot_loop1

nop   5

 

;; Copy the .cinit section from FLASH_CINIT_START to RAM_CINIT_START

    mvkl  FLASH_CINIT_START,B4 ; B4 <- FLASH_CINIT_START

    mvkh  FLASH_CINIT_START,B4   

     

mvkl  RAM_CINIT_START,A4   ; A4 <- RAM_TEXT_START

mvkh  RAM_CINIT_START,A4

zero  A1

_boot_loop2:

ldb   *B4++,B5       ; Read Flash

mvkl  CINIT_SIZE,B6  ; B6 <- CINIT_SIZE

add   1,A1,A1          

||    mvkh  CINIT_SIZE,B6

cmplt  A1,B6,B0; Compare Size

nop    

stb   B5,*A4++; Store RAM

[B0]  b     _boot_loop2

nop   5

 

;; Copy the .const section from FLASH_CONST_START to RAM_CONST_START

    mvkl  FLASH_CONST_START,B4 ; B4 <- FLASH_CINIT_START

    mvkh  FLASH_CONST_START,B4   

     

mvkl  RAM_CONST_START,A4   ; A4 <- RAM_TEXT_START

mvkh  RAM_CONST_START,A4

zero  A1

_boot_loop3:

ldb   *B4++,B5       ; Read Flash

mvkl  CONST_SIZE,B6 ; B6 <- CONST_SIZE

add   1,A1,A1          

||    mvkh  CONST_SIZE,B6

cmplt  A1,B6,B0; Compare Size

nop    

stb   B5,*A4++; Store RAM

[B0]  b     _boot_loop3

nop   5

 

;; Copy the .switch section from FLASH_SWITCH_START to RAM_SWITCH_START

    mvkl  FLASH_SWITCH_START,B4 ; B4 <- FLASH_CINIT_START

    mvkh  FLASH_SWITCH_START,B4   

     

mvkl  RAM_SWITCH_START,A4   ; A4 <- RAM_TEXT_START

mvkh  RAM_SWITCH_START,A4

zero  A1

_boot_loop4:

ldb   *B4++,B5       ; Read Flash

mvkl  SWITCH_SIZE,B6 ; B6 <- SWITCH_SIZE

add   1,A1,A1          

||    mvkh  SWITCH_SIZE,B6

cmplt  A1,B6,B0; Compare Size

nop    

stb   B5,*A4++; Store RAM

[B0]  b     _boot_loop4

nop   5

 

 

;; Branch to application start

mvkl .S2 _c_int00, B0

mvkh .S2 _c_int00, B0

B    .S2 B0

nop   5

;;end of the boot.asm

 

对应的flash.cmd如下

-c

-heap  0x500

-stack 0x500

 

 

MEMORY

{

        L2:      o = 0x00800000   l = 0x00200000

boot:    o = 0xB0000000   l = 0x00000200

FLASH: o = 0xB0000200  l = 0x003FFD00

 

SECTIONS

{

 

  "bootload": {} > boot 

    .text     : {} > FLASH   run = L2, LOAD_START(FLASH_TEXT_START), RUN_START(RAM_TEXT_START), SIZE(TEXT_SIZE) 

    .cinit    : {} > FLASH   run = L2, LOAD_START(FLASH_CINIT_START), RUN_START(RAM_CINIT_START), SIZE(CINIT_SIZE) 

    .stack    : {} > L2

    .bss      : {} > L2

    .cio      : {} > L2

    .const  : {} > FLASH run = L2, LOAD_START(FLASH_CONST_START), RUN_START(RAM_CONST_START), SIZE(CONST_SIZE) 

    .data     : {} > L2

    .switch   : {} > FLASH   run = L2, LOAD_START(FLASH_SWITCH_START), RUN_START(RAM_SWITCH_START), SIZE(SWITCH_SIZE) 

    .sysmem   : {} > L2

    .far      : {} > L2

赞(0)
未经允许不得转载:TI中文支持网 » C6455自启动
分享到: 更多 (0)