Skip to main content
Visitor II
September 12, 2025
Question

STM32 VSCode Build Analyzer: .map file not detected when project folder name differs from target name

  • September 12, 2025
  • 1 reply
  • 418 views

Environment:
- STM32Cube VSCode Extension (with Build Analyzer)
- CMake-based project generated by STM32CubeMX
- Windows 11 / GCC toolchain

Issue:
- The Build Analyzer fails to detect the .map file and reports "NO_MAP_FILE".
- Investigation shows that the analyzer seems to only look for a .map file named after the *project folder*
(e.g. build/Debug/<project_folder>.map).
- However, in CMake projects the actual build target name is derived from ${CMAKE_PROJECT_NAME}, which can differ
from the folder name.
(In my case: project name = VaporChamberController_V2, folder name = VaporChamberController_V2_vscode).

Steps to reproduce:
1. Create a project where the folder name and project name are different.
2. Build the project with CMake.
3. A .map file is generated (using the target name), but the Build Analyzer shows "NO_MAP_FILE".

Workaround:
- Manually force the linker to generate a .map file with the folder name using `target_link_options()`.

Suggestion:
- Modify the Build Analyzer to also check for .map files named after the target (same as the ELF file name).
- Alternatively, provide a VSCode setting that allows the user to configure the .map file name/pattern that the analyzer should use.

This would make the analyzer more robust and prevent confusion when project folder names and target names differ.

    This topic has been closed for replies.

    1 reply

    Explorer
    September 16, 2025

    I just hit this issue. Pretty annoying. My solution was to make a subfolder with the project name and move everything into that, regenerate with MX, then it was happy.