Sony's Developer World forum

    • Home
    • Forum guidelines

    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

    Spresense
    2
    6
    796
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pnj42 last edited by

      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: ffffffe9

      RTC.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?

      K 1 Reply Last reply Reply Quote
      • K
        KamilTomaszewski DeveloperWorld @pnj42 last edited by

        @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

        P 1 Reply Last reply Reply Quote
        • P
          pnj42 @KamilTomaszewski last edited by

          @kamiltomaszewski Our code worked fine in the older SDK, but fails in the latest? I confirm have updated the bootloader.

          K 1 Reply Last reply Reply Quote
          • K
            KamilTomaszewski DeveloperWorld @pnj42 last edited by

            @pnj Do you know what function causes this issue?

            P 2 Replies Last reply Reply Quote
            • P
              pnj42 @KamilTomaszewski last edited by

              @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

              1 Reply Last reply Reply Quote
              • P
                pnj42 @KamilTomaszewski last edited by

                @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.

                1 Reply Last reply Reply Quote
                • First post
                  Last post
                Developer World
                Copyright © 2021 Sony Group Corporation. All rights reserved.
                • Contact us
                • Legal