Skip to content

Commit

Permalink
bsp/stm32f74x: Fix RAM and DTCM description
Browse files Browse the repository at this point in the history
Start or RAM and size of DTCM were taken from STM32F76x series.

DTCM should be 64KB
and RAM1 should start at 0x20010000

Signed-off-by: Jerzy Kasenberg <[email protected]>
  • Loading branch information
kasjer committed Jan 28, 2025
1 parent 10c36bd commit d3bcc56
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 3 deletions.
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
38 changes: 38 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,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.
*/

/*
* 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

0 comments on commit d3bcc56

Please sign in to comment.