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

nrf24l01+: ack payload length > 1 on PRX TX'ed => Same data as first byte RX'ed on PTX.

I have two NRF24L01+ modules - I am not sure if they are fake?

One node acts as PTX and another as PRX.

On both devices i have the features auto_ack and ack_payload enabled.

I can send data between PTX and PRX with no problem.

If i use the PRX ack payload with 1 byte i have no problem in receiving this on PTX. I change the value of the payload with CMD_W_ACK_PAYLOAD command.

if i have a ack payload length > 1 byte, lets say 10 bytes - and change the data with CMD_W_ACK_PAYLOAD on the PRX i get 10 bytes back on PTX.. but all bytes are identical to first byte...

Does this make sense?

Can i read the content of the ack payload on the PRX to verify my data?

Parents
  • @ApaX: I would need to see how you do nrf24_Read_RxPayload

    I attached in my answer above an example. It's for the nRF24LE1 but the radio and the register are the same with nRF24L01. You can compile the example using the nRFGo SDK here.

    I can see that you are expecting 2 bytes from the ack payload ?

  • Thank you for your answer.

    Yes i've changed it from 10 bytes to 2. Just for simplicity. My code is working just fine with one ACK-payload-length. But with more than one ack-payload-length, the first ack payload is copied to the entire length.

    uint8_t nrf24_Read_RxPayload(uint8_t *pBuff, uint8_t Len)
    {
      if (Len > 32)
        Len = 32;
      return nrf24_read(nrf24_SPIx, NRF24_CMD_R_RX_PAYLOAD, pBuff, Len);
    }
    
    
    
    uint8_t nrf24_read(SPI_TypeDef* SPIx, uint8_t Cmd, uint8_t *pBuff, uint8_t Len)
    {
      NRF24_CSN_LOW();
    
    
      uint8_t State = SPI_SendRecvByte(SPIx, Cmd);
    
      SPI_recv8b(SPIx, pBuff, Len);
      
      NRF24_CSN_HIGH();
    
      return State;
    }
    

    General question: Is it possible to have more than one ACK-payload byte sent (as auto response) via. Enhanced ShockBurst?

Reply
  • Thank you for your answer.

    Yes i've changed it from 10 bytes to 2. Just for simplicity. My code is working just fine with one ACK-payload-length. But with more than one ack-payload-length, the first ack payload is copied to the entire length.

    uint8_t nrf24_Read_RxPayload(uint8_t *pBuff, uint8_t Len)
    {
      if (Len > 32)
        Len = 32;
      return nrf24_read(nrf24_SPIx, NRF24_CMD_R_RX_PAYLOAD, pBuff, Len);
    }
    
    
    
    uint8_t nrf24_read(SPI_TypeDef* SPIx, uint8_t Cmd, uint8_t *pBuff, uint8_t Len)
    {
      NRF24_CSN_LOW();
    
    
      uint8_t State = SPI_SendRecvByte(SPIx, Cmd);
    
      SPI_recv8b(SPIx, pBuff, Len);
      
      NRF24_CSN_HIGH();
    
      return State;
    }
    

    General question: Is it possible to have more than one ACK-payload byte sent (as auto response) via. Enhanced ShockBurst?

Children
No Data
Related