|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
S29GL064N90TFI04:R4模式。" \' P& m9 c% A( }1 }8 h
在ARM下写入读取ID命令,代码如下:
) `' ~# z0 Q# [3 E$ ]volatile unsigned short *baseAddress = (volatile unsigned short *) pFlash->pFlashInfo->baseAddress;
8 ?) t) s& O- M unsigned int id;' v$ s# u; |+ j, }
" ] @6 ?5 \ l! h, F; E( S //* Enter Software Product Identification Mode8 L1 d7 p1 ?, z& T. |7 b, l
*(baseAddress + FLASH_SEQ_ADD1) = FLASH_CODE1;6 X- {# W2 g: t; d' n+ `
*(baseAddress + FLASH_SEQ_ADD2) = FLASH_CODE2;
' N0 W4 ]6 d; ?9 _ *(baseAddress + FLASH_SEQ_ADD1) = ID_IN_CODE;6 M" f' F4 K. X' p! ?" f' Y1 \; F
+ \# v' V6 J, G' U& N
//* Read Manufacturer and device code from the device
" ]1 ~( g6 `4 i1 f' n5 F) g id = (short) *baseAddress;% j( f5 g4 p4 A+ q& r
id |= *(baseAddress+1) << 16;
4 Y9 D: V! r8 d) E6 J: A% M/ j' Q
//* Exit Software Product Identification Mode
! b. f; a* W% U *(baseAddress + FLASH_SEQ_ADD1) = ID_OUT_CODE;0 H9 k' ~4 h7 \/ S
return id;% o: ?4 a% k' k9 {& C" D/ t* T$ d+ o5 S
& M7 ^. {' f- I# sbaseAddress 为0x10000000,ARM片选NCS0.
. M7 w5 `% `1 Q6 H3 `& D结果读出来的id是0x00900090,单步显示:每写入一条命令指令,通过AXD读出来的Flash的内容都随着指令码而改变,譬如写入FLASH_CODE1,Flash内容随之变成0x55,FLASH_CODE2变成0xAA,ID_IN_CODE变成0x0090,故最后读取的id为0x00900090.不知何解啊?有没有高手解答解答的?非常感谢了。# T# D" U E) n. Y" c/ `/ e
& u o w5 r( {4 A
另:FLASH_SEQ_ADD1为0x555,FLASH_SEQ_ADD2为0x2AA。 |
|