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

Custom nrf52832 board only boots right after flashing

I have a custom designed PCB that has the nRF52832 (taiyo yuden EYSHCNZWZ) on board. 

When I flash the board using pogo pins and the jlink (debug out) from a nRF52DK, everything works as expected. However, if I power off the board, and the power it back on, the board does not seem to boot (advertising led not blinking). 

I can't really debug this, as it works normally when the jlink is connected and I can see printfs. 

Any idea on what could be the issue? Thx!

  • I figured out the problem myself. Apparently the board does not boot when the jlink is connected either. So I could use printf's to debug. This is just annoying with the pogo pins as I have to hold them in place by hand. 

    So the problem was that I ran the nrf_pwr_mgmt_run() function before the ble_stack_init() in the main function. For some reason this does not hang when flashing the device and running immediately, but it does hang when booting after a power toggle. No idea why...

  • Hello,

    I suspect this may be related to your clock settings. The DK has an external LFXTAL, which is the low frequency clock source. Do you use BLE in the application that you use?

    Can you try to set the following defines in sdk_config.h? (The names are from the latest SDK, SDK15.2.0, since I don't know what SDK version you are using.

    #define NRF_SDH_CLOCK_LF_SRC 0

    #define NRF_SDH_CLOCK_LF_RC_CTIV 16

    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2

    #define NRF_SDH_CLOCK_LF_ACCURACY 1

    See if your application starts with these settings.

    When you program the device, and have the debugger connected, the chip will get the clock source from the debugger, but when you run your custom application, it doesn't actually have a clock source, since it expects to have an external LFXTAL, unless something else is specified in sdk_config.h.

    Best regards,

    Edvin

  • Thanks for the reply! The taiyo yuden I use has a 32kHz external crystal so I was using these settings:

    #define NRF_SDH_CLOCK_LF_SRC 1
    #define NRF_SDH_CLOCK_LF_RC_CTIV 0
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0
    #define NRF_SDH_CLOCK_LF_ACCURACY 7

    I switched to the settings you suggested and the board is booting, so that seems good. If I understand correctly, using your settings, the internal oscillator is used and this should also improve power consumption, which is a good thing for my use case.

    When I add the nrf_pwr_mgmt_run() before the ble_stack_init(), the board still hangs on the nrf_pwr_mgmt_run() function (when not connected to debugger). This is not really an issue for me as I don't really need that function there.

  • Hello,

    I see here that the EYSHCNZWZ does not have a LFXTAL, so I assume you have added that to your PCB? What sort of LFXTAL do you have? Can you double check the accuracy of the XTAL? is it 20PPM? If not, modify your NRF_SDH_CLOCK_LF_ACCURACY to match your LFXTAL. Please also check that your capacitors connected to the LFXTAL are matching (page 14 in the link above).

    The capacitor values are described in figure 4 here:

    http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fclock.html&cp=2_1_0_18_1&anchor=concept_xkj_np1_2r

    So what is the internal capacitance on your LFXTAL, and what is the capacitance on your C1 and C2?

    Best regards,

    Edvin

  • This is the correct datasheet for the EYSHCNZWZ. The block diagram (below) shows a LFXTAL of 32.768KHz.

    I can't seem to find any detail on this XTALs and the accuracy. Can I assume it is just as good as the one on the DK and use those same settings?

Related