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

hw/mcu/stm32f4: Use common startup code #3205

Merged
merged 5 commits into from
May 15, 2024

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented Apr 24, 2024

Change STM32F4 to use common startup code and liner script.

Additionally to utilize CCM memory common linker script for cortex-m4
introduces separate memory region for CMU stack.

Stack was always placed at the end of region RAM.
This adds separate memory region for MCU stack.
For some MCUs it is more convenient to place stack in separate memory
space and that was not possible without custom linker script.

__HeapLimit and __HeapBase assignments are simpler to read
__StackTop and __StackLimi as well.

dumplicate .bssnz section is removed
(NOLOAD) attributes added to .bssnz and .bss

.mtb section removed for now

Signed-off-by: Jerzy Kasenberg jerzy.kasenberg@codecoup.pl

Stack was always placed at the end of region RAM.
This adds separate memory region for MCU stack.
For some MCUs it is more convenient to place stack in separate memory
space and that was not possible without custom linker script.

__HeapLimit and __HeapBase assignments are simpler to read
__StackTop and __StackLimi as well.

dumplicate .bssnz section is removed
(NOLOAD) attributes added to .bssnz and .bss

.mtb section removed for now

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
STM32F4 now uses common startup code for Cortex-M4 and
autogenerated linker script.

Flash cache initialization moved to hal_system_init.c to
make system_stm32f4xx.c more like original ST file
so future updates will be easier.

Unused ld scripts remove

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
This removes local startup code and linker scripts

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
This adds memory memory_regions.ld.h for device that have CCM.
MCU stack is also placed in CCM memory instead of RAM region.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
@kasjer kasjer force-pushed the kasjer/stm32f4-common-startup branch from 0205e0d to bcc4e55 Compare May 15, 2024 09:06
Strip stm32 related files that were already removed from core.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
@kasjer kasjer force-pushed the kasjer/stm32f4-common-startup branch from bcc4e55 to 15b655e Compare May 15, 2024 09:17
@kasjer kasjer merged commit 3ed268e into apache:master May 15, 2024
17 checks passed
@kasjer kasjer deleted the kasjer/stm32f4-common-startup branch May 15, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants