Skip to content

Memory setting

Eugeny Shlyagin edited this page Jan 17, 2024 · 6 revisions

How to setup memory.

Sketch is supported two types of memory SRAM (by default) or EEPROM. Memory is needs to save LoRa data received.

Find and set USE_EEPROM_MEMORY constant.

#define USE_EEPROM_MEMORY false // "false" by default

Set "false" to use SRAM memory, "true" to use EEPROM.

EEPROM is permanent memory, data is not lost even if the system is turned off. But the write operation is finite and usually capped at 100,000 cycles. For more information please read: https://docs.arduino.cc/learn/programming/memory-guide

SRAM settings

#define SRAM_STORAGE_SIZE 15 // DATA array size

Not used if USE_EEPROM_MEMORY true, may be zero in this case. NOTE: Don't use all free memory! It's may broke BLE output. You should hold free memory for return String from "sendToPhone"

Free memory size you can see in the build information.

Screenshot 2024-01-17 at 14 34 45

If you enable debug mode, you can see the memory status in the Serial Monitor.

Снимок экрана 2024-01-17 в 13 57 30

EEPROM settings

EEPROM (non-volatile) memory not used if define USE_EEPROM_MEMORY false reserve for storing settings

#define EEPROM_BEGIN_ADDRESS 0 //bytes

Reserve part of the memory for other uses, not used if USE_EEPROM_MEMORY false

If you enable debug mode, you can see the memory status in the Serial Monitor.

Screenshot 2024-01-17 at 14 42 57

Clone this wiki locally