-
Notifications
You must be signed in to change notification settings - Fork 1k
EEPROM library broken #1678
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hi @lincomatic, Note, I am on main branch of the Core (sha1:e156c32db24d69cb4818208ccc28894e2f427cfa) I am surprised when you say that you tested STM32F102C8T6, because there is currently no variant defined for STM32f102 !! which variant did you used ? |
Hi @ABOSTM, |
I checked on official v2.2.0 core version and it is still working on my bluepill.
If it is still not working, could you try, for test purpose, to use variant : "BluePill F103C6 (32K)" in the Arduino IDE board menu selection ? |
Thank you so much for your help! It appears that I might have a fake MCU, but the behavior is strange. |
@lincomatic , any news ? |
@ABOSTM, sorry! I didn't see your last reply. My chip reports 64K, just like yours. |
On my side, EEPROM.length() returns 1024. The EEPROM emulation uses the last flash page. Also, another possibility is that your last flash page (63) is broken: Flash pages have limited lifecycle (limited number of write operations) |
Sorry again for taking so long to reply! I didn't receive the notification about your message.
Hmm. Sorry, I must have done something wrong last time. I just tested again, and it returns 1024 with either "BluePill F103C6 (32K)" or "BluePill F103C8" selected.
I don't think it's broken.. I have 2 different boads, and they both behave the same way. I think maybe my boards have a fake STM32F103C8T6, since I can't get into the USART bootloader in either one. I wrote a sketch to write sequential bytes into the EEPROM locations:
However, when I select "BluePill F103C8," the writing fails: I verified that page 63 really exists, by writing some data into the first 2 bytes it using STM32CubeProgrammer: As you can see from above, page 63 is working fine. There appears to be a problem w/ calculating the offsets properly when I select "BluePill F103C8" on my MCU |
@lincomatic , |
OK, thanks for trying. Appreciate the time you spent on this. |
I'm copying my answer from my post so others can find it here too. The problem is with the "stm32_eeprom.c" file. It seems to incorrectly calculate the Flash End at 128K for a 64K chip which leads to an incorrect Flash Base. The solution was to replace |
@warp929 Thank you!!! |
i dont know is it because im using blue pill clone or not. my eeprom disappeared only when i program near 100% of flash. (97ish%) is there any correlation? |
Hi, is the EEPROM library supposed to work? I tested it with a blue pill & STM32F102C8T6. When I try to write any EEPROM location and read it back, it fails.
Sample code:
EEPROM.write(0,0xbd); Serial.printf("%02x",EEPROM.read(0));
The read function just returns 0.
I also tried the functions directly from utility/stm32_eprom.c, and they don't work, either.
The text was updated successfully, but these errors were encountered: