|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
S29GL064N90TFI04:R4模式。
3 k8 W# \( d0 D+ ^在ARM下写入读取ID命令,代码如下:* L# \4 l' {) Z. U9 |
volatile unsigned short *baseAddress = (volatile unsigned short *) pFlash->pFlashInfo->baseAddress;9 N. Q+ S( W% p, n. U O
unsigned int id;/ X8 w+ S/ p' I0 a8 p3 I
. ]8 o- `4 D' g9 b: X7 n3 ?; Q. x
//* Enter Software Product Identification Mode
+ T! P$ {/ g4 L *(baseAddress + FLASH_SEQ_ADD1) = FLASH_CODE1;9 Z; x0 e$ s- ]9 n j; |
*(baseAddress + FLASH_SEQ_ADD2) = FLASH_CODE2;" t9 J# i; S, x
*(baseAddress + FLASH_SEQ_ADD1) = ID_IN_CODE;
0 x! s6 M" t6 r3 Q7 B+ v/ @! m& K3 b& o; ~" n1 H0 ^3 |7 E. M
//* Read Manufacturer and device code from the device
C: I. w; }* C' | id = (short) *baseAddress;
8 l; V: L9 W X/ o! q id |= *(baseAddress+1) << 16;
: j$ K. f( P! T5 l( }' I6 T# c9 m0 R3 \4 S/ x1 d. n3 I
//* Exit Software Product Identification Mode
: q/ B5 L" h0 o0 v" B8 y* c) q' u9 l *(baseAddress + FLASH_SEQ_ADD1) = ID_OUT_CODE;" `0 T: b$ }: z3 Z+ ~+ d# K
return id;
5 i+ |6 e8 s- V
* Z- I8 B" O) c4 k+ G6 Y% x- ^7 sbaseAddress 为0x10000000,ARM片选NCS0.
! k% ^* p: `6 o' n, {, {结果读出来的id是0x00900090,单步显示:每写入一条命令指令,通过AXD读出来的Flash的内容都随着指令码而改变,譬如写入FLASH_CODE1,Flash内容随之变成0x55,FLASH_CODE2变成0xAA,ID_IN_CODE变成0x0090,故最后读取的id为0x00900090.不知何解啊?有没有高手解答解答的?非常感谢了。
1 W( u: K, N$ b R, B& O- h
5 }+ W* C! s* e5 S% l* M另:FLASH_SEQ_ADD1为0x555,FLASH_SEQ_ADD2为0x2AA。 |
|