LPUART using interrupt (not async) not working

Hi,

I'm trying to use LPUART in interrupt mode (not async), but I can't get it to work.

I'm using the sample in NCS, which works when using async.

When I uncomment the line in prj.conf to activate the interrupt mode, the power consumption goes way up (around +1 mA).

What am I doing wrong to work with LPUART in interrupt mode ?

Regards

Giuliano

  • Hello Giuliano,

    I'll take a look at this tomorrow/Thursday.

    Edit: I'm in home office now and forgot to bring the PPK. Sorry about that. I will get a hold of the PPK tomorrow (Friday) and do some tests.

    Best regards,

    Simon

  • Sorry for the delay. I got hold of a PPK now and will look into it today.

  • Hello, I tested the LPUART sample with interrupt NCS 2.0.0, nrf5340dk_nrf5340_cpuapp and CONFIG_NRF_SW_LPUART_INT_DRIVEN=y. I measured a current of 94.3 uA, not as low as I expected, but definitely lower than 1 mA. When using the lpuart in async mode, I measured a current of around 94 uA as well. 

    You can see that the communication happen as expected with 600ms between each transfer.

    Here is the sample I used, with build folder attached, so you can compare. I used NCS v2.0.0 and the nRF5340DK v0.11.0. I disabled uart logging and enabled the interrupt driven Kconfig.

    lpuart_test.zip

    Let me know if you get the same result (94uA) or 1mA

    Best regards,

    Simon

  • Hi Simon,

    I've checked the zephyr/include/generated/autoconf.h, and the LP UART seems to remain in async mode, not in INT mode.

    I've tried the config you used, and I have a lot of CMake waning:

    warning: UART_1_ASYNC (defined at drivers/serial/Kconfig.nrfx:132) was assigned the value 'y' but
    got the value 'n'. Check these unsatisfied dependencies: (!UART_1_INTERRUPT_DRIVEN) (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up UART_1_ASYNC in
    the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
    Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.


    warning: UART_1_NRF_HW_ASYNC (defined at drivers/serial/Kconfig.nrfx:161) was assigned the value 'y'
    but got the value 'n'. Check these unsatisfied dependencies: UART_1_ASYNC (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up
    UART_1_NRF_HW_ASYNC in the menuconfig/guiconfig interface. The Application Development Primer,
    Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
    helpful too.

    If I try the same config with nRF9160, it does not compile:

    xxx/nordic/nrfx/drivers/include/nrfx_timer.h:66:5: error: field name not in record or union initializer
       66 |     .cc_channel_count = NRF_TIMER_CC_CHANNEL_COUNT(id),  

    Are you sure you are indeed using INT mode and not ASYNC mode here ?

    Regards

    Giuliano

Related