ARM Cortex M4 Blink Example (Linker Script)
FreeLinker script for ARM Cortex-M4 memory configuration
FreeFree tier
About ARM Cortex M4 Blink Example (Linker Script)
This page provides a linker script for ARM Cortex-M4 microcontrollers, lightly modified from the standard gcc.ld script in the GCC Arm Embedded samples. It configures memory regions (FLASH at 0x08000000 with 1024K, RAM at 0x20000000 with 112K) and defines symbols such as copy_table and zero_table for data initialization and BSS clearing in the startup code. The script is part of an ARM Cortex M4 Blink Example and is intended for bare-metal embedded development with the GCC toolchain.
Key Features
Configures FLASH (1MB) and RAM (112K) memory regions with origin and length
Defines __copy_table__ and __zero_table__ symbols for data initialization and BSS clearing
Supports entry point symbol Reset_Handler
Includes sections: .text, .data, .bss, .heap, .stack, .ARM.exidx, etc.
Provides symbols for stack top, stack limit, and heap limit
Lightly modified version of GCC Arm Embedded gcc.ld script
Pros & Cons
Pros
- Based on standard GCC script for easy integration with ARM Embedded toolchain
- Includes necessary symbols for data copying and BSS initialization
- Well-commented for understanding section placement
Cons
- Requires modification for specific board (flash/ram sizes) not covered by default values
- Only targets ARM Cortex-M4 architecture
- Assumes familiarity with GCC linker scripts and embedded startup code
Best For
Embedded systems development on ARM Cortex-M4Configuring memory layout for GCC-based bare-metal projectsDefining startup code symbols for data and BSS sections
FAQ
What is the purpose of this linker script?
It configures memory regions (FLASH and RAM) for an ARM Cortex-M4 microcontroller and defines symbols for data section initialization and BSS clearing in the startup code.
How do I modify the script for a different board?
Change the ORIGIN and LENGTH values for FLASH and RAM in the MEMORY block to match your board's memory map.
What symbols are defined by this script?
Symbols include __copy_table_start__, __copy_table_end__, __zero_table_start__, __zero_table_end__, __etext, __data_start__, __data_end__, __bss_start__, __bss_end__, __StackTop, __StackLimit, __HeapLimit, and others.