|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
S29GL064N90TFI04:R4模式。! `# Q# H+ I# e0 j1 y! [ s
在ARM下写入读取ID命令,代码如下:
4 s% b$ Y, D8 C- g' w k8 B! O: ivolatile unsigned short *baseAddress = (volatile unsigned short *) pFlash->pFlashInfo->baseAddress;
! a0 \: m; s! ]% I" O; X2 F' v1 F unsigned int id;
- ?$ w- V+ V1 V7 C1 [
* u* y+ u4 h9 k" p //* Enter Software Product Identification Mode& o% |2 |8 A2 G+ g0 N
*(baseAddress + FLASH_SEQ_ADD1) = FLASH_CODE1;% |& S$ d5 A5 u) d, c' f
*(baseAddress + FLASH_SEQ_ADD2) = FLASH_CODE2;( A+ ~- z9 L* u1 k* P5 ?* r2 Z
*(baseAddress + FLASH_SEQ_ADD1) = ID_IN_CODE;( }+ m$ I3 Y( c+ ]! T
! a6 ^9 \9 U; y //* Read Manufacturer and device code from the device' G/ f- \* q) }
id = (short) *baseAddress;
! Q& j4 M& y8 n! J" s3 a( V id |= *(baseAddress+1) << 16;
" l# h7 B9 b; j$ T( M
4 H6 {9 ?8 E; H# l6 P+ o j* ]$ m D5 p" ] //* Exit Software Product Identification Mode
( Y- n$ O5 d8 E5 ^* M+ Q4 m *(baseAddress + FLASH_SEQ_ADD1) = ID_OUT_CODE;
" G' j5 q8 Z1 _" K, C; V return id;3 t/ |4 Q9 C" o9 @
. m- h1 e1 o% J/ {2 R1 n, m
baseAddress 为0x10000000,ARM片选NCS0." F H7 t& C9 q4 x" O4 M9 h
结果读出来的id是0x00900090,单步显示:每写入一条命令指令,通过AXD读出来的Flash的内容都随着指令码而改变,譬如写入FLASH_CODE1,Flash内容随之变成0x55,FLASH_CODE2变成0xAA,ID_IN_CODE变成0x0090,故最后读取的id为0x00900090.不知何解啊?有没有高手解答解答的?非常感谢了。) Z, f- M( n" c" x- j
0 d" z( p8 C1 y* [6 Y5 k3 n3 Q
另:FLASH_SEQ_ADD1为0x555,FLASH_SEQ_ADD2为0x2AA。 |
|