|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
S29GL064N90TFI04:R4模式。+ s( G" h2 J/ n- o1 p& }
在ARM下写入读取ID命令,代码如下:
/ E% Z8 b, i8 m! \! cvolatile unsigned short *baseAddress = (volatile unsigned short *) pFlash->pFlashInfo->baseAddress;
' x. K+ V; M8 R1 r( u4 r unsigned int id;5 y5 z* N9 P: T
6 y7 F4 ?5 P; Y. Q. ~ //* Enter Software Product Identification Mode
2 {! ^# v/ X2 y! Q0 B# U *(baseAddress + FLASH_SEQ_ADD1) = FLASH_CODE1;
$ _ m8 u0 X6 e; N5 g *(baseAddress + FLASH_SEQ_ADD2) = FLASH_CODE2;' }* `+ B& l9 _$ B- E6 O
*(baseAddress + FLASH_SEQ_ADD1) = ID_IN_CODE;, z _- A* A k: k: T% X
/ j3 c. `5 G* Z7 O4 A3 i
//* Read Manufacturer and device code from the device
2 t/ p0 S. v: F- h$ H6 [ id = (short) *baseAddress;) }0 x( n- V! S1 O/ N
id |= *(baseAddress+1) << 16;/ I1 U& z& J) t+ P
6 r+ |, e7 d, u0 m9 E, [
//* Exit Software Product Identification Mode
$ o! m1 G5 q( q7 M l *(baseAddress + FLASH_SEQ_ADD1) = ID_OUT_CODE;, p. f( R+ y( W8 [) E
return id;4 A! A, K% s, W/ l
5 w1 m, ^4 M; i1 W
baseAddress 为0x10000000,ARM片选NCS0.
2 {- e4 i; f4 F% v+ [# M' V. Z结果读出来的id是0x00900090,单步显示:每写入一条命令指令,通过AXD读出来的Flash的内容都随着指令码而改变,譬如写入FLASH_CODE1,Flash内容随之变成0x55,FLASH_CODE2变成0xAA,ID_IN_CODE变成0x0090,故最后读取的id为0x00900090.不知何解啊?有没有高手解答解答的?非常感谢了。& J. |8 L3 m+ n/ Y! V* Z
' C: Z" V; t. `7 |
另:FLASH_SEQ_ADD1为0x555,FLASH_SEQ_ADD2为0x2AA。 |
|