nrf52832 custom board only runs application in debug mode.

Situation

-------

Code: 4861.blinky.zip

Environment

VS Code

nRF Connect SDK v1.6.0

cmake version 3.24.0-rc2

gcc.exe (Rev2, Built by MSYS2 project) 12.1.0

Zephyr version: 2.6.0-rc1

west version "0.11.0"

Board

nRF52832 Rev 2

HFCLOCK is run with XO

LF clock is internal RC.

Reset pin is not connected.

Problem

I am trying to run the zephyr blink example on a custom board with a nrf52832 Rev 2.

When I program the board and debug the application functions as expected.

When I flash the board without debugging, nothing appears to happen.

Observation

After flashing the application

- With an oscilloscope, I have observed the HF clock does not start.

- The reset pin is HI

- no other accessible pins seemed to change state.

- Supply Voltage remained stable

Occasionally, I am unable to connect JLink to the board when an application has been flashed. To fix this, I power cycle the board and quickly connect JLink as its turning on. Then erase the program.

My Attempts

I have tried playing around with different clock and reset configuration options.

I have tried using MCUboot

I have tried several different device tree and board configurations

Success with Segger Embedded Studio NRF5 SDK v17.1

I tried programming the blinky example for pca10040 to the board. It worked as expected.

----------------

Question

This appears to be a software issue using the nrf connect SDK v1.6.

Here is my latest prf.conf

CONFIG_GPIO=y
CONFIG_RESET_ON_FATAL_ERROR=y
CONFIG_GPIO_AS_PINRESET=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y

CONFIG_BT=n
CONFIG_DEBUG=n
CONFIG_LOG=n
CONFIG_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_PM=n

The rest of the code can be found attached.

Any suggestions are appreciated.

Parents
  • It seems like you might be encountering a similar issue to what was discussed in the Nordic DevZone forum. In that case, the user was able to build and flash the program successfully, but it only ran when the debugger was started. The program did not run when the chip was standalone, which seems similar to your issue.
    Check if you have enabled DCDC in your code. Specifically, check if BOARD_ENABLE_DCDC is enabled in your config.
  • I have changed my prj.conf.

    CONFIG_GPIO=y
    
    CONFIG_BOARD_ENABLE_DCDC=n
    
    CONFIG_RESET_ON_FATAL_ERROR=y
    CONFIG_GPIO_AS_PINRESET=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
    
    
    
    CONFIG_BT=n
    CONFIG_DEBUG=n
    CONFIG_LOG=n
    CONFIG_CONSOLE=n
    CONFIG_USE_SEGGER_RTT=n
    CONFIG_PM=n

    and added the following the Kconfig.board

    config BOARD_ENABLE_DCDC
    	bool "Enable DCDC mode"
    	select SOC_DCDC_NRF52X
    	default y
    	depends on BOARD_DCLOCK32

    This was unsuccessful. Any other ideas?

Reply
  • I have changed my prj.conf.

    CONFIG_GPIO=y
    
    CONFIG_BOARD_ENABLE_DCDC=n
    
    CONFIG_RESET_ON_FATAL_ERROR=y
    CONFIG_GPIO_AS_PINRESET=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
    
    
    
    CONFIG_BT=n
    CONFIG_DEBUG=n
    CONFIG_LOG=n
    CONFIG_CONSOLE=n
    CONFIG_USE_SEGGER_RTT=n
    CONFIG_PM=n

    and added the following the Kconfig.board

    config BOARD_ENABLE_DCDC
    	bool "Enable DCDC mode"
    	select SOC_DCDC_NRF52X
    	default y
    	depends on BOARD_DCLOCK32

    This was unsuccessful. Any other ideas?

Children
Related