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,
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
Hello,
sunnyyang said:The peripheral_uart use uart_rx_enable to enable uart.
But did you check what uart_rx_enable does? It uses the uarte_nrfx_init() inside uart_nrfx_uarte.c found in ncs\zephyr\drivers\serial\uart_nrfx_uarte.c.
sunnyyang said:But I must use path \zephyr\samples\bluetooth to create my project
What do you mean by this? And why must you use this folder?
Best regards,
Edvin
Because my original project referred to peripheral path in \zephyr\samples\bluetooth.My other functions have been finished.
Ok, so take the UART related configs from the prj.conf in SDK\nrf\samples\bluetooth\peripheral_uart and add them to your prj.conf, and then initialize the UART like it is done in the peripheral_uart sample in your own main.c file.
BR,
Edvin
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