Hello, Nordic Engineer
I use nrf52811 and SDK 15.3.0
In example 《ble_app_uart》, I added timeslot(ESB)
Run this code《nrf_esb_write_payload(&tx_command);》
Subsequent programs will enter this handler
nrf_esb_config.event_handler = nrf_esb_event_handler;
void nrf_esb_event_handler(nrf_esb_evt_t const * p_event)
{
if (p_event->evt_id == NRF_ESB_EVENT_TX_FAILED)
{
NRF_LOG_INFO("ESB TX FAILED");
nrf_esb_flush_tx();
m_state = STATE_RX;
}
if (p_event->evt_id == NRF_ESB_EVENT_TX_SUCCESS)
{
NRF_LOG_INFO("ESB TX Success");
}
if (p_event->evt_id & NRF_ESB_EVENT_RX_RECEIVED)
{
// Data reception is handled in a lower priority interrup.
// Call UESB_RX_HANDLE_IRQHandler later.
NVIC_SetPendingIRQ(UESB_RX_HANDLE_IRQn);
}
}
Sometimes success, sometimes failure
I would like to ask, what is the reason for the failure?
======================================================
Can you briefly explain nRF sniffer?
Or, can I understand it this way, it can do:
(1) Can prove that the data is indeed sent(ESB data)(NRF_ESB_EVENT_TX_SUCCESS)
(2) Can capture data, for example I send 20 bytes, 0x01 to 0x14, nRF sniffer will show these 20 bytes
======================================================
flow chart:
[nRF52811] -> [USB to TTL] -> [My Computer]
nRF52811 uses USART to send data
But the data displayed by my computer is sometimes not 20 bytes
Occasionally 1 byte is lost
How can this problem be avoided?
Thanks