Hello
I am trying to get %-age of using RAM and FLASH memory sections for
microcontroller

(toolchain: xPack for RISC-V, GCC-12.2) When I'm using the first notation:
-

    .stack ORIGIN(RAM) + LENGTH(RAM) - __stack_size :
    {
        . = ALIGN(4);
        PROVIDE(_susrstack = . );
        . = . + __stack_size;
        PROVIDE( _eusrstack = .);
    } >RAM

I've got 100% usage of RAM.

When I'm using the next one notation:

    .stack :
    {
        . = ALIGN(4);
        PROVIDE(_susrstack = . );
        . = . + __stack_size;
        PROVIDE( _eusrstack = .);
    } >RAM

I've got 3% of RAM usage.

But in fact I've just moved the stack inside the section.


When I'm using old one GCC 8.3 - everything is OK in both cases.
LD file there:

https://github.com/sadkotheguest/ch32v307-cmake-vsc-noos-template/blob/main/wch/Ld/Link.ld


Regards Boris

Reply via email to