您好,谢谢您的回复。我现在基本上按照官网的做的,但是有点疑问想请教。
我的程序用仿真器在线调试的时候是正常的。烧写程序完成后,按复位键后程序照常运行(没有关电源),但是关闭电源重启系统,程序就运行不正常了。我们自己的板子和开发板似乎都有这个毛病。但是用合纵达给的例程BOOT都是正常的,重启电源运行也正常(例程是最简单的点灯程序)。因为在开发板上面也是这个情况,初步排除硬件的问题,我怀疑是我的程序问题,但是在线调试又是正常的,所以很纠结。
我的CMD文件如下:
因为程序较大与官网相比就只是修改了一下FLASH_REST:、IRAM的长度值。我不知道是不是这个问题,IRAM不是有192KB吗,我感觉我设置IRAM到30000应该没有问题吧,还是其他造成的呢?
MEMORY
{
/*the FLASH_BOOT and FLASH_REST sections are not needed if the hex converter */
/*is used to create the copy table*/
FLASH_BOOT: o = 0x90000000 l = 0x00000400 /* Flash − for custom boot code */
FLASH_REST: o = 0x90000400 l = 0x0002FC00 /* Flash – for application code */
BOOT_RAM o = 0x00000000 l = 0x00000400 /* L2− for custom boot code*/
IRAM: o = 0x00000400 l = 0x0002fc00 /* L2− for non−custom boot code*/
SDRAM: o = 0x80000000 l = 0x10000000 /* EMIF − CE1 − SDRAM */
}
SECTIONS
{
/*When using the hex converter to generate the copy table, the load
address as well as the LOAD_START, RUN_START, AND SIZE linker options
do not need to be specified. Only the run address must be specified */
.boot_load : LOAD = FLASH_BOOT, RUN = BOOT_RAM
.text : LOAD = FLASH_REST, RUN = IRAM
LOAD_START(_text_ld_start),
RUN_START(_text_rn_start),
SIZE(_text_size)
/*LOAD_START, RUN_START, AND SIZE are only required when using the linker
options to generate the copy table */
.const > FLASH_REST
.cinit > IRAM
.pinit > IRAM
.switch > IRAM
.data > IRAM
.cio > IRAM
.bss > IRAM
.far > IRAM
}
SECTIONS
{
/*When using the hex converter to generate the copy table, the load
address as well as the LOAD_START, RUN_START, AND SIZE linker options
do not need to be specified. Only the run address must be specified */
.boot_load : LOAD = FLASH_BOOT, RUN = BOOT_RAM
.text : LOAD = FLASH_REST, RUN = IRAM
LOAD_START(_text_ld_start),
RUN_START(_text_rn_start),
SIZE(_text_size)
/*LOAD_START, RUN_START, AND SIZE are only required when using the linker
options to generate the copy table */
.cinit > FLASH_REST