async uart fails when adding shell

Hello,

Starting the ncs 3.1.1 UART ASYNC examples on nrf52840dk and nrf9151dk, works fine.

Then I add SHELL on nrf9151 side, it crashes when getting incoming bytes (rx).

When adding the below CONFIGs (async on uart3, shell on uart0), it no longer crashes, but shell and app freezes when uart3 receives bytes.

The configs are added to the nrf9151 side, the nrf52 side just continue running the sample without shell.


CONFIG_UART_3_ASYNC=y
CONFIG_UART_3_INTERRUPT_DRIVEN=n
CONFIG_UART_3_NRF_HW_ASYNC=y
CONFIG_UART_3_NRF_HW_ASYNC_TIMER=2
CONFIG_NRFX_TIMER2=y
CONFIG_NRFX_UARTE3=y
CONFIG_SHELL=y
CONFIG_SHELL_TAB=y

CONFIG_UART_0_ASYNC=n
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_0_INTERRUPT_DRIVEN=y
If trying this config:
CONFIG_UART_ASYNC_API=y
CONFIG_UART_3_INTERRUPT_DRIVEN=n
CONFIG_UART_3_ASYNC=y

CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_0_ASYNC=n
CONFIG_UART_0_INTERRUPT_DRIVEN=y
As suggested here 
CONFIG_SHELL=y
CONFIG_SHELL_TAB=y

CONFIG_UART_ASYNC_API=y
CONFIG_UART_3_INTERRUPT_DRIVEN=n
CONFIG_UART_3_ASYNC=y

CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_0_ASYNC=n
CONFIG_UART_0_INTERRUPT_DRIVEN=y
It crashes again.


If trying this config:
CONFIG_UART_3_ASYNC=y
CONFIG_UART_3_INTERRUPT_DRIVEN=n
CONFIG_UART_3_NRF_HW_ASYNC=y
CONFIG_UART_3_NRF_HW_ASYNC_TIMER=2
CONFIG_NRFX_TIMER2=y
CONFIG_NRFX_UARTE3=y

CONFIG_UART_0_ASYNC=n
CONFIG_UART_0_INTERRUPT_DRIVEN=y
CONFIG_UART_0_NRF_HW_ASYNC=n
CONFIG_NRFX_UARTE0=y
It does not crash, but get error on rx:
[06/11/25 - 11:59:11:158] [00:00:10.378,631] <inf> sample: Loop 1: Sending 1 packets
[06/11/25 - 11:59:11:166] [00:00:10.378,692] <err> sample: Unknown error (-134)
[06/11/25 - 11:59:11:174] [00:00:10.378,723] <inf> sample: RX is now disabled
[06/11/25 - 11:59:16:158] [00:00:15.378,814] <inf> sample: Loop 2: Sending 2 packets
[06/11/25 - 11:59:16:166] [00:00:15.378,875] <err> sample: Unknown error (-134)
[06/11/25 - 11:59:16:174] [00:00:15.378,906] <err> sample: Unknown error (-134)
[06/11/25 - 11:59:16:181] [00:00:15.378,936] <inf> sample: RX is now enabled
[06/11/25 - 11:59:21:159] [00:00:20.379,028] <inf> sample: Loop 3: Sending 4 packets
What config combination should work?
UART3: ASYNC
UART0: SHELL
Parents Reply Children
  • Hi again Dag, I'll take over this case for a bit.

    Could you show me how it is crashing on your side? Are you eg. getting som logs with error messages? 

    dagvegar said:
    When confirmed that the board communicate, add CONFIG_SHELL=y to the nRF9151DK side. It will not compile without modifications.

    What modifications would you need here at this step? I got the impression first that you see just adding shell alone is making it crash? 

    Regards,

    Elfving

  • The UART ASYNC example compiled for nrf9151DK-ns compiles without modifications when adding these lines:

    (you may try yourself)

    CONFIG_SHELL=y
    CONFIG_MAIN_STACK_SIZE=4096

    But crashes:

    *** Using Zephyr OS v4.1.99-ff8f0c579eeb ***
    [00:00:05.410,552] <inf> sample: Loop 0: Sending 3 packets
    [00:00:05.413,146] <err> os: ***** SECURE FAULT *****
    [00:00:05.413,177] <err> os: Invalid entry point
    [00:00:05.413,177] <err> os: r0/a1: 0x000163e4 r1/a2: 0x200108c0 r2/a3: 0x00000013
    [00:00:05.413,208] <err> os: r3/a4: 0xffffffff r12/ip: 0x00000000 r14/lr: 0x00008787
    [00:00:05.413,208] <err> os: xpsr: 0x00000000
    [00:00:05.413,208] <err> os: Faulting instruction address (r15/pc): 0x00000000
    [00:00:05.413,238] <err> os: >>> ZEPHYR FATAL ERROR 38: Unknown error on CPU 0
    [00:00:05.413,299] <err> os: Current thread: 0x2000d0b0 (main)
    [00:00:05.501,586] <err> os: Halting system

    I have tried different other CONFIG_xx as shown initially, but not yet got it working. On the nRF52840DK side it works even with shell enabled. However, in production I am not enabling SHELL on either sides, it is just usefull for debug. Anyway, it would be useful to solve this, for me and for other people.

  • Sorry about the wait Dag,

    I am seeing the same thing on my side. And looking into what you'd need to do here. I'll try to get back to you on that tomorrow.

    I should mention though that this is a zephyr sample (ie not in the nrf repo, and not made by Nordic per se) which means that something might not necessarily work on nRFs by default, but there is typically not much configuration that is needed for it to work.

    Regards,

    Elfving

Related