Hello,
I've seen some posts mentioning a problem with the UART missing bytes on the RX, potentially at higher baudrates. I'm communicating with a module that uses a 921600 baudrate, and using SDK 3.1.0 . I was using the nRF52840, which had the same problem, but it was fixed with by following this post:
RE: Bug in nRF UARTE driver, async Rx buffer handling
I've switched over to the nRF5340, and experiencing the same problem even with the fix from before. I've tried changing pins, changing the timer that is used, also removing the "fix", and testing if it works, however packets are still missed on the rx.
My prj.conf file:
CONFIG_GPIO=y CONFIG_SERIAL=y CONFIG_UART_ASYNC_API=y CONFIG_CRC=y CONFIG_RING_BUFFER=y CONFIG_PRINTK=y CONFIG_UART_CONSOLE=y # Watchdog timer CONFIG_WDT_LOG_LEVEL_DBG=y CONFIG_WATCHDOG=y CONFIG_WDT_DISABLE_AT_BOOT=n # Fix for RFID UART missing packets CONFIG_UART_1_ASYNC=y CONFIG_UART_1_INTERRUPT_DRIVEN=n CONFIG_UART_1_NRF_HW_ASYNC=y CONFIG_UART_1_NRF_HW_ASYNC_TIMER=3 CONFIG_NRFX_TIMER3=y # Boot ## Don't include this as this will send to the rfid chip and confuse it CONFIG_NCS_BOOT_BANNER=n CONFIG_BOOT_BANNER=n CONFIG_BOOT_DELAY=0 # Increase stack size for the main thread and System Workqueue CONFIG_MAIN_STACK_SIZE=4096 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 # Bluetooth LE CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="xyz" # Bluetooth Services CONFIG_BT_BAS=y # Battery Service
My overlay file:
&uart0 {
current-speed = <115200>;
};
&uart1 {
status = "okay";
current-speed = <921600>;
};
&uart1_default {
group2 {
psels = <NRF_PSEL(UART_TX, 1, 0)>;
};
group1 {
psels = <NRF_PSEL(UART_RX, 1, 1)>;
};
};
&uart1_sleep {
group1 {
psels = <NRF_PSEL(UART_RX, 1, 0)>, <NRF_PSEL(UART_TX, 1, 1)>;
};
};