I was using sdk 1.9.1 into my project and every things waking prefect which use openthread. I took the same project and build it in latest version ( sdk v2.1.1 ). when I flash it the uart did not work. after some investigation I found that the IRQ callback did not work in this version. I search if someone have same my problem and found this https://devzone.nordicsemi.com/f/nordic-q-a/92008/uart_1-callback-not-being-set/390257 , but the answer did not fix the problem.
what confused me is that the same code work in v1.9.1 sdk but not the latest one. is there something missing or must include in v2.1.1 sdk to enable irq?
prj.conf of uart:
... const struct device *uart_dev; ... static void UART_RxCallback(const struct device *x, void *user_data) { int res; uart_irq_update(x); if (uart_irq_rx_ready(x)) { res = uart_poll_in(x, &rx_buffer.new); if (res != 0) { return; } } } ... void main(){ ... uart_dev = device_get_binding("UART_1"); if (!device_is_ready(uart_dev)) { printf("UART device not found!"); return; } uart_irq_callback_set(uart_dev,UART_RxCallback); uart_irq_rx_enable(uart_dev); ... }