我用6楼的例程,ID可以识别到,读写遇到问题,帮忙看一下
void MX25L_Flash_Test(void)
{
unsigned short i, j;
uint32_t id = MX25_QSPI_ReadID();
printf("id=%x \r\n", id);
MX25_QSPI_WriteEnable();
if(MX25_QSPI_EN4B() != 0) printf("enter 4 Byte error!\r\n");
else printf("enter 4 Byte success!\r\n");
parse_flash_regs();
for(j=0; j<1; j++)
{
for(i=0; i<4096; i++) buffer[i] = 0x55;
if(MX25_QSPI_EraseSector((uint32_t)0) == 0) printf("MX25_QSPI_EraseSector success!\r\n");
MX25_QSPI_WriteBuffer(buffer, (uint32_t)0, 256);
MX25_QSPI_ReadBuffer(buffer, (uint32_t)0, 256);
printf("the readbuff[%d],\r\n", j);
for(i=0; i<256; i++)
{
printf("%d,", buffer[i]);
}
printf("\r\n");
}
}
读取打印出来的数据完全对不上,不知道咋回事
底下是打印出来的内容
id=c22019
enter 4 Byte success!
status reg : 2 , config reg: 20
=== Status Register (0x02) ===
Bit 0 [WIP] : 0 -> IDLE (Ready)
Bit 1 [WEL] : 1 -> Write Enabled
Bit 2-5 [BP] : 0000 -> Block Protect Level (See Table 2)
Bit 6 [QE] : 0 -> Single/Dual Mode Only
Bit 7 [Res] : 0 -> Reserved
=== Configuration Register (0x20) ===
Bit 0-1 [ODS] : 00 -> Output Driver Strength (See Table 9)
Bit 2 [Res] : 0 -> Reserved
Bit 3 [TB] : 0 -> Top Area Protect (OTP)
Bit 4 [PBE] : 0 -> Preamble Disabled
Bit 5 [4BYTE] : 1 -> 4-Byte Address Mode (>128MB)
Bit 6-7 [DC] : 00 -> Dummy Cycle Config (See Table 10)
MX25_QSPI_EraseSector success!
the readbuff[0],
136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204, |