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

BLE packet endianess in S140 is not updated

Hi,

I try to change the endianess of transmitted data  from Little Endian to Big Endian.

So for example when I  want to transmit a value uint32_t valueTx = 0xAABBCCDD 

the received value on smartphone to be 0xAABBCCDD and not 0xDDCCBBAA

To do that I updated the ENDIAN bit in PCNF1 register like this

NRF_RADIO->PCNF1 = RADIO_PCNF1_ENDIAN_Big << RADIO_PCNF1_ENDIAN_Pos;

But when I run the code the endianess is still the same (little).

What m I doing wrong here?

Thanks

  • Hi,

     Bytes of the payload are transmitted in the order they reside in memory and you cannot change that. That is the byte order is always little endian (LSByte first), while bit order depends on PCNF1?

     

    NRF_RADIO->PCNF1 = RADIO_PCNF1_ENDIAN_Big << RADIO_PCNF1_ENDIAN_Pos;

    But when I run the code the endianess is still the same (little).

    The PCNF1 configuration will only change the endianness of the bit order and not the byteorder.

Related