Giter Site home page Giter Site logo

Comments (2)

takumiando avatar takumiando commented on May 27, 2024

I(actually our team) develop two editions of the IoT devices with SPRESENSE.
The version A uses onboard RTC and the version B should use external one.

But I don't want to release two firmware binaries for each editions(for costs!).
So I want to switch RTCs in a same firmware by EEPROM, status of GPIO, etc.

Do you have any good ideas?

apache/nuttx#7089

from spresense.

SPRESENSE avatar SPRESENSE commented on May 27, 2024

@takumiando san
As the incubator-nuttx issue comment, arch_rtc.c is introduced very later, and is not used by Spresense.
Spresense is using drivers/timers/rtc.c as the upper-half driver.
And, the lower-half driver is implemented in cxd56_rtc_lowerhalf.c using the chip-internal RTC.

  graph TD;
      drivers/timers/rtc.c-->cxd56_rtc_lowerhalf.c;
      cxd56_rtc_lowerhalf.c-->cxd56_rtc.c;

If you want to switch RTC device drivers via /dev/rtc,
you can implement another external lower-half driver
and switch the lower-half driver to register with rtc_initialize().

  graph TD;
      drivers/timers/rtc.c-->cxd56_rtc_lowerhalf.c;
      cxd56_rtc_lowerhalf.c-->cxd56_rtc.c;
      drivers/timers/rtc.c-->External_lowerhalf_driver;

On the other hand, up_rtc_xxx() functions are also used from sched/clock.
I think that even in cases where an external RTC is used, sched/clock can continue to use the internal RTC.

If you want to also switch the RTC used from sched/clock, the up_rtc_xxx function will be conflicted as you know.

It may be easier to dynamically switch between RTC internal or external on the up_rtc_xxx() functions.

from spresense.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.