Skip to content

Commit

Permalink
ARM Linker Scripts added.
Browse files Browse the repository at this point in the history
  • Loading branch information
offa committed Sep 8, 2016
1 parent 6d4aa92 commit 79321d2
Show file tree
Hide file tree
Showing 4 changed files with 486 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arm-embedded-toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set(CMAKE_C_FLAGS "${FLAGS_COMMON} ${FLAGS_C}" CACHE STRING "C Compiler Flags")
set(CMAKE_CXX_FLAGS "${FLAGS_COMMON} ${FLAGS_CXX}" CACHE STRING "C++ Compiler Flags")


set(FLAGS_LINKER "-flto -nostartfiles -Xlinker --gc-sections --specs=nano.specs" CACHE INTERNAL "Linker flags")
set(FLAGS_LINKER "-flto -nostartfiles -Xlinker --gc-sections --specs=nano.specs -T mem.ld -T libs.ld -T sections.ld -L${PROJECT_SOURCE_DIR}" CACHE INTERNAL "Linker flags")

set(CMAKE_EXE_LINKER_FLAGS "${FLAGS_LINKER}" CACHE STRING "Linker flags")
set(CMAKE_MODULE_LINKER_FLAGS "${FLAGS_LINKER}" CACHE STRING "Module Linker Flags")
Expand Down
8 changes: 8 additions & 0 deletions ldscripts/libs.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

/*
* Placeholder to list other libraries required by the application.

GROUP(
)

*/
32 changes: 32 additions & 0 deletions ldscripts/mem.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Memory Spaces Definitions.
*
* Need modifying for a specific board.
* FLASH.ORIGIN: starting address of flash
* FLASH.LENGTH: length of flash
* RAM.ORIGIN: starting address of RAM bank 0
* RAM.LENGTH: length of RAM bank 0
*
* The values below can be addressed in further linker scripts
* using functions like 'ORIGIN(RAM)' or 'LENGTH(RAM)'.
*/

MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
MEMORY_ARRAY (xrw) : ORIGIN = 0x20002000, LENGTH = 32
}

/*
* For external ram use something like:

RAM (xrw) : ORIGIN = 0x64000000, LENGTH = 2048K

*/
Loading

0 comments on commit 79321d2

Please sign in to comment.