






















环境:Win10, VSCode + Embedded IDE扩展,使用Cortex-Debug进行调试。
/**
******************************************************************************
* @file startup_stm32f303x8.s
* @author MCD Application Team
* @brief STM32F303x6/STM32F303x8 devices vector table for GCC toolchain.
* This module performs:
* - Set the initial SP
* - Set the initial PC == Reset_Handler,
* - Set the vector table entries with the exceptions ISR address,
* - Configure the clock system
* - Branches to main in the C library (which eventually
* calls main()).
* After Reset the Cortex-M4 processor is in Thread mode,
* priority is Privileged, and the Stack is set to Main.
******************************************************************************
* @attention
*
* Copyright (c) 2016 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
这里的STM32F303x6/STM32F303x8 devices vector table for GCC toolchain.就表明了这个xxx.s文件是使用gcc的汇编格式来使用的。
如果是STM32F303x6/x8 devices vector table for MDK-ARM toolchain.则表示是用ARMCC的汇编格式来使用的。
"compilerPath": "C:/Users/yinsua/.eide/tools/gcc_arm/bin/arm-none-eabi-gcc.exe","cStandard": "c11",一般重启VSCode后,下方ouput会出现如下log
[8/28/2024, 11:33:47 AM] For C++ source files, IntelliSenseMode was changed from "windows-gcc-x64" to "windows-gcc-arm" based on compiler args and querying compilerPath: "C:/Users/yinsua/.eide/tools/gcc_arm/bin/arm-none-eabi-gcc.exe"
[8/28/2024, 11:33:47 AM] For C source files, IntelliSenseMode was changed from "windows-gcc-x64" to "windows-gcc-arm" based on compiler args and querying compilerPath: "C:/Users/yinsua/.eide/tools/gcc_arm/bin/arm-none-eabi-gcc.exe"
Cortex-Debug + OpenOCD调试STM32F4x示例:
{
"cwd": "${workspaceRoot}",
"executable": "./build/Debug/eide_stm32f411ceu6_test.elf",
"name": "Debug with OpenOCD",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"configFiles": [
"interface/cmsis-dap.cfg",
"target/stm32f4x.cfg"
],
"searchDir": [],
"runToEntryPoint": "main",
"showDevDebugOutput": "none"
}
也可添加如下内容来增加对其它调试功能的支持:
"svdFile": "${workspaceRoot}/.vscode/STM32F303.svd",
"swoConfig": {
"enabled": true,
"cpuFrequency": 8000000,
"swoFrequency": 2000000,
"source": "probe",
"decoders": [
{ "type": "console", "label": "ITM", "port": 0 }
]
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。