我需要知道我们是否可以在选定的地址写入或读取 Arduino Due 的闪存,无需 EEPROM。我知道我们有 PROGMEM,但我无法在两个不同的地址写入两个字符串。当我Hello
在地址写入闪存IFLASH0_ADDR
并Hi
写入地址IFLASH0_ADDR
时,我无法将这些字符串读回,因为库DueFlashStorage
不适用于那些选定的地址。
拜托,我真的很想知道我该怎么做。
我需要知道我们是否可以在选定的地址写入或读取 Arduino Due 的闪存,无需 EEPROM。我知道我们有 PROGMEM,但我无法在两个不同的地址写入两个字符串。当我Hello
在地址写入闪存IFLASH0_ADDR
并Hi
写入地址IFLASH0_ADDR
时,我无法将这些字符串读回,因为库DueFlashStorage
不适用于那些选定的地址。
拜托,我真的很想知道我该怎么做。
Try this library: https://github.com/sebnil/DueFlashStorage.
Most basic use (copied from the above library's readme):
// write the value 123 to address 0
dueFlashStorage.write(0,123);
// read byte at address 0
byte b = dueFlashStorage.read(0);
It emulates EEPROM using Flash memory pages.
Here's the concept of EEPROM emulation explained in Application Note AN2594, for STM32 microcontrollers, for instance. It explains the concept of how to use two flash memory pages for EEPROM emulation. A similar paper may exist for the AT91SAM3X8E microcontroller (1459 pg. datasheet here) used by the Arduino Due.