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

nRF52840 custom board does not advertise

I have a custom board using nRF52840.  Some boards return success from sd_ble_gap_adv_start but no advertisement is seen in nRF Connect running on a Google Pixel 4 phone.  Of the set of 4 boards I have to work with: 

1 works fine

1 had a defective LF oscillator so failed earlier in the BLE startup.

2 boards return success when I try to start advertising, but no advertisements are seen.

On these 2 boards the firmware seems to run without hitting any assertions or otherwise crashing.

Since one board works, it seems that there must be some hardware difference causing the failure.

What could that cause be?  I think if there was an LF oscillator problem I should not be able to enable the softdevice at all.

Is there any way to query the softdevice about its internal state to confirm that it thinks it is advertising and sending packets?

This failure happens both in our firmware (which uses FreeRTOS) and in the ble_peripheral/ble_app_blinky example (which I modified to work on our board).

Development environment is Segger Embedded Studio and nRF5 SDK v7.2.0

It seems hard to imagine this many failures either deep in the chip (dead radio?) or on the board (for the radio, just the antenna path and the 2 crystal oscillators should affect BLE operation, not that many components, visual inspection looks good.  But then I was a bit surprised to have an LF osc failure, that's just the crystal and 2 load caps, not that much to go wrong.

Any ideas would be welcome, I am pretty much out of things to try.

  • Hello,

    Could it maybe be related to the 32M crystal as one user reported here: https://devzone.nordicsemi.com/f/nordic-q-a/66107/samsung-a-series-not-detecting-nrf52832? The Softdevice has no way of knowing if the HF clock is accurate or not.

    Best regards,

    Vidar

  • Hi Vidar, that's an interesting possibility, we will look into it.  Do you think that if the start advertising call returns success, that means that down in the softdevice it should be busily sending advertisement packets, but that it really has no way of knowing if the radio is working or if the packets are actually going out over the air?  Do you know if there is a case where SD replies success and starts advertising but then gets somehow bumped out of its "advertising" state?  Would registering for "radio events" tell us if something like this happens?  (I saw some reference to registering for radio events, I don't think our firmware currently has that)

  • Ignore this!  I had experimented with different LF clock source settings in sdk_config.h, trying to diagnose why one board would not return from sd_softdevice_enable().. That particular board did have a dead LF crystal, and I got it to return from sd_softdevice_enable by changing NRF_SDH_CLOCK_LF_SRC to NRF_CLOCK_LF_SRC_SYNTH.  But I had left sdk_config,h modfied and apparently that prevents sd_softdevice_enable if the LF crystal oscillator is working.

    I have another interesting data point.  I am pretty sure that at one point I had this board advertising successfully using ble_app_blinky modified to work with my board.  But last time I tried it that did not advertise either.  I decided to try another example, app_beacon.  I modified that example to work with my board, and app_beacon does advertise.  This is starting to seem like some kind of random startup issue.  Does the nRF52840 start up with RC oscillator then switch to xtal?  What if the xtal sometimes did not start, so it remained running from RC.   Could that show up as not advertising?  (Opposed to this scenario, one of my hardware guys examined both LF and HF oscillators on a board that doesn't advertise, and they both seemed to be running fine)

  • Thanks for the update! So it is not working with NRF_CLOCK_LF_SRC_SYNTH? NRF_CLOCK_LF_SRC_SYNTH relies on the HFXO (32MHz crystal) so maybe the HF crystal is not starting at all.

    Could you try to see if you are able to start the HFXO at the beginning of main() as shown in the snippet below?

        NRF_CLOCK->TASKS_HFCLKSTART = 1;
        /* Wait until the crystal oscillator has started */
        while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
          {};
        

    You may also try the RSSI Viewer app in nRF connect for desktop to check if the RADIO is transmitting anything if you have a nordic dev kit or dongle laying around.

Related