uart_tx api crashing issue

Hi, All

I try to modify the central uart example - mainly focus on uart function instead of BLE, I try to send a message back to uart use uart_tx() api instead of printk(), it seems working fine like this

 
    struct uart_data_t *buf = k_fifo_get(&fifo_uart_rx_data, K_FOREVER);
    
    if (uart_tx(uart, buf->data, buf->len, SYS_FOREVER_MS)) {
		LOG_WRN("Failed to send data over UART");
	}
	else {
		LOG_WRN("send data back to UART");
	}

But when I try to replace the uart_tx function with some message like below, and it keep crashing - reset

   
	uart_tx(uart, "UartDataRxed\n", 13, SYS_FOREVER_MS);
I wonder what I have done wrong with above, here is the RTT log message:
0> [00:00:00.025,787] <err> os: ***** BUS FAULT *****
00> [00:00:00.025,787] <err> os: Precise data bus error
00> [00:00:00.025,787] <err> os: BFAR Address: 0x2528206c[0m
00> [00:00:00.025,817] <err> os: r0/a1: 0x2528206c r1/a2: 0x00027b50 r2/a3: 0x20002300
00> [00:00:00.025,817] <err> os: r3/a4: 0x00000040 r12/ip: 0x00000000 r14/lr: 0x0001e533
00> [00:00:00.025,817] <err> os: xpsr: 0x21000012
00> [00:00:00.025,817] <err> os: Faulting instruction address (r15/pc): 0x0001e820
00> [00:00:00.025,848] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
00> [00:00:00.025,848] <err> os: Fault during interrupt handling
Thanks for your help!
Ping
Parents Reply Children
No Data
Related