firmware.ld 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ENTRY(HandlerReset)
  2. _estack = 0x20004000; /* end of 16K RAM */
  3. _Min_Heap_Size = 0; /* required amount of heap */
  4. _Min_Stack_Size = 0x80; /* required amount of stack */
  5. MEMORY
  6. {
  7. FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 60K
  8. RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
  9. }
  10. SECTIONS
  11. {
  12. /* Program code */
  13. .text :
  14. {
  15. . = ALIGN(4);
  16. KEEP(*(.text.isr)) /* .text sections of code */
  17. *(.text) /* .text sections of code */
  18. *(.text*) /* .text* sections of code */
  19. *(.rodata) /* .rodata sections */
  20. *(.rodata*) /* .rodata* sections */
  21. *(.glue_7) /* Glue arm to thumb code */
  22. *(.glue_7t) /* Glue thumb to arm code */
  23. *(.eh_frame)
  24. KEEP(*(.fini))
  25. . = ALIGN(4);
  26. _etext = .; /* global symbols at end */
  27. } >FLASH
  28. /* Used by startup code */
  29. . = ALIGN(4);
  30. flash_data_start = .;
  31. .data :
  32. {
  33. . = ALIGN(4);
  34. sram_data_start = .;
  35. *(.sramtext)
  36. *(.srambss)
  37. *(.data) /* .data sections */
  38. *(.data*) /* .data* sections */
  39. . = ALIGN(4);
  40. _edata = .; /* Global symbol at data end */
  41. } >RAM AT> FLASH
  42. sram_data_end = .;
  43. /* Uninitialized data */
  44. . = ALIGN(4);
  45. .bss :
  46. {
  47. _sbss = .; /* Global symbol at bss start */
  48. __bss_start__ = _sbss;
  49. *(.bss)
  50. *(.bss*)
  51. *(COMMON)
  52. . = ALIGN(4);
  53. _ebss = .; /* Global symbol at bss end */
  54. __bss_end__ = _ebss;
  55. } >RAM
  56. /* Check that there is enough RAM */
  57. ._user_heap_stack :
  58. {
  59. . = ALIGN(4);
  60. . = . + _Min_Heap_Size;
  61. . = . + _Min_Stack_Size;
  62. . = ALIGN(4);
  63. } >RAM
  64. }