Skip to content

ESP-IDF Size error: cannot read linker map file. (Fails to expand '${PROJ_NAME_VAL}.map') #1737

@rmain-afk

Description

@rmain-afk

OS

Windows

Operating System version

Windows 11

Visual Studio Code version

1.107.1

ESP-IDF version

5.5.1

Python version

3.11.2

Doctor command output

Doctor Command report:
report.txt

Extension

esp_idf_vsc_ext.log:
esp_idf_vsc_ext.log

Description

I've had to club the ESP-IDF VSCode extension over the head to get the app renamed. I have several configurations to build variants of my code. Each variant gets a unique name so the esp_app_desc_t structure can be used to validate the image is the correct one by an OTA bootloader prior to burning it to flash. I am using 'esp_idf_project_configuration.json' to define my configurations (variants), and pass a command line define to define the configured project name (as below).

"build": {
   "compileArgs": ["-DAPP_PROJECT_NAME=app-SAFX"],
   ...

My CMakeLists.txt attached:
CMakeLists.txt
Note that I finally settled on setting 'PROJ_NAME_VAL' to the desired name in CMakeLists.txt, since this is supposed to be an internal CMake variable, which should guarantee the change is reflected in the CMake cache.

The build completes properly (with the file renamed, and esp_app_desc struct correct), BUT at the 'ESP-IDF Size' step used to display a synopsis of file size & components, I receive the error:

*  Executing task: espressif.esp-idf-extension: ESP-IDF Size 

error:  cannot read linker map file: [Errno 2] No such file or directory: 'c:\\...\\${PROJ_NAME_VAL}.map'

*  The terminal process terminated with exit code: 1. 

The path to the map file should be expanded (i.e., '${PROJ_NAME_VAL}.map' SHOULD become 'app-SAFX.map'

Debug Message

*  Executing task: espressif.esp-idf-extension: ESP-IDF Size 

error:  cannot read linker map file: [Errno 2] No such file or directory: 'c:\\...\\${PROJ_NAME_VAL}.map'

*  The terminal process terminated with exit code: 1. 

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-reportBug Report from users on Github (don't use this tag manually, its supposed to be used via the issue)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions