繁体   English   中英

[Atollic Truestudio][STM32] 使用 CMSIS-pack/Components 下载/调试 GDB 时“加载失败”

[英][Atollic Truestudio][STM32] “Load Failed” while GDB download/debug using CMSIS-pack/Components

我正在尝试在我的新 F103 项目中使用 CMSIS-pack。 到目前为止,我使用的是自动生成的项目结构,只是将一些文件移到其他地方,一切正常。 现在使用 CMSIS-pack,虽然代码已成功编译,但在将 .elf 下载到 MCU 时出现一些“加载失败”错误。 我运行自动生成的调试配置,与我以前的所有项目相同。 我正在使用 ST-link 和 GDB-server。 这是错误:

Failure at line:13 in 'Target Software Startup Scripts'. Please edit the debug configuration settings.

Load Failed

调试日志:

[0.000] init():  Atollic TrueSTUDIO gdbserver for ST-Link. Version 4.2.2 (WIN32 2018-02-26 16:20:21 15675)
[1.229] reset_hw_wtchpt_module():  Hardware watchpoint supported by the target 
[1.233] createFlashParams():  STM32 device: Flash size =1024
[1.335] STM32_AppReset():  Enter STM32_AppReset() function 
[1.440] STM32_AppReset():  NVIC_DFSR_REG = 0x00000009
[1.441] STM32_AppReset():  NVIC_CFGFSR_REG = 0x00000000
[1.442] STM32_AppReset():  XPSR = 0x01000000
[1.442] Device_Initialise():  ST_LINK Major version =2 Jtag version =27
[1.442] Device_Initialise():  ST_LINK VID=1155 PID=14155
[1.442] Device_Initialise():  ST_LINK device status: HALT_MODE
[1.442] Device_Initialise():  ST_LINK detects target voltage =3.26 Volt
[1.443] initServerContext():  ST-Link device initialization OK
[1.445] WaitConnection():  Waiting for connection on port 61234...
[2.028] WaitConnection():  Accepted connection on port 61234...
[2.028] Device_GetStatus():  ST_LINK device status: HALT_MODE
[2.045] handlePacket():  Reading 0x4 bytes of memory from addr 0x8006b54 
[2.045] handlePacket():  Reading 0x2 bytes of memory from addr 0x8006b54 
[2.069] handlePacket():  Reading 0x20 bytes of memory from addr 0xe00fffd0 
[2.071] handlePacket():  Reading 0x2 bytes of memory from addr 0x807a 
[2.071] handlePacket():  Reading 0x2 bytes of memory from addr 0x807e 
[2.084] STM32_AppReset():  Enter STM32_AppReset() function 
[2.189] STM32_AppReset():  NVIC_DFSR_REG = 0x00000009
[2.190] STM32_AppReset():  NVIC_CFGFSR_REG = 0x00000000
[2.191] STM32_AppReset():  XPSR = 0x01000000
[2.755] handlePacket():  Reading 0x4 bytes of memory from addr 0xffffffff 
[2.755] handlePacket():  Reading 0x4 bytes of memory from addr 0xffffffff 
[2.930] handlePacket():  Reading 0x40 bytes of memory from addr 0x8006b40 
[2.932] handlePacket():  Reading 0x40 bytes of memory from addr 0x8006b80 
[6.065] STM32_AppReset():  Enter STM32_AppReset() function 
[6.170] STM32_AppReset():  NVIC_DFSR_REG = 0x00000009
[6.171] STM32_AppReset():  NVIC_CFGFSR_REG = 0x00000000
[6.172] STM32_AppReset():  XPSR = 0x01000000

任何想法为什么不能下载代码,而相同的配置适用于我所有没有组件/CMSIS 包的项目?

问候,帕特里克

自 3 天以来,我只找到了一种解决方案:卸载 9.3.0 Atollic true studio version 并安装 Version 9.0.1 之后,您将无法收到类似的错误。 有些版本有些板子有问题...

查看 CMSIS 自动生成的项目文件和 CubeMx 生成的项目的构建生成文件的差异,我注意到 .list 文件中存在差异。 未列出 isr_vector。

如果您检查此部分,您会注意到新自动生成的项目中缺少某些内容。 它是您设备的启动文件。

在项目树中的 RTEconfig 对象中,有一种方法可以通过勾选来包含设备启动文件:

设备>启动

将此添加到 RTE 组件选择器并保存更改后,您将在项目树中找到文件

  • “CMSIS系统和时钟配置文件”RTE>Device>STM32F103C8>system_stm32f10x.c

  • 将包含“CMSIS 设备外设访问标头”stm32f10x.h

  • 所以“CMSIS系统和时钟配置头”文件startup_stm32f10x.h

恐怕在目前唯一可用的初始版本 v1.0.0 中,“CMSIS 设备启动中断向量”文件 startup_stm32f10x.s 没有以任何方式添加到项目中。

我修复它的方法是添加来自 CubeMx Generated projectstartup_stm32f10x.sSTM32F103C8_FLASH.ld文件。

STM32F103C8_FLASH.ld 位置必须添加到 project>C/C++ Build>Settings>C Linker>General>Linker script

我把startup_stm32f10x.s文件复制到RTE>Device>STM32F103C8文件夹

这样做,重新编译代码并启动调试会话,您将按预期获得正常的调试会话。 这只是一个临时解决方案,但我希望我可以帮助某人。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM