This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52 inv-ESB receive 0 length packets

hi,i have met some strange problem about inv-esb

i send 21 length packets in peripheral(i use rx as peripheral,use tx ascenter),but ireceive 0 length packets in center.

i printf the length of send packets in  tx-end-event of peripheral,such as this example:

it is in RADIO_IRQHandler():

if (NRF_RADIO->EVENTS_END && (NRF_RADIO->INTENSET & RADIO_INTENSET_END_Msk))

{

NRF_LOG_INFO("m_rx_payload_buffer = %d",m_rx_payload_buffer[0]);

}

and it printf "m_rx_payload_buffer  = 21".(this place i use uart to printf log)

but the problem is ,i printf length of receive packet,i get 0 results.such as this example:

it is in on_radio_disabled_tx_wait_for_ack()

NRF_LOG_INFO("length = %d",m_rx_payload_buffer[0]);

and it printf "length = 0"

if i connect peripheral with jlink,and click "connect" in RTT-viewer,it won't happen,i can receive 21 length bytes.

i want to know why this happen ,and why i connect jlink with peripheral then it won't happen,thanks for your answer.

Parents
  • Hi,

     

    Q1: Which device is setup as a PRX and which is setup as a PTX device?

    Is the central the receiver?

     

    Q2: Are you switching between printing over UART and RTT?

    Note that you should use NRF_LOG_DEFERRED set to '1' to avoid printing in interrupt handlers. This requires you to have a added call to "NRF_LOG_PROCESS()" in your main loop.

     

    Q3: What is your configured RF address?

     

    Kind regards,

    Håkon

  • thanks for your replay

    A1:i use PTX as cental,use PRX as peripheral.centeral is a receiver,one centeral corresponds to two peripheral.

    A2: i switch uart or rtt by set NRF_LOG_BACKEND_RTT_ENABLED or NRF_LOG_BACKEND_UART_ENABLED to 1 .while in rtt mode ,i had set NRF_LOG_DEFERRED  to '1',and add "NRF_LOG_PROCESS()"  to main loop.i think it's not the key issue。

    A3:i use pipe 0 for pairing,after finish pairing , i use pipe 1 for data pipe.i will update the prefix1 of central when switch peripherals.

    the problem mabye related to the clock in debug mode? i have no idea.

    note that :if i connect peripheral with jlink,and click "connect" in RTT-viewer,it won't happen,central can receive 21 length bytes. if don't connect jlink ,it would happened.

  • Hi,

     

    Liny said:
    i use PTX as cental,use PRX as peripheral.centeral is a receiver,one centeral corresponds to two peripheral.

    Is the PRX devices setup with different RF channels?

    If not, both of them will ACK at the same time and that will create issues.

     

    Liny said:

    A3:i use pipe 0 for pairing,after finish pairing , i use pipe 1 for data pipe.i will update the prefix1 of central when switch peripherals.

    the problem mabye related to the clock in debug mode? i have no idea.

    What is the actual RF address set? 0xE7E7E7E7 ?

     

    Kind regards,

    Håkon 

  • hi Hanon Alseth,

    i have found the problem .

    the reason is  when i send packets in periphral,  i add some code in on_radio_disabled_rx(), it takes more than 40 us (in radio fast mode,disable - tx raedy takes 40.25us ),it cause RADIO->PTR updated after tx-ready came。so ,although m_tx_payload_buffer[0] = 21, but NRF_PTR may not point m_tx_payload_buffer?(want your explain)。

    i have a questions:

    Q:does RADIO->PTR register  locked after tx—ready came?if not ,why?

Reply
  • hi Hanon Alseth,

    i have found the problem .

    the reason is  when i send packets in periphral,  i add some code in on_radio_disabled_rx(), it takes more than 40 us (in radio fast mode,disable - tx raedy takes 40.25us ),it cause RADIO->PTR updated after tx-ready came。so ,although m_tx_payload_buffer[0] = 21, but NRF_PTR may not point m_tx_payload_buffer?(want your explain)。

    i have a questions:

    Q:does RADIO->PTR register  locked after tx—ready came?if not ,why?

Children
Related