|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
S29GL064N90TFI04:R4模式。! l7 d: H0 S% W8 G: _
在ARM下写入读取ID命令,代码如下:4 {" R: ~: o. C1 a" I
volatile unsigned short *baseAddress = (volatile unsigned short *) pFlash->pFlashInfo->baseAddress;
* B( z2 }+ }, T( ?, v unsigned int id;5 S# ]4 E: r, f2 X- \
, H& |* _) V' S# P //* Enter Software Product Identification Mode3 i+ I* }, m2 T! a& T! k# S/ P
*(baseAddress + FLASH_SEQ_ADD1) = FLASH_CODE1;
+ Y! Z# o( B6 \, a, | *(baseAddress + FLASH_SEQ_ADD2) = FLASH_CODE2; l. S4 |& y2 \! R4 `' f, y! {
*(baseAddress + FLASH_SEQ_ADD1) = ID_IN_CODE;0 Q; q2 A0 z! i0 c+ L9 ^7 }
9 ?% }# G1 h: H
//* Read Manufacturer and device code from the device3 V, z ?! y1 |# M" B
id = (short) *baseAddress;
7 l/ B7 v9 H/ o" }; a9 G1 a id |= *(baseAddress+1) << 16;+ o* B+ J0 x8 s/ h( a. K! ?
4 ~- i+ z3 K4 U //* Exit Software Product Identification Mode
' B9 F) r9 o" d$ d *(baseAddress + FLASH_SEQ_ADD1) = ID_OUT_CODE;' U3 _% V; C% @/ Q% v& Z
return id;
3 |4 M7 X' \0 A' h3 u- I. ]9 x+ r) C" N+ }2 [. p, B N
baseAddress 为0x10000000,ARM片选NCS0.4 {) Z; a% g- a
结果读出来的id是0x00900090,单步显示:每写入一条命令指令,通过AXD读出来的Flash的内容都随着指令码而改变,譬如写入FLASH_CODE1,Flash内容随之变成0x55,FLASH_CODE2变成0xAA,ID_IN_CODE变成0x0090,故最后读取的id为0x00900090.不知何解啊?有没有高手解答解答的?非常感谢了。
. F9 p7 ~9 k6 F; v# K( w& X& p; V* ^3 r
另:FLASH_SEQ_ADD1为0x555,FLASH_SEQ_ADD2为0x2AA。 |
|