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

bsp/stm32f74x: Fix RAM and DTCM description #3364

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#ifdef STACK_REGION
DTCM (rwx) : ORIGIN = 0x20000000, LENGTH = (64K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x20020000 - STACK_SIZE, LENGTH = STACK_SIZE
STACK_RAM (rw) : ORIGIN = 0x20010000 - STACK_SIZE, LENGTH = STACK_SIZE
#else
DTCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
#endif
Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/nucleo-f746zg/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ syscfg.defs:
value: 8

syscfg.vals:
MCU_RAM_START: 0x20020000
MCU_RAM_START: 0x20010000
MCU_RAM_SIZE: 240K
REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG
CONFIG_FCB_FLASH_AREA: FLASH_AREA_NFFS
Expand Down
37 changes: 37 additions & 0 deletions hw/bsp/stm32f7discovery/link/include/mcu_config.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/*
* Memory regions placed in DTCM
* If stack or core data or other section should be place in RAM
* <target_name>/link/include/target_config.ld.h should just do:
* #undef BSSNZ_RAM
* #undef COREBSS_RAM
* #undef COREDATA_RAM
* #undef STACK_REGION
* #undef VECTOR_RELOCATION_RAM DTCM
*/

#define BSSNZ_RAM DTCM
#define COREBSS_RAM DTCM
#define COREDATA_RAM DTCM
#define STACK_REGION DTCM
#define VECTOR_RELOCATION_RAM DTCM

#define TEXT_RAM ITCM
38 changes: 38 additions & 0 deletions hw/bsp/stm32f7discovery/link/include/memory_regions.ld.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/* Fragment that goes to MEMORY section */
#ifndef SECTIONS_REGIONS

#ifdef STACK_REGION
DTCM (rwx) : ORIGIN = 0x20000000, LENGTH = (64K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x20010000 - STACK_SIZE, LENGTH = STACK_SIZE
#else
DTCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
#endif
ITCM (rx) : ORIGIN = 0x00000000, LENGTH = 16K

#else
/* Fragment that goes into SECTIONS, can provide definition and sections if needed */
_itcm_start = ORIGIN(ITCM);
_itcm_end = ORIGIN(ITCM) + LENGTH(ITCM);
_dtcm_start = ORIGIN(DTCM);
_dtcm_end = ORIGIN(DTCM) + LENGTH(DTCM);

#endif
2 changes: 1 addition & 1 deletion hw/bsp/stm32f7discovery/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ syscfg.defs:
value: 8

syscfg.vals:
MCU_RAM_START: 0x20020000
MCU_RAM_START: 0x20010000
MCU_RAM_SIZE: 240K
REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG
CONFIG_FCB_FLASH_AREA: FLASH_AREA_NFFS
Expand Down
Loading