我使用s3c4510的开发板,板上只有一块SST39SF040(512K×8bits)的FLASH芯片,我想通过C代码访问FLASH ID。但不知为何当我写入三个指令时程序跑飞了,我的代码如下:
#define flash_base 0x0
void read_id()
{
unsigned long ulManuID;
unsigned long ulDeviceID;
*((volatile unsigned short *)(0x5555 + flash_base )) = 0x0aa;
*((volatile unsigned short *)(0x2aaa + flash_base )) = 0x055;
*((volatile unsigned short *)(0x5555 + flash_base )) = 0x90;
SSTSF040_Delay();
/*ulManuID is a value of the manufactory, ulDeviceID is a ID of the device */
ulManuID = *(volatile unsigned short *)(0 + flash_base );
ulDeviceID = *(volatile unsigned short *)(1 + flash_base );
*(volatile unsigned short *)(0x5555 + flash_base ) = 0x0AA;
*(volatile unsigned short *)(0x2aaa + flash_base ) = 0x055;
*(volatile unsigned short *)(0x5555 + flash_base ) = 0x0F0;
SSTSF040_Delay();
}
我用ICE单步执行以上指令,当程序执行到指令(*((volatile unsigned short *)(0x5555 + flash_base )) = 0x0aa;)时程序跑飞,并且MCPU进入Abt状态。请各位有认之士告之当中原因,如何解决,小弟在这里谢谢啦。