利用2812烧写了一个程序,其中CMD文件主要内容如下: MEMORY { PAGE 0 : OTP : origin = 0x3D7800, length = 0x000800 FLASHJ : origin = 0x3D8000, length = 0x002000 .... FLASHA : origin = 0x3F6000, length = 0x001FF6 BEGIN : origin = 0x3F7FF6, length = 0x000002 PASSWDS : origin = 0x3F7FF8, length = 0x000008 ROM : origin = 0x3FF000, length = 0x000FC0 VECTORS : origin = 0x3FFFC2, length = 0x00003E PAGE 1 : /*SARAM*/ .... } SECTIONS { /* Allocate program areas: */ .reset : > BEGIN PAGE = 0 vectors : > VECTORS PAGE = 0 .cinit : > FLASHJ PAGE = 0 .text : > FLASHA PAGE = 0
/* Allocate data areas: */ .stack : > RAMM0M1 PAGE = 1 .bss : > RAML0L1 PAGE = 1 .ebss : > RAML0L1 PAGE = 1 .const: load = FLASHB PAGE 0, run = RAML0L1 PAGE 1 { /* Get Run Address */ __const_run = .; /* Mark Load Address*/ *(.c_mark) /* Allocate .const */ *(.const) /* Compute Length */ __const_length = .-__const_run; } .... } 这样一来,程序应该就是在FLASH中运行吧? 反正烧写完后重新运行的话,其中的外部AD采集就出乱码了,而在仿真情况下是没问题的。所以应该要把程序拷贝到RAM运行吧? 请问如何来实现呢?是否也可像.const那样Load Run就能实现? |