Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32 Define start of stack separately from heap end. #4789

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@chrismas9
Copy link
Contributor

commented May 14, 2019

boards/*.ld Add _sstack symbol. Define stack and heap in a clearer way.
gccollect.h, main.c, pybthread.c, stm32_it.c Use _sstackk instead of _heap_end
modmachine.c machine.info() print _sstack.

@chrismas9

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

@dpgeorge This format clearly shows the stack and heap size and highlights some anomalies. For example some parts with 256k RAM have 16k stack and other have 32k. H7 with 512k RAM has 16k stack.
Could you please review and adjust stack sizes as you see fit?

@chrismas9

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

i would like to clean up the MEMORY section of the linker scripts to be more consistent and make it more obvious what the RAM block sizes are and what they are used for. The reason is to make it easier to configure custom ports that need variations of the linker script, eg to use small cache for external FS, move stack to CCRAM, etc. It won't change any memory allocations. Should that be another commit, or a separate PR?

@dpgeorge

This comment has been minimized.

Copy link
Member

commented May 15, 2019

The reason is to make it easier to configure custom ports that need variations of the linker script, eg to use small cache for external FS, move stack to CCRAM, etc.

A given board can easily use its own linker script to declare the MEMORY section, it doesn't need to use any of the shared provided ones. See #4043 for a related discussion.

Should that be another commit, or a separate PR?

Let's do it a step at a time, so please make it a separate PR.

@dpgeorge

This comment has been minimized.

Copy link
Member

commented May 15, 2019

Note that the STM32F769DISC board doesn't build with this patch.

STM32 Define start of stack separately from heap end.
boards/*.ld  Add _sstack symbol. Define stack and heap in a clearer way.
gccollect.h, main.c, pybthread.c, stm32_it.c  Use _sstackk instead of _heap_end
modmachine.c machine.info()  print _sstack.

@chrismas9 chrismas9 force-pushed the chrismas9:SSTACK branch from 6f51d7d to 46f2453 May 15, 2019

@chrismas9

This comment has been minimized.

Copy link
Contributor Author

commented May 15, 2019

All ports compile error free. micropython.mem_info() and mahine.info() report the correct (same) memory ranges after this change on NUCLEO_L432KC and PYBV3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.