Hello, I am using nrf52810 and S112 Softdevice.
After initializing uart, use uart close for uart sleep.
Then the uart close will be checked.
I want to make an uart init and bring it back to life.
What is the method?
Thank you.
Hello, I am using nrf52810 and S112 Softdevice.
After initializing uart, use uart close for uart sleep.
Then the uart close will be checked.
I want to make an uart init and bring it back to life.
What is the method?
Thank you.
Hi,
It is a bit unclear what you are trying to do here. Which library/driver or driver are you using to close the UART after a transaction? You do not need to reinit the UART between transactions, so I am bit confused why you intend to uninit the UART? There should be a need to reinit between transactions.
Hi,
I cut off uart communication using "app_uart_close()" provided by libraries / uart.
I want the action to disconnect the uart and reconnect it.
Thank you
Then use the same app_uart_init() function to reinit the same way the uart was initialized the first time.
PUBLIC void uart_init(void)
{
U32 err_code;
UART_CONFIG_t* p_uart = get_uart_config();
app_uart_comm_params_t const comm_params =
{
.rx_pin_no = p_uart->RX_pin_no,
.tx_pin_no = p_uart->TX_pin_no,
.rts_pin_no = p_uart->RTS_pin_no,
.cts_pin_no = p_uart->CTS_pin_no,
.flow_control = p_uart->FlowCtrl,
.use_parity = p_uart->ParityBit,
.baud_rate = p_uart->BaudRate
};
APP_UART_FIFO_INIT(&comm_params,
UART_RX_BUF_SIZE,
UART_TX_BUF_SIZE,
uart_event_handle,
APP_IRQ_PRIORITY_LOWEST,
err_code);
APP_ERROR_CHECK(err_code);
}
This is my uart init code.
I can't come back to life if I initialize again.
I see, What error do you get when you call the uart_init the second time? You should be able to start your application in the debugger and be able to see which function fails the second time.
I think the app_uart_FIFO helper macros are not designed to aid the re-initialization part, if this is the case then we need to edit the helper macros to make them work with the reinitialization.
Can you please provide me exactly where the call for unit_init fails? and what error does app_uart_init gives when it called the second time during the reinit process?
I see, What error do you get when you call the uart_init the second time? You should be able to start your application in the debugger and be able to see which function fails the second time.
I think the app_uart_FIFO helper macros are not designed to aid the re-initialization part, if this is the case then we need to edit the helper macros to make them work with the reinitialization.
Can you please provide me exactly where the call for unit_init fails? and what error does app_uart_init gives when it called the second time during the reinit process?
1.app_uart_close()
2. nrf_drv_uart_uninit(&app_uart_inst);
3. We don't know what the nrf_drv_uart_uninit is doing after that.
-> "stopped by vector catch" occurs and does not know where it is going.
I don't know what to modify in app_uart_FIFO.....
I solved it. Thank you.
Could you please let us know how you solved it after the vector catch so that others can be helped when they come across this thread?