software:nRF CONNECT SDK 1.6.1
CPU type:nrf5340
module:uarte
hi professor,
I want to trigger receiving interrupt when receiving timeout.I see the product specification there are rxto event in nrf5340.Do you have any example code for me?
software:nRF CONNECT SDK 1.6.1
CPU type:nrf5340
module:uarte
hi professor,
I want to trigger receiving interrupt when receiving timeout.I see the product specification there are rxto event in nrf5340.Do you have any example code for me?
Hello,
I don't think we have any example code showing you how to use the RXTO event directly, but it also doesn't do what you describe. The RXTO event is triggered if you use the STOP task register.
From what I understand from your question, you want to receive a buffer after a certain time, perhaps from the first byte. Is that correct? If so, you can look into the peripheral_uart sample found in NCS\nrf\samples\bluetooth\peripheral_uart.
In this sample, you will get a callback when the UART receives some bytes, and then stops. After a given amount of time, the UART will trigger a callback with all the bytes received before the timeout.
Best regards,
Edvin
hi professor,
I have uesd peripherl_uart example to test and it can meet my needs. But I must use path \zephyr\samples\bluetooth to create my project.Do you have any other suggestions
hi professor,
There are fault during interrupt handling when I run uart_rx_enable.I have merged SDK\nrf\samples\bluetooth\peripheral_uart\prj.conf to my project.
Try to use the tool arm-none-eabi-addr2line to look up what function that is on your R14/lr address. It should point to the line reporting the usage fault. It looks like it is in the main thread.
Remember that re-compiling your project may change the build and what functions that are placed here, so remember to use the R14 address from your log from your latest build.
What function does it point to?
BR,
Edvin
hi profess,
I re-compiling my project and run arm-none-eabi-addr2line.It's point to rx_done_event.
Ok, I don't have NCS v1.6.1. What does nrfx_uarte.c line 568 look like?
The reason is p_cb-<handle is NULL.
The reason is p_cb-<handle is NULL.
Ok, so you are trying to trigger a callback at NULL, then. Why is it NULL? Did you not set up a handler when you initialized the UART?
BR,
Edvin
I have used the uart_callback_set to set call back function.If don't use this function, what should I do?
sunnyyang said:If don't use this function, what should I do?
What do you mean?
I mean I have set callback by uart_callback_set function. But the p_cb-<handle is still NULL.
Do you see the log from your application? What does uart_callback_set() return? Does it return 0 or something else? If you can see your log, you should see it printed
"uart set callback failure"
If it fails, it will print both lines (with your current implementation):
"uart set callback failure."
"uart set callback finished."
Which one is it? And if it fails, what does it fail with?
Try:
printf("uart set callback failure (err = %d)\n", err_code);