使用环境
<!-- 必须 告知插件运行的环境,帮助开发者定位问题 -->
- 操作系统版本:WIN10-22H2-V2
- 操作系统平台(x86/x64):x64
- VsCode 版本:1.95.3
- EIDE 插件版本:3.20.0
- C/C++ 插件版本:1.22.11
- 何种编译器(keil_c51/sdcc/armcc5/armgcc/...):armcc5
- 编译器版本(非编译问题可忽略):
描述问题
<!-- 使用简明清晰的语言描述您的问题 -->
从Keil5导入到VSCode的项目
JLink调试,运行到延时函数时,卡死(可以暂停)
好像是这个while语句一直无法退出,用的是复旦微cortex-m0的FM33LG048芯片,不明白为什么Keil内调试可以正常延时,VSCode却不行
屏幕截图
<!--使用一些截图能够更好地展现问题 -->
期望现象
<!--您期望应该产生的,但实际上却没有发生的结果-->
能和Keil内部调试一样,这里只是延时1S,Keil可以正常延时后,继续执行后续代码,VSCode配合Core-Debug插件则会直接卡死,无法继续执行
程序入库点
#include "main.h"
#include "fm33_assert.h"
/**
- Chip Series: FM33LG0xx;
- FL Version: v2.3;
- Project Name: 002_PLL_XTHF;
- Project Version: v2.3.0.0;
- Project ID: 1861389383127052289;
- Create Date: 2024-11-26;
*/
int main(void)
{
/* Initialize FL Driver Library */
FL_Init();
/* Configure the system clock */
MF_Clock_Init();
/* Initialize all configured peripherals */
MF_Config_Init();
while(1)
{
}
}
!<
`void MF_Clock_Init(void)
{
/* Initial CDIF */
FL_CDIF_EnableCPUToVAO(CDIF);
FL_CDIF_EnableVAOToCPU(CDIF);
/* Initial RTCA Adjust Value */
FL_CMU_EnableGroup1BusClock(FL_CMU_GROUP1_BUSCLK_RTCA);
FL_RTCA_WriteAdjustValue(RTCA, 0);
FL_CMU_DisableGroup1BusClock(FL_CMU_GROUP1_BUSCLK_RTCA);
/* Initial RTCB Adjust Value */
FL_RTCB_WriteAdjustValue(RTCB, 0);
/* Initial XTLF */
FL_VAO_XTLF_Enable(VAO);
FL_DelayMs(1000);
/* Initial Low Speed Clock */
FL_CMU_SetLSCLKClockSource(FL_CMU_LSCLK_CLK_SOURCE_RCLP);
/* Initial RCHF */
FL_CMU_RCHF_WriteTrimValue(RCHF8M_TRIM);
FL_CMU_RCHF_SetFrequency(FL_CMU_RCHF_FREQUENCY_8MHZ);
FL_CMU_RCHF_Enable();
/* Initial PLL */
FL_CMU_PLL_Disable();
FL_CMU_PLL_SetClockSource(FL_CMU_PLL_CLK_SOURCE_RCHF);
FL_CMU_PLL_SetPrescaler(FL_CMU_PLL_PSC_DIV8);
FL_CMU_PLL_WriteMultiplier(63);
FL_CMU_PLL_SetOutputMultiplier(FL_CMU_PLL_OUTPUT_X1);
FL_CMU_PLL_Enable();
while(FL_CMU_IsActiveFlag_PLLReady() != FL_SET);
/* Initial System Clock */
FL_FLASH_SetReadWait(FLASH, FL_FLASH_READ_WAIT_2CYCLE); /* 设置FLASH读等待为 2 个周期 */
FL_CMU_SetSystemClockSource(FL_CMU_SYSTEM_CLK_SOURCE_PLL); /* 设置系统主时钟为 PLL */
FL_CMU_SetAHBPrescaler(FL_CMU_AHBCLK_PSC_DIV1);
FL_CMU_SetAPBPrescaler(FL_CMU_APBCLK_PSC_DIV1);
/* Initial CDIF Clock Prescaler */
FL_CDIF_SetPrescaler(CDIF, FL_CDIF_PSC_DIV8);
SystemCoreClockUpdate();
/* Initial Clock Output */
MF_CMU_FOUT0_Init();
}`
`/**
- @brief Provide block delay in microseconds.
- @note The function is declared as __WEAK to be overwritten in case of other
- implementation in user file.
- @param count specifies the delay count in microseconds.
- @retval None
*/
__WEAK void FL_DelayUs(uint32_t count)
{
count = FL_DELAY_US * count;
count = count > 16777216 ? 16777216 : count;
SysTick->LOAD = count - 1;
SysTick->VAL = 0;
while(!((SysTick->CTRL >> 16) & 0x1));
}
/**
- @brief Provide blocking delay in milliseconds.
- @note The function is declared as __WEAK to be overwritten in case of other
- implementation in user file.
- @param count specifies the delay count in milliseconds.
- @retval None
*/
__WEAK void FL_DelayMs(uint32_t count)
{
while(count--)
{
FL_DelayUs(1000);
}
}`