stm32f0.ld 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* Entry Point */
  2. ENTRY( Reset_Handler )
  3. /* Highest address of the user mode stack */
  4. _estack = 0x20002000; /* end o f 8K RAM */
  5. /* Generate a link error if heap and stack don’t fit int o RAM */
  6. _Min_Heap_Size = 0; /* required amount of heap */
  7. _Min_Stack_Size = 0x200; /* required amount of stack */
  8. MEMORY
  9. {
  10. sram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K
  11. flash (rx) : ORIGIN = 0x08000000, LENGTH = 64K
  12. }
  13. SECTIONS
  14. {
  15. . = 0x08000000; /* From 0x08000000 */
  16. /* for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, which goes to FLASH */
  17. .isr_vector :
  18. {
  19. . = ALIGN(4);
  20. KEEP(*(.isr_vector)) /* Startup code */
  21. . = ALIGN(4);
  22. } >flash
  23. .text :
  24. {
  25. . = ALIGN(4);
  26. *(.text) /* Program code */
  27. *(.text.*)
  28. *(.rodata) /* Read only data */
  29. *(.rodata.*)
  30. *(.glue_7)
  31. *(.glue_7t)
  32. . = ALIGN(4);
  33. _etext = .;
  34. /* This is used by the startup in order to initialize the .data secion */
  35. _sidata = _etext;
  36. } >flash
  37. . = 0x20000000; /* From 0x20000000 */
  38. .data : AT (_sidata)
  39. {
  40. . = ALIGN(4);
  41. _sdata = . ;
  42. *(.data) /* Data memory */
  43. *(.data.*)
  44. . = ALIGN(4);
  45. _edata = . ;
  46. } >sram
  47. .bss :
  48. {
  49. . = ALIGN(4);
  50. _sbss = . ;
  51. *(.bss) /* Zero-filled run time allocate data memory */
  52. *(COMMON)
  53. _ebss = . ;
  54. } >sram
  55. PROVIDE ( end = _ebss );
  56. PROVIDE ( _end = _ebss );
  57. /* This is the user stack section
  58. This is just to check that there is enough RAM left for the User mode stack
  59. It should generate an error if it's full.
  60. */
  61. ._usrstack :
  62. {
  63. . = ALIGN(4);
  64. _susrstack = . ;
  65. . = . + _Min_Stack_Size ;
  66. . = ALIGN(4);
  67. _eusrstack = . ;
  68. } > sram
  69. }