在线时间285 小时
UID3419421
注册时间2017-8-30
NXP金币0
该用户从未签到
高级会员

- 积分
- 750
- 最后登录
- 2021-1-25
|
根据lpcxpresso54608\driver_examples\spifi\polling_transfer这个例子。有个问题想咨询一下
根据板子上的丝印以及原理图,板子上的QSPI Flash应该是MT25QL128ABA。
根据其手册以及代码
#define READ (0)
#define PROGRAM_PAGE (1)
spifi_command_t command[COMMAND_NUM] = {
{PAGE_SIZE, false, kSPIFI_DataInput, 1, kSPIFI_CommandDataQuad, kSPIFI_CommandOpcodeAddrThreeBytes, 0x6B},
{PAGE_SIZE, false, kSPIFI_DataOutput, 0, kSPIFI_CommandOpcodeSerial, kSPIFI_CommandOpcodeAddrThreeBytes, 0x38},
代码里 0x6B是READ 0x38是PROGRAM_PAGE 对应手册上QUAD OUTPUT FAST READ 和EXTENDED QUAD INPUT FAST PROGRAM,也就是quad模式读写正常。但是,我把指令换成一般的读和写,比如:03h (读) 和02h(写),不使能quad mode ,然后将上述command换成
{PAGE_SIZE, false, kSPIFI_DataInput, 1, kSPIFI_CommandAllSerial, kSPIFI_CommandOpcodeAddrThreeBytes, 0x03},
{PAGE_SIZE, false, kSPIFI_DataOutput, 0, kSPIFI_CommandAllSerial, kSPIFI_CommandOpcodeAddrThreeBytes, 0x02},
如果写的数据是:
for (i = 0; i < PAGE_SIZE; i++)
{
g_buffer = i;
}
就会全部出错:
.........
Data error in address 0xff7, the value in memory is 0xf8
Data error in address 0xff8, the value in memory is 0xf9
Data error in address 0xff9, the value in memory is 0xfa
Data error in address 0xffa, the value in memory is 0xfb
Data error in address 0xffb, the value in memory is 0xfc
Data error in address 0xffc, the value in memory is 0xfd
Data error in address 0xffd, the value in memory is 0xfe
Data error in address 0xffe, the value in memory is 0xff
如果写的是常量:
for (i = 0; i < PAGE_SIZE; i++)
{
g_buffer = 0x55;
}
就会最后一个字节出问题:
SPIFI flash dma example started
Data error in address 0xfff, the value in memory is 0xff
最佳答案
这个以前没怎么用过,我需要看看文档了,你自己也检查一下吧
|
|