AnsweredAssumed Answered

.bin file generated by GCC too large

Question asked by Mootaz Amr on May 8, 2017
Latest reply on Mar 1, 2018 by Andrew Neil

Hi ST community members

 

We are working on the optimization of a project's code running on STM32F429ZIT6 µC, in terms of speeding execution, or minimizing latencies due to memory access competition.

Our solution is to reorganize the code by assigning each AHB-bus-matrix's used master to the appropriate SRAM memory block.

To do that, our linker file is reorganized also, and buffers in our code are replaced in the appropriate sections.

 

But surprisingly, the .bin file generated is 384MB sized.

The gcc --version output is : (Sourcery CodeBench Lite 2014.05-28) 4.8.3 20140320 (prerelease)

 

Changes done are as follows:

* ucHeap[ TOTAL_HEAP_SIZE ] __attribute__((section(".bss_SRAM1"))); // FreeRTOS heap (heap4) placed in SRAM1.

* Our Ethernet driver's DMA descriptors, TX and RX buffers placed in SRAM2.

* Other miscellaneous critical buffers placed in CCM RAM.

* remaining data (.data and .bss) placed in SRAM3.

 

You can see attached the sections.ld, mem.ld and a simplified makefile (without projects includes and sources) in the ldscripts.rar.

 

The data sections sizes generated by the compilation process are as follows:

section                         size             addr
.isr_vector                   824             134217728
._inits                          4                  134218552
.flashtext                     0                  134218556
.text                            273296        134218560
.ARM.exidx                8                  134491856
.data                          1916             0
.data_CCMRAM       36                  268435456
.bss_CCMRAM        7560              268435496
.bss_SRAM1           10240             536870912
.bss_SRAM2           12544             536985600
.bss                          49552            1920
.noinit                       0                     51472
._check_stack        256                 51472
.comment                70                   0
.ARM.attributes       53                   0
.debug_aranges      15592             0
.debug_info             528968           0
.debug_abbrev       56895              0
.debug_line             234916            0
.debug_frame         55916              0
.debug_str              629362            0
.debug_ranges      14184               0
.debug_macro       186126             0
Total                       2078318

 

Thanks for help.

Attachments

Outcomes