|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
S29GL064N90TFI04:R4模式。' H5 x' a6 r- X J+ G1 w- Q# S
在ARM下写入读取ID命令,代码如下:
0 S7 a/ o! N, W1 Yvolatile unsigned short *baseAddress = (volatile unsigned short *) pFlash->pFlashInfo->baseAddress;4 L( q, u5 S3 t3 F- C
unsigned int id;8 [' p8 y7 |$ |' v# `
9 N4 K) p3 [' J/ ?4 p2 B z, m
//* Enter Software Product Identification Mode
# o0 m# L( i( X0 m) j# |" W *(baseAddress + FLASH_SEQ_ADD1) = FLASH_CODE1;3 d9 L2 ?% J$ O2 m! b& S; U* o
*(baseAddress + FLASH_SEQ_ADD2) = FLASH_CODE2;' y6 S1 U3 L. v9 W
*(baseAddress + FLASH_SEQ_ADD1) = ID_IN_CODE;
. s3 c& }- X! S
4 @% E, |' Y7 y9 f) h% P //* Read Manufacturer and device code from the device
0 o0 u& H1 r( Y, t id = (short) *baseAddress;
* k, |: d3 n" R9 Q$ e id |= *(baseAddress+1) << 16;! d0 h& X" a; P. G
- E$ N; n3 Q$ [4 q q- D/ K //* Exit Software Product Identification Mode8 }4 Y; q- w. C
*(baseAddress + FLASH_SEQ_ADD1) = ID_OUT_CODE;1 @* g, t, L5 Q( H+ _" b3 F
return id;
# G0 k8 E* O+ u+ A4 |% ]5 x3 A# ~7 Y* _* E
baseAddress 为0x10000000,ARM片选NCS0.8 _/ G2 w I8 ?" y8 q, M# s1 w
结果读出来的id是0x00900090,单步显示:每写入一条命令指令,通过AXD读出来的Flash的内容都随着指令码而改变,譬如写入FLASH_CODE1,Flash内容随之变成0x55,FLASH_CODE2变成0xAA,ID_IN_CODE变成0x0090,故最后读取的id为0x00900090.不知何解啊?有没有高手解答解答的?非常感谢了。% G1 l0 Z; C0 n6 ]% w1 U
( B8 m/ }" ], Q6 o% U" A7 T
另:FLASH_SEQ_ADD1为0x555,FLASH_SEQ_ADD2为0x2AA。 |
|