Wow, amazing, it works. Nice debugging I get that itās a dirty hack but at least itās a good start.
What is a mystery to me is that why does it work with the Arduino IDE and not with pio?
Wow, amazing, it works. Nice debugging I get that itās a dirty hack but at least itās a good start.
What is a mystery to me is that why does it work with the Arduino IDE and not with pio?
Slight differences in linking order (which there are in comparison to the Arduino IDE), compiler flags or compiler version can shuffle the stack around enough to cause a difference in stack memory and set the value of dotw
to a value outside the 0-6 range and thus fail verification. The base problem is the code not initializing the datatstructureās dotw
field, leading to undefined behavior.
I can open an issue or directly a PR about this with a fixed version. Setting it to zero doesnāt seem correct, especially since the rtc_set_datetime
function writes it in the RTC registers. But then, the entire time in the Arduino IDE , correctness was also more based on luckā¦
Thanks for the explanation, I am more than happy to open an issue, donāt worry about that.
As before, many thanks for debugging and looking into this super quickly
I was faster already, opened at Library converts datetime_t incorrectly, causing example to fail Ā· Issue #4 Ā· khoih-prog/RP2040_RTC Ā· GitHub
No problems
The bug has been properly fixed in v1.0.7 to fix bug in rtc_set_datetime() Ā· khoih-prog/RP2040_RTC@de19cbf Ā· GitHub. The new 1.0.7 version should be visible in https://platformio.org/lib/show/12433/RP2040_RTC/installation soon, or directly via referencing https://github.com/khoih-prog/RP2040_RTC.git
.
Yeah, thanks to both of you