Skip to content

Commit

Permalink
STM32H7: Add support for RAM4 & RAM5, cleanup
Browse files Browse the repository at this point in the history
* added: Linker script adds support for RAM4 and RAM5 memory regions, so
  that those are usable by code. This also fixes the fact that RAM4 was
  declared, but inaccessible previously
* changed: RAM1 is renamed to RAM2, shifting numbering of all regions.
  This is done in order to be in line with other STM32 definitions,
  similarly ROM1 became ROM2.
  • Loading branch information
ventZl authored and karlp committed Mar 3, 2022
1 parent af3b62c commit 5c65f0f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ld/devices.data
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,16 @@ stm32g4?[34]?c* stm32g4ccm ROM=256K RAM=96K CCM=32K
stm32g4?[34]?e* stm32g4ccm ROM=512K RAM=96K CCM=32K

# For STM32H7 CCM is called D-TCM
stm32h72[35]?e* stm32h7xxxe RAM=128K RAM1=16K RAM2=16K RAM4=16K CCM=128K
stm32h72[35]?g* stm32h7xxxg RAM=128K RAM1=16K RAM2=16K RAM4=16K CCM=128K
stm32h730?b* stm32h7xxxb RAM=128K RAM1=16K RAM2=16K RAM4=16K CCM=128K
stm32h73[35]?g* stm32h7xxxg RAM=128K RAM1=16K RAM2=16K RAM4=16K CCM=128K
stm32h742?i* stm32h7xxxi RAM=384K RAM1=32K RAM2=16K RAM4=64K CCM=128K
stm32h742?g* stm32h74xxg RAM=384K RAM1=32K RAM2=16K RAM4=64K CCM=128K
stm32h74[357]?i* stm32h7xxxi RAM=512K RAM1=128K RAM2=128K RAM3=32K RAM4=64K CCM=128K
stm32h74[357]?g* stm32h74xxg RAM=512K RAM1=128K RAM2=128K RAM3=32K RAM4=64K CCM=128K
stm32h75[357]?i* stm32h7xxxi RAM=512K RAM1=128K RAM2=128K RAM3=32K RAM4=64K CCM=128K
stm32h750?b* stm32h7xxxb RAM=512K RAM1=128K RAM2=128K RAM3=32K RAM4=64K CCM=128K
stm32h72[35]?e* stm32h7xxxe RAM=128K RAM2=16K RAM3=16K RAM5=16K CCM=128K
stm32h72[35]?g* stm32h7xxxg RAM=128K RAM2=16K RAM3=16K RAM5=16K CCM=128K
stm32h730?b* stm32h7xxxb RAM=128K RAM2=16K RAM3=16K RAM5=16K CCM=128K
stm32h73[35]?g* stm32h7xxxg RAM=128K RAM2=16K RAM3=16K RAM5=16K CCM=128K
stm32h742?i* stm32h7xxxi RAM=384K RAM2=32K RAM3=16K RAM5=64K CCM=128K
stm32h742?g* stm32h74xxg RAM=384K RAM2=32K RAM3=16K RAM5=64K CCM=128K
stm32h74[357]?i* stm32h7xxxi RAM=512K RAM2=128K RAM3=128K RAM4=32K RAM5=64K CCM=128K
stm32h74[357]?g* stm32h74xxg RAM=512K RAM2=128K RAM3=128K RAM4=32K RAM5=64K CCM=128K
stm32h75[357]?i* stm32h7xxxi RAM=512K RAM2=128K RAM3=128K RAM4=32K RAM5=64K CCM=128K
stm32h750?b* stm32h7xxxb RAM=512K RAM2=128K RAM3=128K RAM4=32K RAM5=64K CCM=128K

################################################################################
# the SAM3 chips
Expand Down Expand Up @@ -537,8 +537,8 @@ stm32h7xxxb stm32h7 ROM=128K
stm32h7xxxe stm32h7 ROM=512K
# stm32h72xxxg and stm32h73xxxg
stm32h7xxxg stm32h7 ROM=1M
stm32h74xxg stm32h7 ROM=512K ROM1=512K
stm32h7xxxi stm32h7 ROM=1M ROM1=1M
stm32h74xxg stm32h7 ROM=512K ROM2=512K
stm32h7xxxi stm32h7 ROM=1M ROM2=1M

################################################################################
# the SAM3 family groups
Expand Down
20 changes: 20 additions & 0 deletions ld/linker.ld.S
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ MEMORY
#if defined(_RAM3)
ram3 (rwx) : ORIGIN = _RAM3_OFF, LENGTH = _RAM3
#endif
#if defined(_RAM4)
ram4 (rwx) : ORIGIN = _RAM4_OFF, LENGTH = _RAM4
#endif
#if defined(_RAM5)
ram5 (rwx) : ORIGIN = _RAM5_OFF, LENGTH = _RAM5
#endif
#if defined(_CCM)
ccm (rwx) : ORIGIN = _CCM_OFF, LENGTH = _CCM
#endif
Expand Down Expand Up @@ -168,6 +174,20 @@ SECTIONS
} >ram3
#endif

#if defined(_RAM4)
.ram4 : {
*(.ram4*)
. = ALIGN(4);
} >ram4
#endif

#if defined(_RAM5)
.ram5 : {
*(.ram5*)
. = ALIGN(4);
} >ram4
#endif

#if defined(_XSRAM)
.xsram : {
*(.xsram*)
Expand Down

0 comments on commit 5c65f0f

Please sign in to comment.