Either STM messed up big time or someone can't write datasheets properly. CCMSRAM is faulty.
Why is the stack leaking into the CCMSRAM? First of all, the linker script provided for the G4 is just awful. It combined all three SRAM memories into one general location. Why? Thanks for the manual work I have to do to redefine them.
Second, CCMRAM is defined at 0x1000 0000 with an alias at 0x2000 5800. 10KB of CCM SRAM as specified in the datasheet.
If you allocate an array (int32_t var[8][320]) at 0x1000 0000 to fill up the entire 10KB and you write to all of it with a certain number, immediately after the upper locations are being over written with random garbage which I assume are coming from the main stack. [7][300] to [7][300] will contain random garbage.
Either the CCM SRAM is not 10KBytes like STM32 claims or there is a hardware issue which causes memory overlaps. The stack pointer (_estack) is defined at 0x20008000 which is at the end of the CCMRAM, yet it leaks backwards. (The code does nothing that would make the stack underflow either, it's an infinite loop that does nothing).
Anyone care to explain? I've never seen this before on previous STM chips.
