I am new to zephyr. Inherited a project whose target is an STM32H747I-DISCO Devkit.
I am trying to determine how to modify the compiler/linker flags used during the build. The build is using west/CMake (which are also new to me). I have run the cmd:
west -v build -b stm32h747i_disco_m7 — -DSHIELD=st_b_lcd40_dsi1_mb1166_a09
to successfully build the project and print out all of the build process details. After going thru those details there are some flags used during the build which seem questionable/suspicious and that I would like to experiment with to see what the effects of changing those flags would be. (for example, removing the flags -mthumb, -ffunction-sections).
The thing that is driving me to delve into the build process/details is that I am concerned we are running out of RAM, or more specifically on-chip RAM. The build output shows:
Memory region Used Size Region Size %age Used
FLASH: 363268 B 1 MB 34.64%
RAM: 441160 B 512 KB 84.14%
EXTMEM: 0 GB 256 MB 0.00%
SRAM1: 0 GB 128 KB 0.00%
SRAM2: 0 GB 128 KB 0.00%
SRAM3: 16 KB 32 KB 50.00%
SRAM4: 48 KB 64 KB 75.00%
SDRAM2: 3000 KB 32 MB 9.16%
IDT_LIST: 0 GB 32 KB 0.00%
I clearly have plenty of SDRAM2 available. I do not know how/what is being assigned to SDRAM2 currently, or how to place specific data in SDRAM2 or EXTMEM as opposed to its current placement in RAM. The usage of the 512K of on-chip RAM ballooned from 36% to 84% when we incorporated some MATLAB code generated code into the project. The MATLAB code is statically assigned several large double arrays used for DSP. If I can move those to EXTRAM or SDRAM2, I believe that would put our RAM availability concerns to rest.
I would also be interested in determining how to have the compiler output a mixed C/assembly output file to understand better how zephyr implements its ISRs,tasks,etc. I presume to do so would be another compiler flag.
I tried modifying the compiler_flags.cmake file to add/remove the desired changes. No matter what changes I made, it caused the build to break immediately—before it even invoked the compiler command, which makes no sense to me.
Any help with any of the issues I’ve raised would be very much appreciated. THANKS!!