其他命令都可以正常工作。就这个命令,从主存转缓存不工作。
昨天折腾了一天,也找不到问题。
支持主存转缓冲了,我就可以主存到缓冲,修改缓存部分,然后保存。
/ **********************************************************************************
unsigned char dataflash_read_flash2buffer(FLASH_BUFFER_NUM buffer_num, unsigned int page)
{
if(dataflash_wait_busy())
{
CS_FLASH_LOW; // Flash-Chip-Select Low-Level
if (buffer_num == FLASH_BUFFER1)
spi_transfer(0x53);
else
spi_transfer(0x55); // 8-bit opcode
spi_transfer(ADR_P_1(page));
spi_transfer(ADR_P_2(page));
spi_transfer(0x00); // 8 don't care bits
CS_FLASH_HIGH;
// Flash-Chip-Select High-Level
while(!dataflash_wait_busy());
return 1;
}
return 0;
}
|