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

JTAG调试时如何引入IAR内置库(C运行时等)的源代码?

解决IAR EWARM 8.2.22调试C运行时初始化源码的问题

Hey there! As someone who’s worked with IAR and STM32F4 boards, I can walk you through how to get the C runtime initialization source code showing up during debugging. Here’s what you need to do:

  • Check if you have the runtime source code installed
    IAR doesn’t install the CRT (C Runtime) source files by default in all setups. Open IAR and go to Tools > Options > General > Product Information to verify if "Runtime Source Code" or a similar component is listed. If it’s missing, re-run the IAR installer, choose "Modify" installation, and make sure to check the box for ARM Runtime Library Source (or the equivalent for your version).

  • Add the source path to your project’s debug configuration
    Once the source files are installed, configure your project to find them:

    1. Open your STM32F4 project, then go to Project > Options > Debugger > Source.
    2. In the Source lookup paths section, click Add. Navigate to your IAR installation directory—typically something like C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.2\arm\src\lib. This folder contains subdirectories like cstartup, libc, and libm which hold the CRT source code.
    3. Check the Search subdirectories box so the debugger can find nested source files automatically.
  • Ensure debug information is enabled
    If you still can’t see the source, double-check that your project is generating debug info:
    Go to Project > Options > Build > Compiler > Output and confirm that Generate debug information is checked. This ensures the debugger has the links between compiled code and source files.

  • Bonus: Handle STM32 startup assembly code
    For the low-level STM32 startup code (not just IAR’s CRT), you can get the cstartup_stm32f4xx.s file from STM32CubeMX. Export a project with your STM32F4 model, copy the startup file into your IAR project, and add it to the build. This lets you step through the board-specific initialization too.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.29 08:21:33