-
Notifications
You must be signed in to change notification settings - Fork 1k
EEPROM is erased on uploading new sketch #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The STM32 processors don't have native EEPROM. EEPROM is simulated in flash, where also the program resides. The usual location of the simulated EEPROM in flash is at its end. Arduino_Core_STM32/cores/arduino/stm32/stm32_eeprom.c Lines 120 to 135 in 0c6eccb
That means, if your program is to large it will erase the EEPROM. Likely redefining a smaller FLASH_PAGE_SIZE will not work. Arduino_Core_STM32/cores/arduino/stm32/stm32_eeprom.h Lines 48 to 58 in 5cc5415
|
@AnHardt I understand that, but what if sketch size is very well limited within the bounds and not reaching till the last sector, Lets say there is still 20kb space in flash and EEPROM is only last 1kb. Then we need not delete the EEPROM Content. If that can be given as an option to users in Arduino ide Menu, i think it'll be great. |
Assuming you are on windows, you will need to edit stlink_upload.bat in the tools folder. You need to change the line: to read: The 'ske' parameter for the -P switch skips flash erase. |
Probably could be added as a request for #445. |
Cool thank you @BennehBoy . Its been long , but i finally went with this- Just added -e 124 to erase only first 124 pages(Note that i am using bluepill with 128kb flash) and emulated eeprom is in last sector. But as suggested by @fpistm maybe in #445 we can give an option in arduino ide to select what to erase(Only Sketch or Sketch plus EEPROM). |
Since #514, by default there is no full erase (which is also required to not erase bootloader if any) This is the same line except the '1' prefixing |
Is your feature request/improvement related to a problem? Please describe.
EEPROM is erased on uploading new sketch.
Describe the solution you'd like
Can we give an option in upload menu for users to chose to clear only sketch or entire flash.
The text was updated successfully, but these errors were encountered: