Upcoming maintenance
Dear Customers and Partners.
This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.
This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.
We apologize for any inconvenience.
RTC causing an issue when using Arduino and spresence 2.3.0
-
We have been built and running code using Arduino and spresence 2.2.1 SDK which includes the use of the RTC function and this is working fine, however when we try and build the same code using 2.3.0 it compiles fine, but when running we get the following error in the monitor:
arm_hardfault: PANIC!!! Hard fault: 40000000
up_assert: Assertion failed at file:armv7-m/arm_hardfault.c line: 135 task: init
up_registerdump: R0: a10d03b1 000000d0 0d031c50 290d0079 000000d0 0d03a038 0d02a83c 00000000
up_registerdump: R8: 00000000 00000000 00000000 00000000 00000000 0d039f38 0d000303 0d000302
up_registerdump: xPSR: 21000000 BASEPRI: 000000e0 CONTROL: 00000000
up_registerdump: EXC_RETURN: ffffffe9RTC.begin();
RtcTime dateTime(t.setYear(),t.setMonth(),t.setDay(),t.setHour(),t.setMinute(),t.setSecond(),t.second2);
RTC.setTime(dateTime);Any suggests why this might be?
-
@pnj I used version 2.3.1 and this code below works for me:
#include <RTC.h> void setup() { // put your setup code here, to run once: RTC.begin(); RtcTime dateTime(1,1,1,1,1,1,1); RTC.setTime(dateTime); } void loop() { // put your main code here, to run repeatedly: }
Could you also check it out? Could you please share some example of a source code that doesn't work for you?
If you are using a newer SDK try burn new bootloader (Tools -> Burn Bootloader)
Best Regards,
Kamil Tomaszewski -
@kamiltomaszewski Our code worked fine in the older SDK, but fails in the latest? I confirm have updated the bootloader.
-
@pnj Do you know what function causes this issue?
-
@kamiltomaszewski I think it is number formatting in our code, but not sure why that causes such an error in the spresense when we change the SDK version. As the code does not change? I will continue to look into what was written
-
@kamiltomaszewski On investigation I believe the error is in our code, there is a function called which fails to return anything (t.setSecond()), therefore the code is incorrect and causes an error. Though the same issue is there when we try an compile with either SDK, so not sure why we only see the problem in the latest SDK version!
Once the function returns the expected value the error is no more.