Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


builtin lib make executable file bigger

Hi STworld:

There are some functions in builtin lib that I don’t use but they takes about 10KB in my executable bin file. They are
function size(hex) size(dec)
_dtoa_r 0xea8 3752
_malloc_r 0x524 1316
_realloc_r 0x3ec 1004
_svfprintf_r 0x14d0 5328

I see them in output.map as functions in libc.a.
If I don’t use them, can I remove them out from my bin file? And how to do that?

By the way, I am uisng STM32F427ZI on AC6 IDE. Additional, I check on -ffunction-sections and -fdata-sections for MCU GCC Compiler. I also discard unused section (-WI,-gc-sections)

in linkerscript.ld file, I see the section:
DISCARD :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}

I try to remove that section but isn’t successfull to reduce my bin file size.

Everyone, please help.

Best regards,
Hung Phan

France

Hi Hung,

If these functions are included in your executable it’s because some other function that you call need them; it’s not always simple to know which is the responsible function but you should be able by carefully looking at the content of the map file; currently I regretfully can’t help you more. There’s quite a lot of functions in the C library that need malloc for example and I don’t know which one you called...

Bernard


Thanks Bernard. I will look at all functions I used to figure out which are using those lib function.

Hung Phan


 

Newest Forum Posts

  1. reservation car service Seattle by Jamesprede, 2025-05-01 10:06
  2. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  10. Build a project in "release" mode by tang, 2025-02-20 10:36

Last-Modified Blogs