-
Notifications
You must be signed in to change notification settings - Fork 976
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
STM32F103C8 EEPROM FLASH_BASE_ADDRESS has wrong value #1500
Comments
HI @mczerski |
FLASH_END which is defined in CMSIS file doesn't take into account the real flash size of a the device, (it is just the maximum possible within the productline). Fixes stm32duino#1316, fixes stm32duino#1500 Signed-off-by: Frederic Pillon <[email protected]>
Where is best to define this value for a Board/Variant? |
Variant_*.h |
Could this maybe be related to my problem? STMicroelectronics/OpenOCD#23 |
No, this issue is related to EEPROM library usage, which emulate an eeprom in flash. |
Maybe that's a very basic question, but how should those values be actually calculated? If defining correct values would help, is there any good way to calculate / verifiy them? |
Hi @gregbarski So only 2k should be used by default. So if your project is lesser that flash size - 2k, it should work if not then you should not use the EEPROM emulation. |
@fpistm Thank you. I try to base on the same datasheet. My device has 31 pages of main memory. The project takes: I'll keep searching. |
Right, normally, it should be ok. |
Yes, I did. Considering "empty" project, it's possible to write/update each single flash "cell" inside of |
@fpistm Is it possible to change the program memory size dynamically when Virtual EEPROM is enabled? |
No. |
I've tested with a Disco G031 the ut and get examples and it works as expected. My guess is the RAM is too small for your use case. |
Thank you for this investigation. I'll be testing it according to this path and will share the results. |
For STM32F103C8 device the FLASH_BASE_ADDRESS in libraries/EEPROM/src/utility/stm32_eeprom.c is calculated as (line 84):
where FLASH_END is defined as FLASH_BANK1_END (line 64) which in turn is defined as 0x0801FFFFUL (system/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:574) which is outside of the declared flash size for the STM32F103C8 device which is 64k not 128k.
I guess this works for genuine STM32 chips which usually have 128k despite the declared 64k. I found this issue while using fake CH32F103C8 chips (due to f... COVID 19 genuine stm32 are priced as gold) and those actually have 64k of flash :(
version:
Arduino_Core_STM32 current master
The text was updated successfully, but these errors were encountered: