-1

我需要知道我们是否可以在选定的地址写入或读取 Arduino Due 的闪存,无需 EEPROM。我知道我们有 PROGMEM,但我无法在两个不同的地址写入两个字符串。当我Hello在地址写入闪存IFLASH0_ADDRHi写入地址IFLASH0_ADDR时,我无法将这些字符串读回,因为库DueFlashStorage不适用于那些选定的地址。

拜托,我真的很想知道我该怎么做。

4

1 回答 1

0

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.

Related:

  1. Arduino Stack Exchange: How to read/write variables persistenly on Arduino Due (no EEPROM/shield)?
  2. AN4894 Application note: EEPROM emulation techniques and software for STM32 microcontrollers
  3. [my question and answer] Arduino Stack Exchange: Is it possible to use extra AVR Flash memory as non-volatile EEPROM-like Flash memory storage?
于 2020-12-09T17:07:16.387 回答