Implementing UARTE on a Bluetooth Enabled DK (ncs v1.9.1)

Hello,
im trying to implement the UARTE Driver for simultaneous Use of Bluetooth and asynchrounos Uart TX/RX on a nRF52840 and nrf9160.
The Problem is that neither RX or TX works.

While Debugging i realised it Crashes while trying to create the TXEND Event.
Im getting this Error Message.

00> [00:01:08.938,568] <err> os >>> ZEPHYR FATAL ERROR 1: Unhandled interrupt on CPU 0
00> [00:00:16.987,701] <err> os: Current thread: 0x2000c7a0 (unknown)
00> [00:00:16.993,194] [1;31m<err> fatal_error: Resetting system


relevant proj.conf snippet:
#Logging
CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y

CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_RTT_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y

### Peripheral-UART
CONFIG_SERIAL=y
CONFIG_NRFX_UARTE=y
CONFIG_NRFX_UARTE1=y
CONFIG_UART_ASYNC_API=y
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1

### Enable k_malloc/k_free
CONFIG_HEAP_MEM_POOL_SIZE=2048
CONFIG_MAIN_STACK_SIZE=8192


I think it might have something to do with missing KConfig Options

Any possible Solutions or Ideas would be greatly appreceated

Parents
  • Hello,

    Sorry for this mess of a Help Request.

    The build from the last Error Message was the nrf52840 Build.
    That Error Message occurs when i use the KCONFIG Option

    CONFIG_UART_ASYNC_API=y
    CONFIG_UART_1_NRF_HW_ASYNC=y
    CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1

    and

    CONFIG_NRFX_UARTE=y

    together. I do not know why


    I have rewritten the Applications.

    For the nrf52840 i use

    build target is nrf52840dk_nrf52840

    IRQ_DIRECT_CONNECT(UARTE1_IRQn, 0, uart_event_handler, 0);

    For the nrf9160 i use

    build target is nrf9160dk_nrf9160_ns

    IRQ_DIRECT_CONNECT(UARTE1_SPIM1_SPIS1_TWIM1_TWIS1_IRQn, 0, uart_event_handler, 0);

    I tried tx and rx with both devices neither complete either task.
    For the nrf52:

    It "completes" the tx but repeatedly calls the uart_event_handler with a unknown event code

    00> [00:00:00.378,448] <inf> main: All Initialized
    00> [00:00:00.378,753] <inf> app_uart: app_uart_send, length:10
    00> [00:00:00.379,089] <inf> app_uart: Trying to TX
    00> [00:00:00.380,249] <err> app_uart: Unknown Case 8669
    00> [00:00:00.380,584] <err> app_uart: Unknown Case 8669

    For the nrf92:

    It does not complete the Tx and hard crashes with following LOG

    00> [00:00:00.493,865] <inf> main: All Initialized
    00> [00:00:00.494,171] <inf> app_uart: app_uart_send, length:10
    00> [00:00:00.494,537] <inf> app_uart: Trying to TX
    00> [00:00:00.495,727] <err> os: Exception occurred in Secure State
    00> [00:00:00.496,093] <err> os: ***** HARD FAULT *****
    00> [00:00:00.496,398] <err> os:   Fault escalation (see below)
    00> [00:00:00.496,765] <err> os: ***** BUS FAULT *****
    00> [00:00:00.497,070] <err> os:   Precise data bus error
    00> [00:00:00.497,375] <err> os:   BFAR Address: 0x50008158
    00> [00:00:00.497,741] <err> os: r0/a1:  0x00000000  r1/a2:  0x00000000  r2/a3:  0x00000000
    00> [00:00:00.498,199] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0xffffffbc
    00> [00:00:00.498,657] <err> os:  xpsr:  0x01000000
    00> [00:00:00.498,992] <err> os: Faulting instruction address (r15/pc): 0x00010676
    00> [00:00:00.499,420] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
    00> [00:00:00.499,847] <err> os: Current thread: 0x2000c6b8 (unknown)

    If you need any other Details. Please let me know

    Also i dont know why but i cant reply to some of your replies.

    Regards

    Nick

Reply
  • Hello,

    Sorry for this mess of a Help Request.

    The build from the last Error Message was the nrf52840 Build.
    That Error Message occurs when i use the KCONFIG Option

    CONFIG_UART_ASYNC_API=y
    CONFIG_UART_1_NRF_HW_ASYNC=y
    CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1

    and

    CONFIG_NRFX_UARTE=y

    together. I do not know why


    I have rewritten the Applications.

    For the nrf52840 i use

    build target is nrf52840dk_nrf52840

    IRQ_DIRECT_CONNECT(UARTE1_IRQn, 0, uart_event_handler, 0);

    For the nrf9160 i use

    build target is nrf9160dk_nrf9160_ns

    IRQ_DIRECT_CONNECT(UARTE1_SPIM1_SPIS1_TWIM1_TWIS1_IRQn, 0, uart_event_handler, 0);

    I tried tx and rx with both devices neither complete either task.
    For the nrf52:

    It "completes" the tx but repeatedly calls the uart_event_handler with a unknown event code

    00> [00:00:00.378,448] <inf> main: All Initialized
    00> [00:00:00.378,753] <inf> app_uart: app_uart_send, length:10
    00> [00:00:00.379,089] <inf> app_uart: Trying to TX
    00> [00:00:00.380,249] <err> app_uart: Unknown Case 8669
    00> [00:00:00.380,584] <err> app_uart: Unknown Case 8669

    For the nrf92:

    It does not complete the Tx and hard crashes with following LOG

    00> [00:00:00.493,865] <inf> main: All Initialized
    00> [00:00:00.494,171] <inf> app_uart: app_uart_send, length:10
    00> [00:00:00.494,537] <inf> app_uart: Trying to TX
    00> [00:00:00.495,727] <err> os: Exception occurred in Secure State
    00> [00:00:00.496,093] <err> os: ***** HARD FAULT *****
    00> [00:00:00.496,398] <err> os:   Fault escalation (see below)
    00> [00:00:00.496,765] <err> os: ***** BUS FAULT *****
    00> [00:00:00.497,070] <err> os:   Precise data bus error
    00> [00:00:00.497,375] <err> os:   BFAR Address: 0x50008158
    00> [00:00:00.497,741] <err> os: r0/a1:  0x00000000  r1/a2:  0x00000000  r2/a3:  0x00000000
    00> [00:00:00.498,199] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0xffffffbc
    00> [00:00:00.498,657] <err> os:  xpsr:  0x01000000
    00> [00:00:00.498,992] <err> os: Faulting instruction address (r15/pc): 0x00010676
    00> [00:00:00.499,420] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
    00> [00:00:00.499,847] <err> os: Current thread: 0x2000c6b8 (unknown)

    If you need any other Details. Please let me know

    Also i dont know why but i cant reply to some of your replies.

    Regards

    Nick

Children
Related