Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Possible bug when writing to flash using the EEPROM library (F7) #297

Copy link
Copy link
@hasenbanck

Description

@hasenbanck
Issue body actions

Version used: Current HEAD + PR
Affected variant: RemRam v1

Currently I try to write some configuration values with the help of the EEPROM library to the flash.

Given this simple sketch:

#include <EEPROM.h>

void setup() {
	Serial.begin(115200);
	uint8_t v = EEPROM.read(0);
	if (v == 123) {
		Serial.println("Saved");
	} else {
		Serial.println("Wasn't saved");
		EEPROM.write(0, 123);
	}
}

void loop() {
	delay(15);
}

The flash won't safe the variable content. I tracked down the problem to the set_data_to_flash() function in stm32_eeprom.c.

HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError) will return an HAL_ERROR and when debugging the error with HAL_FLASH_GetError(), I will receive a FLASH_ERROR_WRP error (FLASH Write protected error). SectorError contains a 0x17 (23).

Is there anything special I need to do when wanting to write to the flash when using a F7?

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't workingSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.