SECURE FAULT when trying to use uart1 on nrf9160dk

Hi, I'm building an application that will use the nrf9160 as a middle man for a websocket connection that becomes a uart connection on the main processor. Thus I want to receive messages on uart1 and send them to the websocket, and then receive messages on the websocket and send them to uart1. I want to still have full debug capabilities on the virtual com port over usb, so that's why I'm not trying to use uart0. 

When I'm calling a uart function like uart_rx_enable / uart_tx, I get a runtime error that looks like this:

[00:00:00.384,674] <err> lte_app: Cannot set UART callback (err -88)
[00:00:00.387,756] <err> os: ***** SECURE FAULT *****
[00:00:00.387,756] <err> os: Invalid entry point
[00:00:00.387,786] <err> os: r0/a1: 0x0002afd0 r1/a2: 0x20011758 r2/a3: 0x00000200
[00:00:00.387,786] <err> os: r3/a4: 0x00000064 r12/ip: 0x00000000 r14/lr: 0x0000a233
[00:00:00.387,786] <err> os: xpsr: 0x20000000
[00:00:00.387,817] <err> os: Faulting instruction address (r15/pc): 0x00000000
[00:00:00.387,847] <err> os: >>> ZEPHYR FATAL ERROR 38: Unknown error on CPU 0
[00:00:00.387,878] <err> os: Current thread: 0x2000ea08 (unknown)
[00:00:00.482,940] <err> os: Halting system

The uart hardware seems to be correctly initialized as indicated by testing for readyness and printing uart device name:
<dbg> lte_app: main: UART device uart@9000 is ready 

I'm on SDK v2.7.0
My board is set to: nrf910dk/nrf9160/ns


here is my config: 

# General
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_MAIN_STACK_SIZE=4096

# Logging
CONFIG_LOG=y
CONFIG_MODEM=y
CONFIG_MODEM_LOG_LEVEL_DBG=y
CONFIG_NET_LOG=y
CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y
# CONFIG_NET_HTTP_LOG_LEVEL_DBG=y # http request dumps
CONFIG_NET_WEBSOCKET_LOG_LEVEL_DBG=y
CONFIG_NET_CONTEXT_LOG_LEVEL_DBG=y
CONFIG_NET_TCP_LOG_LEVEL_DBG=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_TCP=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_IPV4=y
CONFIG_NET_CONNECTION_MANAGER=y
CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024
CONFIG_NET_BUF_DATA_SIZE=4096
CONFIG_LOG_BUFFER_SIZE=6000

# Websocket
CONFIG_WEBSOCKET_CLIENT=y
CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_WEBSOCKET=y
CONFIG_MBEDTLS_SHA1_C=y

# UART
CONFIG_UART_ASYNC_API=y

Parents
  • I should add that my overlay looks like this:

    &pinctrl {
        uart1_default_alt: uart1_default_alt {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 18)>,
                    <NRF_PSEL(UART_RX, 0, 17)>,
                    <NRF_PSEL(UART_RTS, 0, 21)>,
                    <NRF_PSEL(UART_CTS, 0, 19)>;
            };
        };

        uart1_sleep_alt: uart1_sleep_alt {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 18)>,
                    <NRF_PSEL(UART_RX, 0, 17)>,
                    <NRF_PSEL(UART_RTS, 0, 21)>,
                    <NRF_PSEL(UART_CTS, 0, 19)>;
                low-power-enable;
            };
        };
    };

    &uart1 {
        status = "okay";
        current-speed = <115200>;
        pinctrl-0 = <&uart1_default_alt>;
        pinctrl-1 = <&uart1_sleep_alt>;
        pinctrl-names = "default", "sleep";
    };
Reply
  • I should add that my overlay looks like this:

    &pinctrl {
        uart1_default_alt: uart1_default_alt {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 18)>,
                    <NRF_PSEL(UART_RX, 0, 17)>,
                    <NRF_PSEL(UART_RTS, 0, 21)>,
                    <NRF_PSEL(UART_CTS, 0, 19)>;
            };
        };

        uart1_sleep_alt: uart1_sleep_alt {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 18)>,
                    <NRF_PSEL(UART_RX, 0, 17)>,
                    <NRF_PSEL(UART_RTS, 0, 21)>,
                    <NRF_PSEL(UART_CTS, 0, 19)>;
                low-power-enable;
            };
        };
    };

    &uart1 {
        status = "okay";
        current-speed = <115200>;
        pinctrl-0 = <&uart1_default_alt>;
        pinctrl-1 = <&uart1_sleep_alt>;
        pinctrl-names = "default", "sleep";
    };
Children
No Data
Related