idf.py size: no symbol for libfreertos.a reference

pmontes
Posts: 2
Joined: Fri Dec 13, 2024 9:10 am

idf.py size: no symbol for libfreertos.a reference

Postby pmontes » Mon Dec 16, 2024 8:46 am

Hi everyone,

I am using ESP IDF 5.3.1 on Windows through the VS Code extension to build ESP32C3/C6 firmware. I have the following issue running idf.py size after building my project:

Code: Select all

error:  no symbol for "$esp-idf/freertos/libfreertos.a(portasm.S.obj)" reference in the cross reference table
Then the idf.py size JSON output is shown, both in Output -> ESP IDF (bare JSON) and in Terminal -> ESP IDF Size terminal (formatted table) but the graphical view of the size is missing. I understand that the extension stops the GUI size representation due to the error.

Running

Code: Select all

xtensa-esp32-elf-nm -n build/esp-idf/freertos/libfreertos.a > log.txt
in a ESP IDF terminal to rebuild the library, and searching for the missing symbol portasm.S.obj shows

Code: Select all

portasm.S.obj:
         U 
         U esp_hw_stack_guard_monitor_start
         U esp_hw_stack_guard_monitor_stop
         U esp_hw_stack_guard_set_bounds
         U port_uxInterruptNesting
         U port_xSchedulerRunning
         U pxCurrentTCBs
         U vTaskSwitchContext
         U xIsrStackBottom
         U xIsrStackTop
         U xPortSwitchFlag
So perhaps there is a stale symbol here causing idf.py size to fail. How could I further debug/fix this?

The rest of the features seem to work as expected. I noticed the problem after updating from ESP IDF 5.3 to 5.3.1 and reproduced it in a hello world project. idf.py size-components does not show the GUI size information either.

ESP_frhr
Posts: 9
Joined: Tue Jan 10, 2023 10:41 am

Re: idf.py size: no symbol for libfreertos.a reference

Postby ESP_frhr » Mon Dec 16, 2024 1:22 pm

Hello,

apologies for the inconvenience. I believe this issue should be resolved in esp-idf-size 1.6.1 with the following commit: https://github.com/espressif/esp-idf-si ... c516a6cbb6. In this particular instance, the problem was with the '.size' directive for the rtos_current_tcb function in components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S. Although it has been fixed, it does not appear to be included in version 5.3.1.
  1.  
  2. index b737e58d7c2a..5f32c613a00b 100644
  3. --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S
  4. +++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S
  5. @@ -441,7 +441,7 @@ rtos_current_tcb:
  6.      lw      a0, pxCurrentTCBs
  7.  #endif /* ( configNUM_CORES > 1 ) */
  8.      ret
  9. -    .size, .-rtos_current_tcb
  10. +    .size rtos_current_tcb, .-rtos_current_tcb
The .size directive should include the symbol name to which the size is accounted(https://sourceware.org/binutils/docs/as/Size.html). However, for the rtos_current_tcb symbol, this name is absent, as you've observed. This is just for context. The issue lies with esp-idf-size and should be resolved in version 1.6.1. Could you please check the esp-idf-size version, e.g. with pip show esp-idf-size, and try upgrading it using

Code: Select all

pip install -U esp-idf-size


Thank you.

pmontes
Posts: 2
Joined: Fri Dec 13, 2024 9:10 am

Re: idf.py size: no symbol for libfreertos.a reference

Postby pmontes » Thu Jan 16, 2025 11:25 am

ESP_frhr wrote:
Mon Dec 16, 2024 1:22 pm
I believe this issue should be resolved in esp-idf-size 1.6.1 with the following commit: https://github.com/espressif/esp-idf-si ... c516a6cbb6.
Thank you very much, it was solved this way.

Who is online

Users browsing this forum: Google [Bot], ram_0000 and 104 guests