Issue with 1.8V Control and DFU on nRF5340

Dear Nordic Support Team,

We are using the nRF5340 together with the NPM1300 in our project. The 1.8V output is controlled via the NPM1300.

When performing a BLE DFU, if CONFIG_SERIAL=n in the prj.conf file, the device resets when the 1.8V output is enabled after the update. However, when CONFIG_SERIAL=y, the issue is resolved, but this increases power consumption.

We would like to perform a successful update with serial disabled to minimize power usage. Could you please guide us on where to focus to resolve this issue?

SDK 2.6

Best regards,

Projconf

# Enable Bootloader 
CONFIG_BOOTLOADER_MCUBOOT=y
# Enable APP CORE DFU -- Disable for multicore DFU
# CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

# Enable SMP Server
CONFIG_MCUMGR=y
CONFIG_MCUMGR_GRP_IMG=y

# CONFIG_MCUMGR_GRP_IMG dependencies
CONFIG_FLASH=y
CONFIG_IMG_MANAGER=y

# CONFIG_IMG_MANAGER dependencies
CONFIG_STREAM_FLASH=y

# CONFIG_MCUMGR dependencies
CONFIG_NET_BUF=y
CONFIG_ZCBOR=y

# Required for CONFIG_IMG_MANAGER
CONFIG_FLASH_MAP=y

CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION="2.0.0+0"



CONFIG_BT=y

CONFIG_BT_SMP=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_BAS=n
CONFIG_BT_HRS=n
CONFIG_SNS_SERVICE_ENABLED=y
CONFIG_ECG_SERVICE_ENABLED=y
CONFIG_PPG_SERVICE_ENABLED=y
CONFIG_MOT_SERVICE_ENABLED=y
CONFIG_COM_SERVICE_ENABLED=y
CONFIG_BT_DEVICE_NAME="Zephyr Heartrate Sensor"
CONFIG_BT_DEVICE_APPEARANCE=833
CONFIG_BT_DEVICE_NAME_DYNAMIC=y


CONFIG_I2C=y
CONFIG_CBPRINTF_FP_SUPPORT=y

CONFIG_GPIO=y
CONFIG_LED=y

CONFIG_COUNTER=y


CONFIG_MCUBOOT_USE_ALL_AVAILABLE_RAM=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y
CONFIG_NRF53_UPGRADE_NETWORK_CORE=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2
CONFIG_ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS=y


# Enable bonding
CONFIG_BT_SETTINGS=y

CONFIG_SETTINGS=y

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_I2C=y
CONFIG_CBPRINTF_FP_SUPPORT=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

# This example requires more stack
CONFIG_MAIN_STACK_SIZE=1152
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Config logger


# HCI ACL buffers size
# BT_L2CAP_RX_MTU = CONFIG_BT_BUF_ACL_RX_SIZE - BT_L2CAP_HDR_SIZE
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_BUF_ACL_TX_SIZE=251

# L2CAP SDU/PDU TX MTU
CONFIG_BT_L2CAP_TX_MTU=247

CONFIG_BT_HCI_VS=y
# CONFIG_BT_HCI_VS_EXT=y

CONFIG_SERIAL=n
CONFIG_LOG=n


CONFIG_SHELL=n

CONFIG_LOG_CMDS=y

CONFIG_REGULATOR=y
CONFIG_SENSOR=y
CONFIG_I2C_SHELL=y
CONFIG_NRF_FUEL_GAUGE=y
CONFIG_REQUIRES_FLOAT_PRINTF=y


# CONFIG_FLASH_JESD216_API=y


CONFIG_NORDIC_QSPI_NOR=y


# CONFIG_PM=y
# CONFIG_PM_DEVICE=y

#### pwm
CONFIG_PWM=y
CONFIG_PWM_LOG_LEVEL_DBG=y


Parents
  • Hello,

    Are you exposing any UART interfaces on your device, or did you just find that enabling the UARTE instance(s) in your bootloadermade the problem go away? Also, please check what the reset source was after the reset from the RESETREAS register.

    Thanks,

    Vidar

  • Hello ,When I set CONFIG_SERIAL=n, the issue occurs, and we only use the output for printf. There is no UART usage in the project. When CONFIG_SERIAL=n, I can't even see the reset issue.

    After investigating further, it seems that rebooting the device while it is awake resolves the issue. However, if I reboot while the device is in sleep mode, the problem persists.

    Here is the relevant code:

    int system_sleep_wake(uint8_t new_state)
    {
        if(sleepWakeFlag == new_state) return 0;
    
        printf("System Sleep Wake\n");
        buck1Control(new_state);
        printf("Buck1 Control ok\n");
        control_sensor_state(new_state);
        printf("Control Sensor State ok\n");
        control_afe_state(new_state);
        printf("Control Afe State ok\n");
        control_peripheral_state(new_state);
        printf("Control Peripheral State ok\n");
        //bt_conn_unref(!new_state);
        // pm_state_force(0, &(struct pm_state_info){PM_STATE_SUSPEND_TO_IDLE, 0, 0});
        sleepWakeFlag = new_state;
    
        if(new_state == true)
        {
            if(apk_init() != 0)
            {
                perp.Afe = 55;
                printf("APK Init error\n");
    		}
    
            printf("APK Init ok\n");
        }
        else
        {
            printf("APK Uninit\n");
            apk_uninit();
        }
    
        return 0;
    }

    void buck1Control(bool new_status)
    {
        if(new_status == false)
        {
            if (regulator_is_enabled(buck1)) {
                regulator_disable(buck1);
                printf("******************1.8V Disable\n");
            }
        }
        else
        {
            if (!regulator_is_enabled(buck1)) {
                    regulator_enable(buck1);
                    printf("************1.8V Enableee\n");
            }
        }
    }

    When I reset the device while it is awake, it enters low-power mode correctly. However, if I reset it while in sleep mode, nothing changes.

    Apologies if I am misinterpreting something. This issue has been quite challenging for me.

    Thanks!

Reply
  • Hello ,When I set CONFIG_SERIAL=n, the issue occurs, and we only use the output for printf. There is no UART usage in the project. When CONFIG_SERIAL=n, I can't even see the reset issue.

    After investigating further, it seems that rebooting the device while it is awake resolves the issue. However, if I reboot while the device is in sleep mode, the problem persists.

    Here is the relevant code:

    int system_sleep_wake(uint8_t new_state)
    {
        if(sleepWakeFlag == new_state) return 0;
    
        printf("System Sleep Wake\n");
        buck1Control(new_state);
        printf("Buck1 Control ok\n");
        control_sensor_state(new_state);
        printf("Control Sensor State ok\n");
        control_afe_state(new_state);
        printf("Control Afe State ok\n");
        control_peripheral_state(new_state);
        printf("Control Peripheral State ok\n");
        //bt_conn_unref(!new_state);
        // pm_state_force(0, &(struct pm_state_info){PM_STATE_SUSPEND_TO_IDLE, 0, 0});
        sleepWakeFlag = new_state;
    
        if(new_state == true)
        {
            if(apk_init() != 0)
            {
                perp.Afe = 55;
                printf("APK Init error\n");
    		}
    
            printf("APK Init ok\n");
        }
        else
        {
            printf("APK Uninit\n");
            apk_uninit();
        }
    
        return 0;
    }

    void buck1Control(bool new_status)
    {
        if(new_status == false)
        {
            if (regulator_is_enabled(buck1)) {
                regulator_disable(buck1);
                printf("******************1.8V Disable\n");
            }
        }
        else
        {
            if (!regulator_is_enabled(buck1)) {
                    regulator_enable(buck1);
                    printf("************1.8V Enableee\n");
            }
        }
    }

    When I reset the device while it is awake, it enters low-power mode correctly. However, if I reset it while in sleep mode, nothing changes.

    Apologies if I am misinterpreting something. This issue has been quite challenging for me.

    Thanks!

Children
Related