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

Crash enabling softdevice on Fanstel USB840F (based on nrf52840)

All examples included in nrf52SDK 15.2.0 when running on Fanstel USB840F which has a nrf52840 chip, using Segger Embedded Studio and one of PCA10056 or PCA10059.

Using nrf52DK with TagConnect cable attached to USB840F, I managed to debug the code and found the code crashes when calling:

ret_code = sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler);

included in "nrf_sdh.c" at line 214.

I report here the source for covenience:

 // Notify observers about starting SoftDevice enable process.
    sdh_state_observer_notify(NRF_SDH_EVT_STATE_ENABLE_PREPARE);

    nrf_clock_lf_cfg_t const clock_lf_cfg =
    {
        .source       = NRF_SDH_CLOCK_LF_SRC,
        .rc_ctiv      = NRF_SDH_CLOCK_LF_RC_CTIV,
        .rc_temp_ctiv = NRF_SDH_CLOCK_LF_RC_TEMP_CTIV,
        .accuracy     = NRF_SDH_CLOCK_LF_ACCURACY
    };

    CRITICAL_REGION_ENTER();
#ifdef ANT_LICENSE_KEY
    ret_code = sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler, ANT_LICENSE_KEY);
#else
    ret_code = sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler);
#endif
    m_nrf_sdh_enabled = (ret_code == NRF_SUCCESS);
    CRITICAL_REGION_EXIT();

    if (ret_code != NRF_SUCCESS)
    {
        return ret_code;
    }


    m_nrf_sdh_continue  = false;
    m_nrf_sdh_suspended = false;

What could be the issue?

Running the same examples on nrf52840 Dongle and nrf52840DK works well

Thanks in advance!

Parents
  • The USB840F dongle doesn't included 32K crystal.

    Therefore, Please change the clock setting to internal RC.

    nrf_clock_lf_cfg_t const clock_lf_cfg =
    {
    /*
    .source = NRF_SDH_CLOCK_LF_SRC,
    .rc_ctiv = NRF_SDH_CLOCK_LF_RC_CTIV,
    .rc_temp_ctiv = NRF_SDH_CLOCK_LF_RC_TEMP_CTIV,
    .accuracy = NRF_SDH_CLOCK_LF_ACCURACY
    */


    .source = 0,
    .rc_ctiv = 16,
    .rc_temp_ctiv = 2,
    .accuracy = 7

    };

  • Ok, thank you!! Bluetooth works great now!

    I have other two questions:

    1. When I attach it to a powerbank, the powerbank turns the power off after some time (let's say a minute) due to its low power consumption. How can I prevent this from happening?

    Unfortunately two leds+always on bluetooth RX seem to not provide sufficient load.
    Is there an alternative load that I can enable periodically using gpio, to prevent powerbank from cutting power? 
    Do you know alternative solutions to this issue?
    2. I see that it can be flashed via USB too, withouth even opening the enclosure. Can you confirm? Can this be done with custom made firmware withouth the need for any signature, or it can only be done with firmware provided by Fanstel?
Reply
  • Ok, thank you!! Bluetooth works great now!

    I have other two questions:

    1. When I attach it to a powerbank, the powerbank turns the power off after some time (let's say a minute) due to its low power consumption. How can I prevent this from happening?

    Unfortunately two leds+always on bluetooth RX seem to not provide sufficient load.
    Is there an alternative load that I can enable periodically using gpio, to prevent powerbank from cutting power? 
    Do you know alternative solutions to this issue?
    2. I see that it can be flashed via USB too, withouth even opening the enclosure. Can you confirm? Can this be done with custom made firmware withouth the need for any signature, or it can only be done with firmware provided by Fanstel?
Children
Related