-
Notifications
You must be signed in to change notification settings - Fork 961
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
EEPROM usage hangs sometimes #930
Comments
It seems to be the write operation that's causing the hangup. |
This is not link to EEPROM. |
I respectfully disagree, hangup only appears when using both EEPROM and LowPower at the same time. When either one is removed, the sketch no longer hangs.
I don't think that's the case - the hang also appears when using idle(), sleep() or shutdown().
Sorry, I'm not entirely sure what you mean there - could you please point me to some more information on this? Thank you. |
I told that because, as a first issue the low power mode seems not properly set, in that case before digging in EEPROM. This should be fixed to ensure be in a proper clock and power config.
That's what I said, there is an issue with low power mode.
In the Arduino Tools menu: Optimize instead of Anyway, even if it's not hangs the timing is not correct and rely on the fact Low Power mode is not properly set. I've tested RTC and the timing is correct so all drive me to issue with Low Power mode config. |
I will check using the debug menu, thanks. In the meantime, is there a workaround? For example, calling HAL functions directly or changing the configuration? |
Don't know. This will require some investigation. And as said I will not be able to dig into this soon. Any help are welcome. |
Seems the behavior depends on selected optimization, it hangs with -Os, but doesn't with -O1, -O2, -O3 and -g. As was mentioned previously, the timing is off - LowPower.sleep(1000) only sleeps for about 650 ms. |
Hi @jgromes I will have to investigate deeply. |
Thank you very much for keeping an eye on this issue. Please let me know if there are any updates, or if you need help with something (e.g. testing). |
Due to some cast on (uint64_t *) of eeprom_buffer, compiler may use asm instruction LDRD which required an alignment: 4 bytes on Armv7 architecture, and 8 bytes (depending on SCTLR.U) on Armv6 architecture. To fit to all cases, alignment is made on 8 bytes. Fixes stm32duino#930
Hi @jgromes , |
That's absolutely brilliant, thank you so much! |
Due to some cast on (uint64_t *) of eeprom_buffer, compiler may use asm instruction LDRD which required an alignment: 4 bytes on Armv7 architecture, and 8 bytes (depending on SCTLR.U) on Armv6 architecture. To fit to all cases, alignment is made on 8 bytes. Fixes stm32duino#930
Due to some cast on (uint64_t *) of eeprom_buffer, compiler may use asm instruction LDRD which required an alignment: 4 bytes on Armv7 architecture, and 8 bytes (depending on SCTLR.U) on Armv6 architecture. To fit to all cases, alignment is made on 8 bytes. Fixes stm32duino#930
Due to some cast on (uint64_t *) of eeprom_buffer, compiler may use asm instruction LDRD which required an alignment: 4 bytes on Armv7 architecture, and 8 bytes (depending on SCTLR.U) on Armv6 architecture. To fit to all cases, alignment is made on 8 bytes. Fixes #930
Hi Is that mean EEPROM.write() from <EEPROM.h> is safe to use now? Does this apply the same to using on STM32F103Cx series? Best, |
Hi @HappySamuel, |
Hi @HappySamuel |
Hi @fpistm Any suggested examples or libraries to use I2C EEPROM? Best, |
|
Hi @fpistm Thank you for the sharing. Will test it out when i have an I2C EEPROM. Best, |
Hi, I'm trying to use this library together with EEPROM, but for some reason, calls to EEPROM methods (put/get) seem to hang when using LowPower - the following sketch hangs at
EEPROM.put()
and never reachesEEPROM.get()
or another loop.Board: Nucleo L452RE-P
STM32 core version: cloned from repo
Sketch to reproduce:
Thanks!
The text was updated successfully, but these errors were encountered: