2021-06-16 01:51 AM
Hi ,
Default values of the _Min_Heap_Size and _Min_Stack_Size is setting according to What? I changed these variables from 0x200 , 0x400 to 0x00 and 0x00 resprectively ,end then no problem,no error .I guess that Static and dynamic variables in RAM are in the RAM Base Addr + (_Min_Heap_Size or _Min_Stack_Size ) . Why are they 512 byte and 1K byte as default?
Best regards,
Enes.
2021-06-16 06:05 AM
> Why are they 512 byte and 1K byte as default?
Why anything? They are what they are, change them to what you need. Those are the defaults in the linker template file. The code generator doesn't do any sort of smart evaluation of your project needs and set them according to that, if that's what you're curious about.
Note that these just ensure the space is there. Setting them to a value that clearly won't work (i.e. stack size of 0) won't throw an error.
2021-06-17 12:01 AM
I wonna to focus this problem again, why this is implementded like this? If i change for example stack location to CCRAM, linker will still check if stack size will fit into RAM.
Please change this.
2021-06-17 04:20 AM
"again, why this is implementded like this?"
Again, why not?
They are just defaults - the whole point of defaults is that you change them if they don't fit your requirements.
"Please change this."
Change it to what, exactly?
Don't forget to keep your cross-post updated:
2021-06-17 04:24 AM
Why? in this implemetation, memory reservation for stack is independent to it's location.
2021-06-17 06:14 AM
> why this is implementded like this?
Because it works for the default configuration. If you want something else, you need to own the liker code and modify it accordingly. CubeMX implements a subset of the virtually infinite possible configurations.
Keep in mind the capabilities of the linker are limited to the 1980s technology/syntax from when it was developed.
2021-06-18 12:20 AM
Your explanation can't be accepted.
How hard is to remove this line:
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
and after stack input section add
_estack = .;
Then initial stack pointer will points to proper reserved location.
Before any reply, plaase check linker and startup files templates in CMSIS5.
2021-06-18 06:08 AM
Hi,
I can't understand what these (_Min_Heap_Size and _Min_Stack_Size) default values are respect to. The Values of an another ST MCU which has a different RAM size are different others, for example instead of this:
_Min_Heap_Size = 0x200 ; /* required amount of heap */
_Min_Stack_Size = 0x400 ; /* required amount of stack */
like this:
_Min_Heap_Size = 0x100 ; /* required amount of heap */
_Min_Stack_Size = 0x200 ; /* required amount of stack */
If I need to ask for you more clearly , Are These DEFAULT values chosen randomly or else is there a special reason?
2021-06-18 08:30 AM
> How hard is to remove this line:
> _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
> and after stack input section add
> _estack = .;
That would do something different. It would place it at the end of the used space, but not at the end of RAM (unless you were using 100% of RAM). But if that's what you want, do it.
> Are These DEFAULT values chosen randomly or else is there a special reason?
Neither.
2021-06-18 01:15 PM
Hi @TDK ,
Neither.
Thanks a lot for that your fabuluos explanatory answer.
Best Regards.