|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
S29GL064N90TFI04:R4模式。
& O" A; Z6 b& p/ @% o在ARM下写入读取ID命令,代码如下:9 I) R' |9 x# S, t4 V+ _3 w
volatile unsigned short *baseAddress = (volatile unsigned short *) pFlash->pFlashInfo->baseAddress;, m9 }; w* |' }9 O# I/ X
unsigned int id;! Q( o8 o- o* o# M; n) c( y- g
1 z( |/ q; S5 w! T) j3 f
//* Enter Software Product Identification Mode
2 h4 R7 {4 j. V3 C9 S *(baseAddress + FLASH_SEQ_ADD1) = FLASH_CODE1;
' P2 E* W; W2 e& Q# [4 J4 }. c! ~5 k *(baseAddress + FLASH_SEQ_ADD2) = FLASH_CODE2;6 d0 Z, X1 ~/ o+ T/ m# f M' S( ^
*(baseAddress + FLASH_SEQ_ADD1) = ID_IN_CODE;
) S7 Y! I4 m" X) ^5 N" ~
( r' ]! s" l; R' s3 V+ r //* Read Manufacturer and device code from the device
3 P9 y) |9 \$ a: _' x% _2 p; S q id = (short) *baseAddress;* Y9 E; ?4 M6 \/ M$ u4 d2 b. M
id |= *(baseAddress+1) << 16;
2 Z- l& L& j' d5 n0 _3 _4 F6 m5 N& ?1 A+ ?
//* Exit Software Product Identification Mode
9 u0 z8 a: o0 ?8 ` *(baseAddress + FLASH_SEQ_ADD1) = ID_OUT_CODE;
) N" f& U* b6 v5 M return id;, a: p, P3 E) ?+ N* s+ B
; y }' }' B1 v. ^, v1 Q& L. g8 h! {baseAddress 为0x10000000,ARM片选NCS0." x* q- T; F- I) n6 Y
结果读出来的id是0x00900090,单步显示:每写入一条命令指令,通过AXD读出来的Flash的内容都随着指令码而改变,譬如写入FLASH_CODE1,Flash内容随之变成0x55,FLASH_CODE2变成0xAA,ID_IN_CODE变成0x0090,故最后读取的id为0x00900090.不知何解啊?有没有高手解答解答的?非常感谢了。8 C8 e1 e/ d6 U' K% f$ Q
, h7 m4 P7 G, h: d另:FLASH_SEQ_ADD1为0x555,FLASH_SEQ_ADD2为0x2AA。 |
|