This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Reconfig UART RX PIN as GPIO and use it to wake-up 52840. And how to do it using Zephyr UART?

Hi All,

I am new to Zephyr/NCS, so I am a little confused about which UART driver (Zephyr's uart/nrf_libuarte/nrfx_uart/nrfx_uarte) to use to approach this feature with the lowest power consumption:

My custom 52840 board have 2-wire rx/tx connected to a sensor's UART and there is no RTS/CTS.

After received UART data from the sensor, 52840 will wake up and then process the data send by the sensor and then back to sleep again.

The sensor will resend uart data until hear UART response from 52840, so I don't need to worry about data lost.

To do this, my plan is as same as mentioned in Case ID:231801

1. Configuring the rx as GPIO input and configuring the GPIO as wakeup pin with sense low

2. Read the GPIO status, if it is low then deinit the gpio and reinit it as UART

3. After done with the recved UART data, deinit the UART and reinit the rx pin as GPIO

My questions are:

1. Can I use Zephyr's UART/GPIO driver to do this or I must disable Zephyr's driver and use nrfx drivers directly?

2. Doing some search on devzone and it seems I should choose nrfx_uart over nrfx_uarte as enable easyDMA will have higher current consumption, am I correct?

3. Accourding to 1 and 2, which driver should I use? Zephyr's uart or nrf_libuarte or nrfx_uart or nrfx_uarte?

3. Is there any code snippet of init/deinit UART/GPIO in Zephyr/NCS? All I can find on github are using nrf APIs and seems deprecated in NCS 1.6.1.

Regards,

Anthony

Parents Reply Children
No Data
Related