Having a BUS FAULT while trying to use uart_tx on the NRF5340 with NRFConnect SDK. Based on the peripheral_uart sample project. Any ideas what may be causing it?
Heres the error message:
[00:00:00.405,456] [0m<inf> peripheral_uart: Uart initialized[0m [00:00:00.605,529] [0m<inf> peripheral_uart: Calibrating[0m [00:00:01.681,335] [1;31m<err> os: ***** BUS FAULT *****[0m [00:00:01.681,365] [1;31m<err> os: Precise data bus error[0m [00:00:01.681,365] [1;31m<err> os: BFAR Address: 0x14[0m [00:00:01.681,365] [1;31m<err> os: r0/a1: 0x00000014 r1/a2: 0x00000000 r2/a3: 0x20001d30[0m [00:00:01.681,365] [1;31m<err> os: r3/a4: 0x20000fc8 r12/ip: 0x00000000 r14/lr: 0x0000e3a5[0m [00:00:01.681,365] [1;31m<err> os: xpsr: 0x21000018[0m [00:00:01.681,396] [1;31m<err> os: Faulting instruction address (r15/pc): 0x000105f8[0m [00:00:01.681,396] [1;31m<err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0[0m [00:00:01.681,396] [1;31m<err> os: Fault during interrupt handling [0m [00:00:01.681,427] [1;31m<err> os: Current thread: 0x20000fc8 (unknown)[0m [00:00:01.970,367] [1;31m<err> fatal_error: Resetting system[0m [00:00:00.257,812] [0m<inf> peripheral_uart: Initializing ServoMotor
Here is the call to UART_TX
if (uart_tx(uart, tx_data, 15, SYS_FOREVER_MS)){
LOG_WRN("Failed to send data over UART");
}
Here is the overlay file. I created a folder called boards inside the project folder and placed it inside:
/opt/nordic/ncs/v1.5.0-rc1/nrf/samples/bluetooth/peripheral_uart/boards/nrf5340dk_nrf5340_cpuapp.overlay
/* SPDX-License-Identifier: Apache-2.0 */
&uart0 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>; //<115200>;
status = "okay";
tx-pin = <10>;
rx-pin = <11>;
};