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.

Reply
  • 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.

Children
Related