This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Configuration of pins at runtime

Hello,

I am writing the device tree for our custom board, which uses an nRF9160 SiP. This approach to configuring the hardware

is new to me, since my experience is with micro-controllers where the hardware is configured at runtime.

With the device trees, once a set of pins is configured for a given functionality (say serial port or SPI) is it possible to change them

at runtime for another functionality ? 

For instance, two pins are configured as Tx and Rx of a serial port, but for testing we would like to be able to at runtime to

change them to I/O pins and control them.

  • Hi!

    Unfortunately, Zephyr does not have a runtime pin control subsystem yet. So if you want to change the device tree during run time, you'll need to use the HAL directly.
    Best regards,
    Heidi
  • It is 10 months later... Does Zephyr now allow for configuring GPIO's in runtime?
    We have a pin that should be used as an ADC signal during most of the time, but before going into sleep mode we would need this pin to become a GPIO Input with enabled interrupt, so as to waking up the MCU (and then back again to ADC during "normal mode").

    If this is not available and we use direct configuration of the MCU's registers, what are the "special concerns" in the device tree that we have to take in order not to mess up Zephyr usage of the pin?

Related