Some problems about softdevice

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

Parents
  • Sometimes success, sometimes failure

    I would like to ask, what is the reason for the failure?

    I assume interference for instance can cause packet loss, and depending on the number of retries you have configured, it may be that it reach max retries and thereby you receive the NRF_ESB_EVENT_TX_FAILED event instead. I assume in this case that you have only one PTX and only one PRX, is that correct? 

    Can you briefly explain nRF sniffer?

    I do not quite understand what you mean here? I am only aware of nRF sniffer for Bluetooth LE, but that one cannot receive packets from ESB. What nRF sniffer are you thinking of?

    Occasionally 1 byte is lost

    How can this problem be avoided?

    Have you looked at the data on an oscilloscope or logic analyzer? Just to check that the bit length of PTX and PRX are the same, possible you can try lower baudrate and see if that have an impact on the issue.

    Best regards,
    Kenneth

  • Hello, thank you for your relpy

    1) 

    Yes, now the test case is only one PTX and one PRX

    But when the product is applied in the future, it will be one PTX and multiple PRX

    And each PRX will also have PTX function, like Bluetooth Mesh

    I will also study the Bluetooth Mesh part in the future

    I will use these two technologies on different products

    2)

    Like《nRF Sniffer for Bluetooth LE》《nRF Sniffer for 802.15.4》

    Does the ESB have its own sniffer?

    3)

    You're right, I'm wondering if my "USB->TTL" is wrong

    I will check this part, thank you 

Reply
  • Hello, thank you for your relpy

    1) 

    Yes, now the test case is only one PTX and one PRX

    But when the product is applied in the future, it will be one PTX and multiple PRX

    And each PRX will also have PTX function, like Bluetooth Mesh

    I will also study the Bluetooth Mesh part in the future

    I will use these two technologies on different products

    2)

    Like《nRF Sniffer for Bluetooth LE》《nRF Sniffer for 802.15.4》

    Does the ESB have its own sniffer?

    3)

    You're right, I'm wondering if my "USB->TTL" is wrong

    I will check this part, thank you 

Children
  • eric_cheng said:
    But when the product is applied in the future, it will be one PTX and multiple PRX

    In that case you should look into disabling acknowledgement, else each PRX will try to ack, and that won't work well. I believe disabling ack is done by configuring selective_ack and using noack for all communication.

    eric_cheng said:
    Does the ESB have its own sniffer?

    No, there is no fixed address for ESB, so it's not possible to make a generic sniffer.

    Best regards,
    Kenenth

Related