Atmel START not resetting RTC sometimes?!?

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm running the FATFS example on "System A", the ATSAME54 XPlained Pro board.   I'm running the identical code on "System B", a custom ATSAME54 board.

 

On System A, the code runs fine.

On System B, the code hangs waiting for the RTC to sync:

atmel_start_init() 
. system_init()
. . CALENDAR_INTERFACE_INIT()
. . . calendar_init(&CALENDAR_INTERFACE, RTC)
. . . . _calendar_init(&calendar->device)
. . . . . hri_rtcmode0_get_CTRLA_ENABLE_bit(dev->hw)
. . . . . . hri_rtcmode0_wait_for_sync(hw, _SWRESET | _ENABLE | _COUNTSYNC)
. . . . . . . while (((Rtc *)hw)->MODE0.SYNCBUSY.reg & reg) {}

Both systems are configured with identical clock settings (both systems are running the same firmware!).

Both systems have an external 32KHz xtal and an external 12MHz main xtal.

Both processors are Rev A silicon.

 

In Atmel START => Dashboard => CALENDAR_INTERFACE, I've checked the "Force reset RTC on initialization", so I *assume* that would force a reset of the RTC on initialization.

 

If I explicitly do a software reset on the RTC before the call to CALENDAR_INTERFACE_INIT(), System B does not hang:

    // perform a software reset on RTC
    hri_rtcmode0_set_CTRLA_SWRST_bit(RTC);
    hri_rtcmode0_wait_for_sync(RTC, RTC_MODE0_SYNCBUSY_SWRST);
    CALENDAR_INTERFACE_init();

 

Two questions:

  • Can you think of any reason that System B (the custom SAME54 board) would hang, while System A (the stock SAME54 Xplained Pro board) does not?
  • Shouldn't Atmel START have generated code to reset the RTC?

 

Perhaps there is some stored state that's not erased during programming that's making the difference?

 

Environment:

  • Microchip Studio Version 7.0.2542
  • Atmel Kits (7.0.132)
  • ASF (3.49.1)
  • Atmel START (1.0.198.0)
  • Windows 10 Pro v 21H1

 

Last Edited: Tue. Jun 29, 2021 - 09:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'll move this to the proper forum.  Please note that there are TWO ASF forums.  One that is for AVR related issues, the other is for ARM related issues.

 

Jim - Moderator

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Aww geez.  I thought I'd selected Atmel START / ARM -- thanks for the correction.

 

Last Edited: Wed. Jun 30, 2021 - 01:24 AM