简体   繁体   English

从 STM32CubeIDE 启动 QEMU 模拟器的问题

[英]Issue with launching QEMU simulator from STM32CubeIDE

I'm trying out STM32CubeIDE, and I've been trying to get it to work with the GDB QEMU debugging plugin that's part of the Eclipse CDT package.我正在试用 STM32CubeIDE,并且一直试图让它与 GDB QEMU 调试插件一起工作,该插件是 Eclipse CDT 包的一部分。 I've been able to create the project and debug configuration for my STM32F4-Discovery board, and the debugger partially launches, however, just as the simulator starts up, the GUI window it creates suddenly crashes and I get this error:我已经能够为我的 STM32F4-Discovery 板创建项目和调试配置,并且调试器部分启动,但是,就在模拟器启动时,它创建的 GUI 窗口突然崩溃,我收到此错误:

Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:1234
Error message from debugger back end:
Truncated register 18 in remote 'g' packet
Failed to execute MI command:
-target-select remote localhost:1234
Error message from debugger back end:
Truncated register 18 in remote 'g' packet
Truncated register 18 in remote 'g' packet

I think this is caused by some mismatch between the CDT plugin I installed and the GCC toolchain that shipped with my installation of Ubuntu 20.04.我认为这是由于我安装的 CDT 插件与我安装的 Ubuntu 20.04 附带的 GCC 工具链之间的某些不匹配造成的。 However, I'm not sure how to fix this.但是,我不确定如何解决此问题。

Is there anything I try to fix this?有什么我想解决这个问题的吗?

So it looks like there were a couple factors as to why this wasn't working.所以看起来有几个因素可以解释为什么这不起作用。 First off, the error messages that I was getting immediately after the GUI debugger terminated were due to an incorrect installation of the arm-none-eabi-gdb package.首先,我在 GUI 调试器终止后立即收到的错误消息是由于 arm-none-eabi-gdb 包的安装不正确。 In order to fix this, I downloaded the package from the ARM site and followed the instructions detailed here .为了解决这个问题,我从 ARM 站点下载了这个包,并按照这里的详细说明进行操作。 After installing the arm-none-eabi-gdb package again, I went into the project debug configuration settings, navigated to the "debugger" tab in this window, and then changed the GDB executable path from the variables the IDE had set for me to the actual GDB executable path (in this case /usr/bin/arm-none-eabi-gdb ).再次安装 arm-none-eabi-gdb 包后,我进入项目调试配置设置,导航到此窗口中的“调试器”选项卡,然后将 GDB 可执行路径从 IDE 为我设置的变量更改为实际的 GDB 可执行路径(在本例中为/usr/bin/arm-none-eabi-gdb )。

After that was done, the debugger would no longer immediately terminate, but I was still getting some errors in console shortly after it started (see below).完成后,调试器将不再立即终止,但在它启动后不久我仍然在控制台中收到一些错误(见下文)。 In addition, the debugger GUI would produce no meaningful output, and Ubuntu would warn that the process had frozen.此外,调试器 GUI 不会产生任何有意义的输出,并且 Ubuntu 会警告该进程已冻结。

NVIC: Bad read offset 0xd88
qemu-system-gnuarmeclipse: Attempt to set CP10/11 in SCB->CPACR, but FP is not supported yet.

To solve this, I right clicked the project in the project explorer panel of the IDE, then went to C/C++ build section, then to the Settings section under that, and then finally to the "Tool settings" section of this menu.为了解决这个问题,我在 IDE 的项目资源管理器面板中右键单击该项目,然后转到 C/C++ 构建部分,然后转到其下的设置部分,最后转到此菜单的“工具设置”部分。 Under "MCU settings", there are two options for "Floating point unit" and "Floating point ABI", which I changed to "None" and "Software implementation" respectively.在“MCU设置”下,有“Floating point unit”和“Floating point ABI”两个选项,我分别改为“None”和“Software implementation”。 After saving these configuration changes, I went to the system_stm32f4xx.c file under the src/ directory of the project, and commented out these lines:保存这些配置更改后,我转到项目 src/ 目录下的 system_stm32f4xx.c 文件,并将这些行注释掉:

  /* FPU settings ------------------------------------------------------------*/
  #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
    SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2));  /* set CP10 and CP11 Full Access */
  #endif

After that, I cleaned the project, rebuilt it, and relaunched the debugger.之后,我清理了项目,重建了它,并重新启动了调试器。 It then functioned normally.然后它正常运行。

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

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