|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
S29GL064N90TFI04:R4模式。% l d+ ?& a) b! u" u, p$ i
在ARM下写入读取ID命令,代码如下:, x( T" T2 L! G' M
volatile unsigned short *baseAddress = (volatile unsigned short *) pFlash->pFlashInfo->baseAddress;
4 m* I" @( m( s* ?- o unsigned int id;5 c; S( K; \# C4 _, R) }
9 I7 n& c: Y2 M1 P5 X //* Enter Software Product Identification Mode( S# U5 {( P7 ?1 e4 W6 \# ~
*(baseAddress + FLASH_SEQ_ADD1) = FLASH_CODE1;7 {; C$ B! ^/ I0 A* ^
*(baseAddress + FLASH_SEQ_ADD2) = FLASH_CODE2;- F: Z, L1 `3 G" o5 O
*(baseAddress + FLASH_SEQ_ADD1) = ID_IN_CODE;$ |8 q G1 @8 ~
) _5 Y' ~1 x4 \6 M p2 Y. ]$ v( k
//* Read Manufacturer and device code from the device z: b# `4 v @2 M
id = (short) *baseAddress;
0 S n/ i+ G8 Q id |= *(baseAddress+1) << 16;8 c; {# i$ @2 V
# c0 p# z/ F9 q3 [* D* D6 c //* Exit Software Product Identification Mode
c/ z1 w3 _# b ? *(baseAddress + FLASH_SEQ_ADD1) = ID_OUT_CODE;0 J3 P: n- D. v/ e I" a: X
return id;
$ c$ A1 q% |0 [+ ^) r
* j" @% u) d* \+ t6 y6 Z, JbaseAddress 为0x10000000,ARM片选NCS0.7 n; }! q, I$ N& g0 V. U! v
结果读出来的id是0x00900090,单步显示:每写入一条命令指令,通过AXD读出来的Flash的内容都随着指令码而改变,譬如写入FLASH_CODE1,Flash内容随之变成0x55,FLASH_CODE2变成0xAA,ID_IN_CODE变成0x0090,故最后读取的id为0x00900090.不知何解啊?有没有高手解答解答的?非常感谢了。6 Z# g9 h6 B5 `
) l% Z D- e+ }另:FLASH_SEQ_ADD1为0x555,FLASH_SEQ_ADD2为0x2AA。 |
|