-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Description
I have been getting an intermittent "Cache disabled but cached memory region accessed" crash. It only happens about 60% of the time. I have read everything I can find on this issue, but cannot find a solution that works for me. I have tried several methods including Preferences and the EEPROMClass methods.
I want to save a small struct to non volatile memory.
typedef struct {
uint8_t settings_version; // stores the settings format version
uint8_t led_brightness;
uint8_t joystick_deadzone;
uint16_t attack_threshold;
uint8_t audio_volume;
uint8_t lives_per_level;
// saved statistics
uint16_t games_played;
uint32_t total_points;
uint16_t high_score;
uint16_t boss_kills;
}settings_t;
As I understand it, while I am saving to EEPROM, the most likely problem is, the memory gets lock and another task or interrupt is trying to load code into memory. I have only one Interrupt and I use IRAM_ATTR with that. I do use some libraries, that might have interrupts or tasks: Wifi.h, wifi_ap.h, FastLED.h.
The code is too big to post here, but it is on Github. The EEPROM code is in this file.
Bounty: I use this on an open source LED strip game. I would be happy to send some free hardware to the first person that helps me solve this issue.