Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[Mesh] Decreasing the data rate causes an assert.

Hi team,

I'm using Mesh in my project.
Using this thread as a reference, I tried to decrease the data throughput and experiment to see if devices could communicate with each other even further away.
https://devzone.nordicsemi.com/f/nordic-q-a/29813/change-phy-in-mesh >

In the default state (1M) before the change, the device worked fine.
However, when I flush the device with the changes shown in the thread and make it work with "RADIO_MODE_NRF_62K5BIT", I get a log of assertion.

When I checked the asserted part with addr2line, I saw the line "NRF_MESH_ASSERT (TIMER_OLDER_THAN (time_now, m_end_time));" in "end_handle ()" of "bearer_handler.c".

[Development environment]
・nrf5_SDK_for_Mesh_v4.0.0_src
・nRF5_SDK_16.0.0_98a08e2
・nrf52840 Soc
[Test with]
・nrf5_SDK_for_Mesh_v4.0.0_src\examples\light_switch\server
・nrf5_SDK_for_Mesh_v4.0.0_src\examples\serial


For the sake of review, I'll describe the changes I made by referencing the thread.

1. Changed p_broadcast-> params.radio_config.radio_mode written in set_default_broadcast_configuration () of advertiser.c from "RADIO_MODE_BLE_1MBIT" to "RADIO_MODE_NRF_62K5BIT"
2. Changed the argument of scanner_config_radio_mode_set () written in scanner_config_reset () of scanner.c from "RADIO_MODE_BLE_1MBIT" to "RADIO_MODE_NRF_62K5BIT"
3. Add the following code to the end of radio_config_config () in radio_config.c

    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. Add the following code to time_required_to_send_us () in broadcast.c
    if (radio_mode == RADIO_MODE_NRF_62K5BIT)
    {
        packet_length_in_bytes += RADIO_PREAMBLE_LENGTH_LR_EXTRA_BYTES;
    }


5. Changed the 5th initializer of the radio_mode_to_us_per_byte array declared in time_required_to_send_us () in broadcast.c from "128" to "64"
6. Added the following define to broadcast.c
#define RADIO_PREAMBLE_LENGTH_LR_EXTRA_BYTES 9



Please let me know if there are any other areas that need to be modified to avoid assertion.
Also, if there are any things that I should be concerned about when decreasing the data throughput, (degree of influence on other processing), please let me know as well.

Best regards,
Wataru

Parents Reply Children
No Data
Related