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.

2812 cmd 疑问



/*源程序*/

.........

#pragma DATA_SECTION(SCIA_CCR,"sciaccrfile"); //    为SCIA的通信控制寄存器CCR新建一个段

unsigned int SCIA_CCR;

#pragma DATA_SECTION(a,"afile"); //    创建一个变量a

unsigned int a;

........

void main()

{

..........

  SCIA_CCR = 1;

a=1;

.........

}

/*cmd文件*/

MEMORY

{

......

  PAGE1: A:origin=0x3D8000,length = 0x000001

......

PAGE1:SCIACCR:origin=0x007050,length=0x000001

......

}

SECTIONS

{

......

afile:>A,PAGE = 1

sciaccrfile:>SCIACCR,PAGE=1

......

}

我的理解:经过该cmd文件链接,将程序烧入FLASH后,afile段被真正地烧在FLASH中,即FLASH中地址为0x3D8000的内容为1,且保持不变,而对于sciaccrfile段,只是使得SCIA_CCR代表地址0x007050,在程序上电瞬间,地址为0x007050的内容仍然是默认的复位值,只有等到程序执行到main函数中的  SCIA_CCR = 1语句后,地址为0x007050的内容才变成1,请问是这样的吗?