QN9020读串行闪存时,芯片不工作
static void read_flash(uint32_t addr, uint32_t *pBuf, uint32_t nByte)
{
addr += QN_FLASH_BASE; //get the data register address of flash control register
while(is_flash_busy()); //wait the flash is free.
sf_ctrl_SetDataLen(QN_SF_CTRL, nByte);
nByte >>= 2; //nByte must is 4 integer times
while (nByte--)
{
*pBuf++ = *(uint32_t *)addr;
addr += 4;
}
}
执行 sf_ctrl_SetDataLen(QN_SF_CTRL, nByte);就会出现芯片不工作,请问是哪里出了问题?
__STATIC_INLINE void sf_ctrl_SetDataLen(QN_SF_CTRL_TypeDef *SF_CTRL, uint32_t value)
{
__wr_reg((uint32_t)&SF_CTRL->DATA_LEN, value);
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
power_on_flash(FLASH_WR);
bInitFlag = FALSE;
//i = ReadFlashOneByte((SECTOR_PARA + 1), E2PROM_INI_ADDR0);
read_flash(0x4000, (uint32_t *)readbuffer, 256);
一周热门 更多>