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,
    Do you by chance know which Header to include ?
    VS Code tells me that it cant find "UARTE1_IRQn" and the file you linked to isnt in the 1.9.1 version of the ncs

    Regards,

    Nick

  • Is this when you build for the nRF52840 or the nRF9160? Could you share the entire error log?

  • I accidentally built it for the nrF9160 which explains why it didnt Compile.

    I since changed it to use "UARTE1_SPIM1_SPIS1_TWIM1_TWIS1_IRQn" as it seemed to be the only UARTE related Interrupt but using this crashes the 9160 with this Errorlog

    00> [00:01:08.228,729] <err> os: Exception occurred in Secure State
    00> [00:01:08.229,095] <err> os: ***** HARD FAULT *****
    00> [00:01:08.229,431] <err> os:   Fault escalation (see below)
    00> [00:01:08.229,797] <err> os: ***** BUS FAULT *****
    00> [00:01:08.230,133] <err> os:   Precise data bus error
    00> [00:01:08.230,468] <err> os:   BFAR Address: 0x50008158
    00> [00:01:08.230,834] <err> os: r0/a1:  0x00000000  r1/a2:  0x2000d7f4  r2/a3:  0x00000000
    00> [00:01:08.231,323] <err> os: r3/a4:  0x2000c8fc r12/ip:  0x0000000a r14/lr:  0x000106cf
    00> [00:01:08.231,842] <err> os:  xpsr:  0x61000000
    00> [00:01:08.232,177] <err> os: Faulting instruction address (r15/pc): 0x000106ce
    00> [00:01:08.232,635] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
    00> [00:01:08.233,093] <err> os: Current thread: 0x2000c7a0 (unknown)

    I then tried using the Zephyr Uart Driver on the nRF9160 an the UARTE Driver on the nRF52840.

    The Tx from 52->91 works but the Tx from 91->52 doesnt.

    Also when Tx from 52->91 the Uarte Eventhandler gets called repedeatly with the Eventtype 31.

  • Hi,

    Are you building it from non-secure for the nRF9160? 

    regards

    Jared

Reply Children
Related