This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BUS fault NRF5340

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] <inf> peripheral_uart: Uart initialized
[00:00:00.605,529] <inf> peripheral_uart: Calibrating
[00:00:01.681,335] <err> os: ***** BUS FAULT *****
[00:00:01.681,365] <err> os:   Precise data bus error
[00:00:01.681,365] <err> os:   BFAR Address: 0x14
[00:00:01.681,365] <err> os: r0/a1:  0x00000014  r1/a2:  0x00000000  r2/a3:  0x20001d30
[00:00:01.681,365] <err> os: r3/a4:  0x20000fc8 r12/ip:  0x00000000 r14/lr:  0x0000e3a5
[00:00:01.681,365] <err> os:  xpsr:  0x21000018
[00:00:01.681,396] <err> os: Faulting instruction address (r15/pc): 0x000105f8
[00:00:01.681,396] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:01.681,396] <err> os: Fault during interrupt handling

[00:00:01.681,427] <err> os: Current thread: 0x20000fc8 (unknown)
[00:00:01.970,367] <err> fatal_error: Resetting system
[00:00:00.257,812] <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>;
};

Related