Hi,
I am working on establishing an UART connection with Zephyr between NRF5280 and NRF9160 microcontroller (Thingy91 Prototyping board).
The standard uart_poll_out() function works seamlessly with 8 bit char datatype sending messages between both microcontrollers.
The uart_poll_out_u16() function with 16 bit unsigend integer datatype leads to a Bus Fault error (z_arm_exc_spurious).
CONFIG_UART_WIDE_DATA is set to yes, and CONFIG_UART_INTERRUPT_DRIVEN is enabled.
Is 16 bit UART communication with Zephyr currently supported for the Nordic boards or does only 8 bit UART work?

Attached a snippet of the used code and the full code as ZIP file.
/*
* UART communication between nrf52840 and nrf9160
*/
#include <zephyr.h>
#include <sys/printk.h>
#include <drivers/uart.h>
#include <string.h>
static uint8_t uart_buf[1024];
static uint16_t uart_buf_int16[1024];
static struct device *uart_dev;
struct uart_config uart_cfg;
int uart_ret;
int send_data(const uint8_t *buf, size_t size)
{
//printk("size of output_buffer: %d\n", size);
if (size == 0) {
return 0;
}
for(int i = 0; i < size; i++){
//printk("Writing %c on position %d\n", buf[i], i);
uart_poll_out(uart_dev, buf[i]);
}
return 0;
}
void uart_cb(struct device *x)
{
uart_irq_update(x);
int data_length = 0;
if (uart_irq_rx_ready(x)) {
data_length = uart_fifo_read(x, uart_buf, sizeof(uart_buf));
uart_buf[data_length] = 0;
}
printk("%s", uart_buf);
}
int send_data_int16(uint16_t *buf, size_t size)
{
if (size == 0) {
return 0;
}
for(int i = 0; i < size; i++){
uart_poll_out_u16(uart_dev, 1);
}
return 0;
}
void uart_cb_int16(struct device *x)
{
uart_irq_update(x);
int data_length = 0;
if (uart_irq_rx_ready(x)) {
data_length = uart_fifo_read_u16(x, uart_buf_int16, sizeof(uart_buf_int16));
}
for(int i = 0; i < data_length; i++){
printk("%d", uart_buf_int16[i]);
}
}
void main(void)
{
/*
* UART communication between nrf52840 and nrf9160
*/
uart_dev = device_get_binding("UART_0");
if (!uart_dev) {
printk("Could not get UART\n");
}
uart_ret = uart_config_get(uart_dev, &uart_cfg);
uart_cfg.baudrate = 1000000;
uart_cfg.parity = UART_CFG_PARITY_NONE;
uart_cfg.stop_bits = UART_CFG_STOP_BITS_1;
uart_cfg.data_bits = UART_CFG_DATA_BITS_8;
uart_cfg.flow_ctrl = UART_CFG_FLOW_CTRL_RTS_CTS;
uart_ret = uart_configure(uart_dev, &uart_cfg);
uart_irq_callback_set(uart_dev, uart_cb_int16);
uart_irq_rx_enable(uart_dev);
//printk("UART 9160 start!\n");
char hey[] = "hey from 9160 \n";
uint16_t hey_int16[] = {1000, 1000, 9160, 9160};
while(1){
//send_data(hey, sizeof(hey));
send_data_int16(hey_int16, sizeof(hey_int16) / sizeof(uint16_t));
k_sleep(K_MSEC(1000));
}
}connectivity_bridge.zip