Blinky on custom nrf52840 board boots and debugs but does not blink the LED

We have a project that we're moving from a Fanstel BC840 module to a bare chip (CoB) nrf52840-QIAAD0.

Here's what we can do:

  • We can flash the chip successfully but our program isn't advertising
  • When we hook it up to the power profiling kit, we see that it's not running correctly, compared to how it runs on the nrf52840-DK
  • Once we turn on RTT logging, our program immediately begins running but we still don't see it advertising, even though the power profiler shows the power chirps every second that we would expect to be advertising
  • We switched to the blinky example code and it runs fine on the DK but nothing happens on the custom board
  • We can successfully run and step-through debug blinky on the custom board, but no LED blinks (while it works fine on the DK)

Blinky works fine on the DK and on our old board with the BC840 module, but not on the bare chip nrf52840 board. Our actual program mirrors this where it works on the DK and on a module but not on the bare chip custom board.

We followed the reference design but I've also attached our schematic. Also attached is the power profiling for blinky. In the middle you can see where we are flashing the bare chip. Is there something about the revision of the nrf52840-QIAAD0 chip? 

Parents Reply Children
  • I tried this and it made no difference in my app. It still hangs, running on debug or RTT.

    I also went to verify it in `build/zephyr/.config` and it had:

    # CONFIG_BOARD_ENABLE_DCDC is not set
    According to the docs on Setting the Kconfig values in the Zephyr build configuration docs this is the equivalent of a boolean false.
    So I'm still at a loss for how to get the app running. If I stop execution right as main() begins, it still won't run, suggesting it's not the app's code but configuration.
    Here's my prj.conf:
    
    
    # Bluetooth
    CONFIG_BT=y
    CONFIG_BT_HCI=y
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_NONE=n
    CONFIG_BT_SETTINGS=y
    CONFIG_BT_DEVICE_NAME="Sol Page Turner"
    CONFIG_BT_GATT_DYNAMIC_DB=y

    # Bluetooth Services - Peripheral
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_PAGE_TURNER_SERVICE=y
    CONFIG_BT_PAGE_TURNER_SERVICE_POLL_BUTTON=n
    CONFIG_BT_BATTERY_SERVICE=y
    CONFIG_BT_BONDABLE=n
    CONFIG_BT_BAS=y
    CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=y
    CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n
    CONFIG_BT_PERIPHERAL_PREF_MIN_INT=40
    CONFIG_BT_PERIPHERAL_PREF_MAX_INT=90
    CONFIG_BT_PERIPHERAL_PREF_LATENCY=20
    CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=1000
    CONFIG_BLE_ADV_FAST_ADV_TIMEOUT=20
    CONFIG_BLE_ADV_FAST_INT_MIN=200
    CONFIG_BLE_ADV_FAST_INT_MAX=800
    CONFIG_BLE_ADV_SLOW_INT_MIN=840
    CONFIG_BLE_ADV_SLOW_INT_MAX=1200

    # Bluetooth - Central
    # CONFIG_BT_CENTRAL=y
    # CONFIG_BT_SINDARIN_SERVICE=y
    # CONFIG_BT_SCAN=y
    # CONFIG_BT_SCAN_FILTER_ENABLE=y
    # CONFIG_BT_SCAN_UUID_CNT=1
    # CONFIG_BT_GATT_CLIENT=y
    # CONFIG_BT_GATT_DM=y

    # CAF Button configuration
    CONFIG_DK_LIBRARY=n
    CONFIG_CAF=y
    CONFIG_CAF_PM_EVENTS=y
    CONFIG_CAF_POWER_MANAGER=y
    CONFIG_CAF_BUTTONS=y
    CONFIG_CAF_BUTTON_EVENTS=y
    CONFIG_CAF_BUTTONS_DEF_PATH="../../../../include/buttons_def.h"
    CONFIG_CAF_CLICK_DETECTOR_DEF_PATH="../../../../include/click_detector_def.h"
    CONFIG_CAF_BUTTONS_POLARITY_INVERSED=y
    CONFIG_CAF_CLICK_DETECTOR=y
    CONFIG_CAF_CLICK_DETECTOR_LONG_CLICK_MSEC=700
    CONFIG_CAF_BUTTONS_DEBOUNCE_INTERVAL=100
    # CONFIG_CAF_BUTTONS_PM_KEEP_ALIVE=y
    CONFIG_GPIO=y

    # CAF LEDs
    CONFIG_LED=y
    CONFIG_PWM=y
    CONFIG_LED_PWM=y
    CONFIG_CAF_LEDS=y
    CONFIG_CAF_LEDS_PM_EVENTS=y
    CONFIG_CAF_LEDS_PWM=y

    # Battery
    CONFIG_ADC=y
    CONFIG_BOARD_ENABLE_DCDC_HV=n
    CONFIG_BOARD_ENABLE_DCDC=n

    # External 32kHz clock
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_20PPM=y
    # Internal 32kHz clock
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y

    # Device Information Service / Serial Number + Build Number
    CONFIG_BT_DIS=y
    CONFIG_BT_DIS_PNP=n
    CONFIG_BT_DIS_MODEL="Sol Page Turner"
    CONFIG_BT_DIS_MANUF="Sindarin, Inc."
    # CONFIG_BT_DIS_SERIAL_NUMBER=y
    # CONFIG_BT_DIS_SERIAL_NUMBER_STR="ABCDEF"
    CONFIG_BT_DIS_SW_REV=y
    CONFIG_BT_DIS_SW_REV_STR="0.1.99"

    # Stack Sizes
    CONFIG_HEAP_MEM_POOL_SIZE=8192
    CONFIG_BT_RX_STACK_SIZE=8192
    # Increase system workqueue stack size to prevent stack overflows while handling
    # SMP requests.
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    # CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=8192
    # CONFIG_MAIN_STACK_SIZE=8192
    # CONFIG_ISR_STACK_SIZE=8192
    # CONFIG_IDLE_STACK_SIZE=8192

    # Power management
    CONFIG_PM=y
    # Required to disable default behavior of deep sleep on timeout
    CONFIG_PM_DEVICE=y
    CONFIG_PM_POLICY_CUSTOM=y
    # CONFIG_PM_POLICY_DEFAULT=y
    CONFIG_APP_EVENT_MANAGER=y
    CONFIG_CAF_POWER_MANAGER_TIMEOUT=2
    CONFIG_CAF_POWER_MANAGER_STAY_ON=n
    CONFIG_CAF_FORCE_POWER_DOWN_EVENTS=y
    CONFIG_PM_POWER_DOWN_AFTER_BUTTON_PRESS=y

    # Disable features not needed
    CONFIG_TIMESLICING=n
    CONFIG_MINIMAL_LIBC_MALLOC=n
    CONFIG_SERIAL=n

    # # Disable Bluetooth features not needed
    CONFIG_BT_DEBUG_NONE=y
    CONFIG_BT_ASSERT=n
    CONFIG_BT_DATA_LEN_UPDATE=n
    CONFIG_BT_PHY_UPDATE=n
    CONFIG_BT_GATT_CACHING=n

    # Disable Bluetooth controller features not needed
    CONFIG_BT_CTLR_PRIVACY=n
    CONFIG_BT_CTLR_PHY_2M=n

    # Memory protection
    CONFIG_THREAD_CUSTOM_DATA=n
    CONFIG_FPU=n

    # Boot
    CONFIG_BOOT_BANNER=n
    CONFIG_BOOT_DELAY=0
    CONFIG_REBOOT=y
    CONFIG_ASSERT=y
    # CONFIG_RESET_ON_FATAL_ERROR=y

    # Console
    CONFIG_CONSOLE=n
    CONFIG_PRINTK=n
    CONFIG_EARLY_CONSOLE=n
    CONFIG_UART_CONSOLE=n
    CONFIG_STDOUT_CONSOLE=n

    # Build
    CONFIG_SIZE_OPTIMIZATIONS=y

    # Enable the Bluetooth mcumgr transport (unauthenticated).
    CONFIG_MCUMGR_SMP_BT=y
    CONFIG_MCUMGR_SMP_BT_AUTHEN=n
    CONFIG_MCUMGR_SMP_BT_CONN_PARAM_CONTROL=y

    # Enable the Shell mcumgr transport.
    # CONFIG_MCUMGR_SMP_SHELL=y

    # Enable Bootloader so OTA updates can be performed
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_MCUBOOT_IMG_MANAGER=y
    CONFIG_MCUBOOT_IMAGE_VERSION="1.0.0+0"

    # The subsystems we need so OTA payloads can be written to
    # flash and updated by MCUBoot
    CONFIG_MCUMGR=y

    # Enable most core commands.
    CONFIG_MCUMGR_CMD_IMG_MGMT=y
    CONFIG_MCUMGR_CMD_OS_MGMT=y

    # Allow for large Bluetooth data packets.
    CONFIG_BT_L2CAP_TX_MTU=498
    CONFIG_BT_BUF_ACL_RX_SIZE=502
    CONFIG_BT_BUF_ACL_TX_SIZE=502
    # CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

    # Enable the Bluetooth (unauthenticated) and shell mcumgr transports.
    CONFIG_BT_SMP=y
    CONFIG_BT_DFU_SMP=y
    CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y
    CONFIG_BT_CTLR=y
    CONFIG_BT_HCI=y
    # CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
    CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
    CONFIG_BT_HCI_VS_EXT=y
    CONFIG_CAF_BLE_STATE=y
    CONFIG_CAF_BLE_SMP=y

    # Enable the mcumgr Packet Reassembly feature over Bluetooth and its configuration dependencies.
    # MCUmgr buffer size is optimized to fit one SMP packet divided into five Bluetooth Write Commands,
    # transmitted with the maximum possible MTU value: 498 bytes.
    CONFIG_MCUMGR_SMP_REASSEMBLY_BT=y
    CONFIG_MCUMGR_BUF_SIZE=2475
    CONFIG_OS_MGMT_MCUMGR_PARAMS=y

Related