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


How to find the memory usage

Hi

I am using the STM32F072 part with system workbench. How do I find out how much of the flash and RAM the program has used?

Thanks

Jon

You can set the post-build call to output that information to the console in a more readable format.

Project Settings -> C/C++ Build -> Settings -> Build Steps tab, look for the post-build steps command. There is already a call to arm-none-eabi-size at the end, if you insert --format=sysv afterwards you should get a nicer printout.

My total command looks like: arm-none-eabi-objcopy -O binary “${BuildArtifactFileBaseName}.elf” “${BuildArtifactFileBaseName}.bin” && arm-none-eabi-size --format=sysv “${BuildArtifactFileName}”

When the code builds, I get output on the console that has a table with the size in bytes of each section:

section size addr
.isr_vector 456 2097152
.text 21336 2097616
.itcm_ram 100 2118952
.rodata 304 2119052
.init_array 4 2119356
.fini_array 4 2119360
.data 5704 536870912
.bss 7244 536876616
._user_heap_stack 1540 536883860
.ARM.attributes 48 0
.debug_info 113664 0
.debug_abbrev 12731 0
.debug_loc 61914 0
.debug_aranges 4976 0
.debug_ranges 4544 0
.debug_macro 171041 0
.debug_line 79704 0
.debug_str 1008400 0
.comment 110 0
.debug_frame 14624 0
Total 1508448

As above but with
 --format=berkeley 
instead of
 --format=sysv
will give you output that may be more what you had in mind. For example:


arm-none-eabi-size --format=berkeley   src/*.o libraries/common/*.o 

   text	   data	    bss	    dec	    hex	filename
   1503	      0	      0	   1503	    5df	src/main.o
    339	      0	      0	    339	    153	libraries/common/assert.o
     84	      0	      0	     84	     54	libraries/common/compensator.o
    516	      4	     64	    584	    248	libraries/common/edgetracker.o
    328	      0	      0	    328	    148	libraries/common/ffcompensator.o
    696	      0	      0	    696	    2b8	libraries/common/leadcompensator.o
    682	  49161	    168	  50011	   c35b	libraries/common/logger.o

 

Newest Forum Posts

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

Last-Modified Blogs