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

SDK15.30's esb_prx and esb_ptx can not work properly on my boards

Dear Sir,

I'm using nordic's example codes above to tx and rx, but i can not get them working properly. the LEDs should light on the receiver side according to the example introduction, but not on my case. on the tx side, i can see the tx_payload_data[1] is always 1 without increment. whenever i break the running, the point is always on the SWI0_EGU0_IRQHandler. i've modified nothing but the LED's io assignment per my circuit.

Parents
  • Hello,

    This is not something that I can replicate on a DK, but you probably can't either. If you try to debug the project, is the main loop reached at all?

    I am trying to think of possible reasons, such as whether or not your custom board has an LFXTAL or not (does it?), but I don't think it should matter. This example doesn't use any timers, only nrf_delay_us().

    I assume your custom board has the HFXTAL, as this is required for normal operation (while the LFXTAL is optional).

    What SDK version do you use?

    What does nrf_esb_write_payload() in your main loop return?

    Best regards,

    Edvin

Reply
  • Hello,

    This is not something that I can replicate on a DK, but you probably can't either. If you try to debug the project, is the main loop reached at all?

    I am trying to think of possible reasons, such as whether or not your custom board has an LFXTAL or not (does it?), but I don't think it should matter. This example doesn't use any timers, only nrf_delay_us().

    I assume your custom board has the HFXTAL, as this is required for normal operation (while the LFXTAL is optional).

    What SDK version do you use?

    What does nrf_esb_write_payload() in your main loop return?

    Best regards,

    Edvin

Children
  • Hi Edvin,

    many thanks for your help. the board i'm using can work at Ble, yes, just HFxtal on it. SDK is 15.30. just use SDK's ESB example code, and no modification at all except the io for LED, it seems that the nrf_esb_write_payload() return is sucess because it stops the break point when i set within that if loop

    but tx_payload.data[1] is always 1 and no increament.

  • zcj said:
    and no modification at all except the io for LED

     Do you have any LEDs on your transmitter side? Do they toggle?

     

    zcj said:
    but tx_payload.data[1] is always 1 and no increament.

     Could this be from optimization during debugging? What IDE do you use? Can you try to turn off optimization? 

    Does your main-loop look exactly like this? If not, please let me know what changed.

    while (true)
        {
            NRF_LOG_DEBUG("Transmitting packet %02x", tx_payload.data[1]);
    
            tx_payload.noack = false;
            if (nrf_esb_write_payload(&tx_payload) == NRF_SUCCESS)
            {
                // Toggle one of the LEDs.
                nrf_gpio_pin_write(LED_1, !(tx_payload.data[1]%8>0 && tx_payload.data[1]%8<=4));
                nrf_gpio_pin_write(LED_2, !(tx_payload.data[1]%8>1 && tx_payload.data[1]%8<=5));
                nrf_gpio_pin_write(LED_3, !(tx_payload.data[1]%8>2 && tx_payload.data[1]%8<=6));
                nrf_gpio_pin_write(LED_4, !(tx_payload.data[1]%8>3));
                tx_payload.data[1]++;
            }
            else
            {
                NRF_LOG_WARNING("Sending packet failed");
            }
    
            nrf_delay_us(50000);
        }

Related