|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
S29GL064N90TFI04:R4模式。7 w: x* O0 I w! u, |1 P) ~4 O
在ARM下写入读取ID命令,代码如下:
; p; B( O3 @: ]6 Fvolatile unsigned short *baseAddress = (volatile unsigned short *) pFlash->pFlashInfo->baseAddress;* l4 ]% s; H( J# |
unsigned int id;% ]3 W/ ^9 [3 }, `" j6 F! ^) G
9 t, ?3 v% h2 a9 z: h) B4 G; J" D //* Enter Software Product Identification Mode
( L9 H% i( c$ X! j" d1 q *(baseAddress + FLASH_SEQ_ADD1) = FLASH_CODE1;
1 H1 Z9 F4 J# [5 } *(baseAddress + FLASH_SEQ_ADD2) = FLASH_CODE2;! ]1 W8 c- M, F9 \3 L
*(baseAddress + FLASH_SEQ_ADD1) = ID_IN_CODE;
/ D2 ^. J! o) T8 |5 R7 x$ u5 O& i
" r" \2 v; P/ L; b( v4 h" I: e //* Read Manufacturer and device code from the device
7 g1 u6 l) i3 M: `- L; p id = (short) *baseAddress;
5 a: t& N4 u- i id |= *(baseAddress+1) << 16;* h+ [1 Y9 w) M* j+ N0 O1 ?
/ p: }% I9 u9 G, W' c
//* Exit Software Product Identification Mode
* i' N" G* o- C *(baseAddress + FLASH_SEQ_ADD1) = ID_OUT_CODE;# z+ ~- ]- Q& R3 {# `/ L( T0 f
return id;
( |% V9 g) z2 y- j& Q
# i3 o, D8 k; |2 pbaseAddress 为0x10000000,ARM片选NCS0.
( |8 g( z6 t, q1 q结果读出来的id是0x00900090,单步显示:每写入一条命令指令,通过AXD读出来的Flash的内容都随着指令码而改变,譬如写入FLASH_CODE1,Flash内容随之变成0x55,FLASH_CODE2变成0xAA,ID_IN_CODE变成0x0090,故最后读取的id为0x00900090.不知何解啊?有没有高手解答解答的?非常感谢了。$ E% f! N h$ J9 f& P4 F
2 A' q9 B( e5 _另:FLASH_SEQ_ADD1为0x555,FLASH_SEQ_ADD2为0x2AA。 |
|