ESB payloads are wrong when using length 252 packets

I am using ESB with dynamic payload lengths. When I use length 252, I am sending the alphabet repeating, and I can see that the data cuts off around position 30 and repeats itself from the start in my payloads on receive. However, when I use size 32 packets, which is the default max size that is supposed to be able to be configured up to 252, everything is fine. What could be the reason that my received payloads are erroneous when I use larger packets? I am sending between a NRF52832 and a NRF52840.

Parents
  • Maybe you need to add CONFIG_ESB_MAX_PAYLOAD_LENGTH=252 to the prj.conf file in the project root directory.

  • I confirmed in my generated build/zephyr/.config file that it is 252. I also know that it's the case because the packets I am receiving do indeed have length 252 payloads, but they just sort of seemingly repeat the first 30-32 bytes. Have you confirmed that length 252 payloads do work with DPL mode?

  • How does your payload look like ?

    Example payload:

    static struct esb_payload tx_payload = ESB_CREATE_PAYLOAD(0,
    	0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17);

  • static nrf_esb_payload_t tx_payload = { .pipe = 0, .noack = false, };

    Then I am setting length and writing to data with memcpy manually before doing nrf_esb_write_payload() later on. I am writing my payloads in my ESB event handler. Note that I confirmed that this works perfectly as long as I use length and data of size 32. If I uses 252, I encounter weird behavior. Would you like me to provide an example say length 50 payload, what I'm sending and what I receive?

    Edit: I created an example for you.

    From this payload (off the static definition above, note that DATA is 0x01)

    tx_payload.data[0] = DATA;
    tx_payload.length = 51;
    uint8_t arr[50] = { '0', '0', '-', '0', '1', '-', '0', '2', '-', '0', '3', '-', '0', '4', '-', '0', '5', '-', '0', '6', '-', '0', '7', '-', '0', '8', '-', '0', '9', '-', '0', 'a', '-', '0', 'b', '-', '0', 'c', '-', '0', 'd', '-', '0', 'e', '-', '0', 'd', '-' };
    memcpy(&tx_payload.data[1], arr, 50);
    result_value = nrf_esb_write_payload(&tx_payload);
    

    I receive:

    Note that on the transmitter I have the latest NRF52 SDK and on the receiver I am using the Nordic Connect SDK. I checked their libraries, and they function equivalently, so it should not be a problem.

    It appears actually that data becomes erroneous and somewhat repeats with null bytes in-between exactly from byte 32. But I am using two NRF52 devices, so they definitely should support length 252 payloads.

  • Note that I just tested a sample application (using the same data as my other reply) between a NRF52840 PDK and a NRF52840 DK with the Nordic Connect SDK, and the data transfers fine. So the problem is either between a NRF52832 and a NRF52840, or between the NRF52 SDK and the Nordic Connect SDK.

Reply Children
No Data
Related