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

BLE 5 transmiter/receiver examples nRFF52840

I would like to implement Bluetooth 5 packet exchange without the softdevice.

How can we convert the nRF5_SDK\examples\peripheral\radio\receiver nRF5_SDK\examples\peripheral\radio\transmitter examples to Bluetooth 5?

I changed the following lines but had no success:

NRF_RADIO->MODE = (RADIO_MODE_MODE_Ble_LR125Kbit << RADIO_MODE_MODE_Pos); NRF_RADIO->PCNF0 = (3UL << RADIO_PCNF0_PLEN_Pos) | //BLE5 preamble (PACKET_S1_FIELD_SIZE << RADIO_PCNF0_S1LEN_Pos) | (PACKET_S0_FIELD_SIZE << RADIO_PCNF0_S0LEN_Pos) | (PACKET_LENGTH_FIELD_SIZE << RADIO_PCNF0_LFLEN_Pos);

The transmitter transmits something but the receiver does not get any events. Not even EVENTS_ADDRESS

Could you please let us know how to do this or provide us with examples?

Parents
  • Hi,

    These are the changes you need to do to make it work in BLE Long Range mode:

    #define PACKET_BASE_ADDRESS_LENGTH  (3UL)
    ...
    #define PACKET_S1_FIELD_SIZE      (1UL)
    #define PACKET_S0_FIELD_SIZE      (2UL)
    #define PACKET_LENGTH_FIELD_SIZE  (8UL)
    ...
    NRF_RADIO->MODE      = (RADIO_MODE_MODE_Ble_LR125Kbit << RADIO_MODE_MODE_Pos);
    ...
    uint32_t preamble_mask =	(RADIO_PCNF0_PLEN_LongRange << RADIO_PCNF0_PLEN_Pos) |
    							(2                          << RADIO_PCNF0_CILEN_Pos) |
    							(3                          << RADIO_PCNF0_TERMLEN_Pos);
    
    NRF_RADIO->PCNF0 = (PACKET_S1_FIELD_SIZE     << RADIO_PCNF0_S1LEN_Pos) |
                       (PACKET_S0_FIELD_SIZE     << RADIO_PCNF0_S0LEN_Pos) |
                       (PACKET_LENGTH_FIELD_SIZE << RADIO_PCNF0_LFLEN_Pos) |
    				   preamble_mask;
    ...
    NRF_RADIO->CRCCNF = (RADIO_CRCCNF_SKIPADDR_Skip    << RADIO_CRCCNF_SKIPADDR_Pos) |
    					(RADIO_CRCCNF_LEN_Three        << RADIO_CRCCNF_LEN_Pos);
    

    Ole

Reply
  • Hi,

    These are the changes you need to do to make it work in BLE Long Range mode:

    #define PACKET_BASE_ADDRESS_LENGTH  (3UL)
    ...
    #define PACKET_S1_FIELD_SIZE      (1UL)
    #define PACKET_S0_FIELD_SIZE      (2UL)
    #define PACKET_LENGTH_FIELD_SIZE  (8UL)
    ...
    NRF_RADIO->MODE      = (RADIO_MODE_MODE_Ble_LR125Kbit << RADIO_MODE_MODE_Pos);
    ...
    uint32_t preamble_mask =	(RADIO_PCNF0_PLEN_LongRange << RADIO_PCNF0_PLEN_Pos) |
    							(2                          << RADIO_PCNF0_CILEN_Pos) |
    							(3                          << RADIO_PCNF0_TERMLEN_Pos);
    
    NRF_RADIO->PCNF0 = (PACKET_S1_FIELD_SIZE     << RADIO_PCNF0_S1LEN_Pos) |
                       (PACKET_S0_FIELD_SIZE     << RADIO_PCNF0_S0LEN_Pos) |
                       (PACKET_LENGTH_FIELD_SIZE << RADIO_PCNF0_LFLEN_Pos) |
    				   preamble_mask;
    ...
    NRF_RADIO->CRCCNF = (RADIO_CRCCNF_SKIPADDR_Skip    << RADIO_CRCCNF_SKIPADDR_Pos) |
    					(RADIO_CRCCNF_LEN_Three        << RADIO_CRCCNF_LEN_Pos);
    

    Ole

Children
Related