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

change phy in mesh

I'm working with the nRF52840 PDK and I'm wondering how to change the PHY (preferably to CODED) in a Mesh. Has that been implemented yet? Or when can we expect this feature?

Parents
  • The following modification worked for me:

    1. In advertise.c, set_default_broadcast_configuration() change radio_mode to use RADIO_MODE_NRF_62K5BIT instead of RADIO_MODE_BLE_1MBIT.

    2. In scanner.c, scanner_config_reset() change scanner_config_radio_mode_set() to use RADIO_MODE_NRF_62K5BIT instead of RADIO_MODE_BLE_1MBIT.

    3. In radio_config.c, radio_config_config() add the following code at the end:

       if (p_config->radio_mode==RADIO_MODE_NRF_62K5BIT )
      
       {
        NRF_RADIO->PCNF0 |=(
       
                       ((RADIO_PCNF0_PLEN_LongRange << RADIO_PCNF0_PLEN_Pos) & RADIO_PCNF0_PLEN_Msk) |
                       ((2 << RADIO_PCNF0_CILEN_Pos) & RADIO_PCNF0_CILEN_Msk) |
                       ((3 << RADIO_PCNF0_TERMLEN_Pos) & RADIO_PCNF0_TERMLEN_Msk) );
              
       }
      

    4.In broadcast.c, time_required_to_send_us() add:

        if (radio_mode == RADIO_MODE_NRF_62K5BIT)
        {
            packet_length_in_bytes += RADIO_PREAMBLE_LENGTH_LR_EXTRA_BYTES;
        }
    

    And define RADIO_PREAMBLE_LENGTH_LR_EXTRA_BYTES = 9.

    Change 5th element in radio_mode_to_us_per_byte[] from 128 to 64.

    Let us know if you don't achieve longer range with this patch.

  • I have troubling running the code after making this change. I wasn't able to receive any "mesh complete tx" message after making this change. I've tried increasing the wait time, didn't work either. Has anyone come across similar problems and know how to solve it?

Reply Children
No Data
Related