DTM TX only active when RTT Viewer is connected (nRF52840, based on direct_test_mode)

I am working with the DTM sample on nRF52840 using nRF Connect SDK (Zephyr)

My goal is to run a continuous TX test automatically at boot (standalone), without requiring UART or external commands

Setup

  • Board: nrf52840dk_nrf52840 (compatible based on direct_test_mode)
  • Hardware: Custom Board (based in Circuit configuration no. 2 for CKAA WLCSP)
  • SDK: nRF Connect SDK v2.6.1
  • Measurement: LiteVNA connected to ANT output
  • Programming: JTAG+SWD ARM Tool

What I observe

When the device boots without RTT connected:

  • Then TX stops completely X
  • TX Stops

When I connect RTT Viewer:

  • Continuous TX starts immediately White check mark
  • RF signal is stable and visible on LiteVNA

What I am doing in code

I run DTM (based on direct_test_mode example) directly from main():

dtm_tr_init();

dtm_setup_prepare();
dtm_setup_set_phy(DTM_PHY_2M);
dtm_setup_set_modulation(DTM_MODULATION_STANDARD);
dtm_setup_set_transmit_power(DTM_TX_POWER_REQUEST_MAX, 8, 0);

dtm_test_transmit(0, 37, DTM_PKT_PRBS9);  // Select Channel

No external commands are used.

My prj.conf:

#RTT console configuration
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n
# CONFIG_PRINTK=n
CONFIG_LOG=y
# CONFIG_BT_DEBUG_MONITOR_RTT=y
# CONFIG_LOG_MODE_IMMEDIATE=y   # Send logs immediately to backend (no internal buffering)
# CONFIG_LOG_MODE_DEFERRED=y     # If Disabled: logs are not deferred/buffered
CONFIG_LOG_BUFFER_SIZE=8192
# CONFIG_BT_DEBUG_MONITOR_RTT_BUFFER_SIZE=4096
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL=y


# Configure assertions
CONFIG_ASSERT=n
CONFIG_ASSERT_NO_COND_INFO=y
CONFIG_ASSERT_NO_MSG_INFO=y

CONFIG_HW_STACK_PROTECTION=n

CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=n

CONFIG_LOG=y
CONFIG_LOG_PRINTK=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_BLOCK_IN_THREAD=n

# Use necessary peripherals
CONFIG_NRFX_TIMER0=y
CONFIG_NRFX_TIMER1=y
CONFIG_NRFX_TIMER2=y
CONFIG_NRFX_TIMER3=y

CONFIG_FEM_AL_LIB=y

# Power management configuration
CONFIG_PM_DEVICE=y
CONFIG_NRFX_POWER=y
CONFIG_POWEROFF=y

CONFIG_DTM_POWER_CONTROL_AUTOMATIC=n
CONFIG_DTM_RADIO_IRQ_PRIORITY=0
CONFIG_DTM_TIMER_IRQ_PRIORITY=0
CONFIG_DTM_FAST_RAMP_UP=n
# CONFIG_DTM_TRANSPORT_TWOWIRE=y

Questions

  1. Is there any config in the DTM sample to keep TX running by default and stable?
  2. Could the issue be related to:
    • timers not running properly config?
    • missing clock configuration?
    • scheduler or idle behavior?
Parents
  • Done, resolved — sorry for the late reply.

    The issue also occurred when using the radio_test sample. After reviewing its implementation more closely, I found a section where the DC/DC configuration is handled.

    In my current custom hardware design, the system operates in LDO/LDO mode, so I had to manually enable and configure the desired regulator mode. I executed this as a pre-kernel configuration.

    Here’s the code in case it helps someone:

    /*********************** EXTERNAL LIBRARIES **********************/
    #include <hal/nrf_power.h>
    #include <nrfx_power.h>
    #include <hal/nrf_nvmc.h>
    #include <nrfx.h>
    #include <zephyr/logging/log.h>
    #include <zephyr/init.h>
    
    /**
     * @brief Sets the REGOUT0 voltage to 1.8V if not already set.
     *
     * This function checks the current voltage setting of the REGOUT0 pin and
     * updates it to 1.8V if it is not already set to that value. This setting is
     * required by the accelerometer and is not set by default in the nRF52840
     * development board. The function logs an info message if the setting needs
     * to be changed and performs a system reset after the change has been made.
     */
    void config_regout0_to_1v8(){
      if ((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) != UICR_REGOUT0_VOUT_1V8) {
        LOG_INF("REGOUT0 not set to 1.8V. Updating...");
    
        // Enable write to UICR
        NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
        while (!NRF_NVMC->READY) {}
    
        // Set REGOUT0 to 1.8V
        NRF_UICR->REGOUT0 = (NRF_UICR->REGOUT0 & ~UICR_REGOUT0_VOUT_Msk)
                            | UICR_REGOUT0_VOUT_1V8;
    
        // Disable write to UICR
        while (!NRF_NVMC->READY) {}
        NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
        while (!NRF_NVMC->READY) {}
    
        LOG_INF("REGOUT0 updated. Triggering system reset.");
        NVIC_SystemReset();  // Required to apply change
      }
    }
    
    /**
     * @brief Initialize both REG0 and REG1 in LDO mode.
     *
     * This function sets REG0 and REG1 to LDO mode, providing low-noise startup.
     * Useful for sleep or initial startup to avoid high current peaks.
     */
    void set_ldo_ldo(void) {
    	NRF_POWER->DCDCEN0 = 0; // REG0 in LDO
    	NRF_POWER->DCDCEN  = 0; // REG1 in LDO
    	LOG_INF("REG0=LDO, REG1=LDO");
    }
    
    /**
     * @brief Pre-kernel initialization: configure REG0 output voltage and startup mode.
     *
     * This function sets REG0 to 1.8V and starts both regulators in LDO mode.
     */
    int pre_kernel_power_config(void) {
    	config_regout0_to_1v8();  // Configure REG0 to 1.8V
    
    	// Uncomment the mode you want to test (Select one):
      set_ldo_ldo();
    	// set_ldo_dcdc();
    	// set_dcdc_ldo();
    	// set_dcdc_dcdc();
    
    	return 0;
    }
    
    /***************** INITIALIZATION PRE KERNEL ********************* */
    
    SYS_INIT(pre_kernel_power_config, PRE_KERNEL_1, 1);

Reply
  • Done, resolved — sorry for the late reply.

    The issue also occurred when using the radio_test sample. After reviewing its implementation more closely, I found a section where the DC/DC configuration is handled.

    In my current custom hardware design, the system operates in LDO/LDO mode, so I had to manually enable and configure the desired regulator mode. I executed this as a pre-kernel configuration.

    Here’s the code in case it helps someone:

    /*********************** EXTERNAL LIBRARIES **********************/
    #include <hal/nrf_power.h>
    #include <nrfx_power.h>
    #include <hal/nrf_nvmc.h>
    #include <nrfx.h>
    #include <zephyr/logging/log.h>
    #include <zephyr/init.h>
    
    /**
     * @brief Sets the REGOUT0 voltage to 1.8V if not already set.
     *
     * This function checks the current voltage setting of the REGOUT0 pin and
     * updates it to 1.8V if it is not already set to that value. This setting is
     * required by the accelerometer and is not set by default in the nRF52840
     * development board. The function logs an info message if the setting needs
     * to be changed and performs a system reset after the change has been made.
     */
    void config_regout0_to_1v8(){
      if ((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) != UICR_REGOUT0_VOUT_1V8) {
        LOG_INF("REGOUT0 not set to 1.8V. Updating...");
    
        // Enable write to UICR
        NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
        while (!NRF_NVMC->READY) {}
    
        // Set REGOUT0 to 1.8V
        NRF_UICR->REGOUT0 = (NRF_UICR->REGOUT0 & ~UICR_REGOUT0_VOUT_Msk)
                            | UICR_REGOUT0_VOUT_1V8;
    
        // Disable write to UICR
        while (!NRF_NVMC->READY) {}
        NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
        while (!NRF_NVMC->READY) {}
    
        LOG_INF("REGOUT0 updated. Triggering system reset.");
        NVIC_SystemReset();  // Required to apply change
      }
    }
    
    /**
     * @brief Initialize both REG0 and REG1 in LDO mode.
     *
     * This function sets REG0 and REG1 to LDO mode, providing low-noise startup.
     * Useful for sleep or initial startup to avoid high current peaks.
     */
    void set_ldo_ldo(void) {
    	NRF_POWER->DCDCEN0 = 0; // REG0 in LDO
    	NRF_POWER->DCDCEN  = 0; // REG1 in LDO
    	LOG_INF("REG0=LDO, REG1=LDO");
    }
    
    /**
     * @brief Pre-kernel initialization: configure REG0 output voltage and startup mode.
     *
     * This function sets REG0 to 1.8V and starts both regulators in LDO mode.
     */
    int pre_kernel_power_config(void) {
    	config_regout0_to_1v8();  // Configure REG0 to 1.8V
    
    	// Uncomment the mode you want to test (Select one):
      set_ldo_ldo();
    	// set_ldo_dcdc();
    	// set_dcdc_ldo();
    	// set_dcdc_dcdc();
    
    	return 0;
    }
    
    /***************** INITIALIZATION PRE KERNEL ********************* */
    
    SYS_INIT(pre_kernel_power_config, PRE_KERNEL_1, 1);

Children
No Data
Related