understood you. it may well be that I got on the stack = ((jimmo wrote: ↑Sun Feb 14, 2021 10:50 pmI don't see where you're defining _sstack, but what it looks like is happening is that you're now making the heap use the entire SRAM1+SRAM2 (after ebss), which means it will collide with the stack. I imagine this will look like it's working until it doesn't.
0x20020000 is the same as ORIGIN(RAM) + LENGTH(RAM)
If you want to do this (make the heap use the entire remaining SRAM1+SRAM2, after ebss), then you need to move the stack somewhere else. It appears that's what Chris is doing, I imagine he's setting sstack and estack to put it in CCM. Because the stack is 16kiB, that's why he gets 16kiB of extra heap.
You need to be careful because the CCM is used for the flash cache. I don't think the filesystem uses any flash blocks larger than 16k (it uses the first four blocks, as you can see in the linker script).
try another approach.
can i change the linker script?
I want to resize the Flash FS and Flash Text areas.
I tried to make
Code: Select all
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
FLASH_TEXT (rx) : ORIGIN = 0x08004000, LENGTH = 752K /* sectors 1,2,3,4,5,6,7,8,9 */
FLASH_FS (rx) : ORIGIN = 0x080C0000, LENGTH = 256K /* sectors 10,11 are for filesystem */
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
}
Code: Select all
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* entire flash */
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 112K /* sectors 1,2,3,4 are for filesystem */
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 896K /* sectors 5,6,7,8,9,10,11 */
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K