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.

Related