如題,extern UINT32 FLASH_EEPROM_CMD( UINT8 cmd, UINT32 StartAddr, PVOID Buffer, UINT32 Length ); 這個api原型在哪?還有里邊的入參StartAddr是對于dataflash起始地址0x70000的相對地址嗎?就是說startaddr 0對應0x70000?
對是的,這邊的地址是相對地址,傳入參數0即對應dataflsh的首地址
好謝謝~
請問下,CH592、582的data flash可以按字節(jié)擦除嗎?如下歷程中有按四字節(jié)擦除的操作。
/*******************************************************************************
?* @fn? ? ? Lib_Write_Flash
?*
?* @brief? ?Callback function used for BLE lib.
?*
?* @param? ?addr - Write start address
?* @param? ?num - Number of units to write (unit: 4 bytes)
?* @param? ?pBuf - Buffer with data to be written
?*
?* @return? None.
?*/
uint32_t Lib_Write_Flash(uint32_t addr, uint32_t num, uint32_t *pBuf)
{
? ? EEPROM_ERASE(addr, num * 4);
? ? EEPROM_WRITE(addr, pBuf, num * 4);
? ? return 0;
}
但是看資料中說最小擦除單元是256字節(jié)
Dataflash擦除最小單位是256B。