How to switch uart pins while runtime using pinctrl (Zephyr) (nrf52832) ?

To whom it may concern,

I have a project (using Zephyr) where I need to switch UART pins while runtime. Is there a way I can handle this? This is how I initialize pinctrl pins.

I split it into two different groups. Is it possible to initialize these two groups and switch between them at runtime?

Parents
  • Hi,

    Sorry for the delayed response. Yes, switching between the groups at runtime or dynamic pin allocation, should be possible. You can refer to the Pin Control for further details regarding this. 

    Also, in the screenshot that you attached, since you are using pinctril1 , and initialising the i2c0 and uart0 within this, it would be better to stick to pinctl1 when defining it within the uart0

    As I mentioned earlier, please refer the Pin Control section for further details.

    Best Regards,

    Priyanka

Reply
  • Hi,

    Sorry for the delayed response. Yes, switching between the groups at runtime or dynamic pin allocation, should be possible. You can refer to the Pin Control for further details regarding this. 

    Also, in the screenshot that you attached, since you are using pinctril1 , and initialising the i2c0 and uart0 within this, it would be better to stick to pinctl1 when defining it within the uart0

    As I mentioned earlier, please refer the Pin Control section for further details.

    Best Regards,

    Priyanka

Children
Related