I have a strange issue. I am using STM32F767ZIT6 micro controller for my project. Since I ran out of space in ram3 , I tried to use `ram0` using the
Code: Select all
__attribute__((section("DATA_RAM")))
I then declared a "global" struct as follows
Code: Select all
struct Temp_Struct struct_d[NUM_VAL][NUM_VAL_1] __attribute__((section("DATA_RAM"))) = {0};
As per the C standard, all members in the struct should be initialised to zero using the syntax, right? However, I see that a few members are not initialized to zero. When I remove `__attribute__((section("DATA_RAM")))` the members are initialized to zero. Has anyone faced a similar issue, if so did you manage to solve it ?
I did some debugging and noticed the following.
I printed memory usage using
in os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk by editing the following line--print-memory-usage
Code: Select all
LDFLAGS = $(MCFLAGS) $(OPT) -nostartfiles $(LLIBDIR) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--library-path=$(STARTUPLD),--script=$(LDSCRIPT)$(LDOPT),--print-memory-usage
This would however print ram0 as full. This is not true since I have rarely used DATA_RAM (ram0). Does this mean that the linker script is what that's causing the trouble ? The linker could also be wrong since ram1 and ram2 are marked as 0.00% being used, ram0 is the sum of ram1 and ram2.
Code: Select all
Linking build/ch.elf
Memory region Used Size Region Size %age Used
flash0: 297624 B 2 MB 14.19%
flash1: 134672 B 2 MB 6.42%
flash2: 0 GB 0 GB
flash3: 0 GB 0 GB
flash4: 0 GB 0 GB
flash5: 0 GB 0 GB
flash6: 0 GB 0 GB
flash7: 0 GB 0 GB
ram0: 384 KB 384 KB 100.00%
ram1: 0 GB 368 KB 0.00%
ram2: 0 GB 16 KB 0.00%
ram3: 110824 B 128 KB 84.55%
ram4: 0 GB 16 KB 0.00%
ram5: 0 GB 4 KB 0.00%
ram6: 0 GB 0 GB
ram7: 0 GB 0 GB
Thanks and Regards,
Akshai M