You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Bootloader跳转成功但HSDatalog固件无法启动问题求助

问题:ST HSDatalog固件从Bootloader跳转后卡滞无响应

我尝试启动Flash中地址0x08019000处的ST官方HSDatalog固件,已成功跳转至该地址,但固件无响应。使用的硬件是搭载2MB FLASH、640KB RAM的STEVAL-STWINKT1B评估板。我的Bootloader能正常跳转至其他所有刷入的固件,因此Bootloader本身无问题,但这款ST固件在进入任务调度循环后似乎“卡滞”。

该固件的main函数代码如下:

int main(void) {
    HAL_Init();

    SystemClock_Config();

    /* Enable Power Clock*/
    __HAL_RCC_PWR_CLK_ENABLE();
    HAL_PWREx_EnableVddUSB();
    HAL_PWREx_EnableVddIO2();
    BSP_Enable_DCDC2();

    OTA_Verify_Current_Active_Bank();

    /* Configure the Battery Charger */
//  BattChrg_Init(); not needed

    /* Configure Power Voltage Detector(PVD) to detect if battery voltage is low */
//  PVD_Config(); not needed

    /* Configure DEBUG PIN and LED */
    BSP_DEBUG_PIN_Init_All();
    BSP_LED_Init(LED_GREEN);
    BSP_LED_Init(LED_ORANGE);
    __HAL_RCC_GPIOA_CLK_ENABLE();

    /* Initialize srand() using STM32 TRNG peripheral */
    RND_Init();

    HSD_JSON_set_allocation_functions(HSD_malloc, HSD_free);

    /* Start USB */
    MX_USB_DEVICE_Init();
    HAL_Delay(100);

    HSD_DeviceDescriptor_Init_t deviceDescriptorInit;

    /* Set default device description */
    strcpy(deviceDescriptorInit.alias, "STWIN_001");
    strcpy(deviceDescriptorInit.model, "STEVAL-STWINKT1B");
    strcpy(deviceDescriptorInit.partNumber, "FP-SNS-DATALOG1");
    strcpy(deviceDescriptorInit.URL, "www.st.com/stwin");
    strcpy(deviceDescriptorInit.fwName, "FP-SNS-DATALOG1_Datalog1");
    strcpy(deviceDescriptorInit.bleMacAddress, "00:00:00:00:00:00");
    char tmp1[6] = {
    HSD_VERSION_MAJOR, '.',
    HSD_VERSION_MINOR, '.',
    HSD_VERSION_PATCH, '\0' };
    strcpy(deviceDescriptorInit.fwVersion, tmp1);
    set_device_description(&deviceDescriptorInit);

    /* Populate the sensor database and enable all sensors */
    Create_Sensors();

    /* Initialize tags */
    HSD_TAGS_init(COM_GetDevice());

    /* USER Button initialization */
    BSP_PB_Init(BUTTON_USER, BUTTON_MODE_EXTI);
    BSP_PB_PWR_Init();

    /* Sensor Manager initialization */
    SM_Peripheral_Init();
    SM_OS_Init();
    Peripheral_MSP_Init_All();

    /* SD card Manager initialization */
    SDM_Peripheral_Init();

    /* Initialize sensors and SD card threads */
    Peripheral_OS_Init_All();
    SDM_OS_Init();

    /* Initialize and allocate AutoMode thread */
    g_pxAMtaskObj = AMTaskAlloc();
    AMTaskInit(g_pxAMtaskObj);

    /* initialize and allocate BLE thread */
#if (HSD_BLE_ENABLE == 1)
    BLE_CM_OS_Init();
#endif
    /* Start scheduler */
    osKernelStart();

    while (1)
        ;

}

相关背景信息

  • 使用的Bootloader基于Akos Pasztor的实现,程序代码及main.c中的调用逻辑均已验证正常,可成功跳转至其他自定义固件
  • 操作流程:挂载FatFS格式化的SD卡后,调用Enter_Bootloader函数将固件.bin文件刷入0x08019000地址的FLASH区域,随后通过Bootloader_JumpToApplication函数跳转至该应用

请问该固件卡滞的原因是什么?是否有使用过该固件搭配Bootloader的经验可以分享?

内容的提问来源于stack exchange,提问作者TomNerd

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 20:24:52