Advertisement
nis

generic_sections_flash.c for stm32/example/00-enable-led

nis
Jan 27th, 2012
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. /**
  2. * Karl Palsson, 2011
  3. * Considered to be released into the public domain
  4. *
  5. * Generic "boot from flash" linker script.
  6. *
  7. * This file simply defines how sections should get written.
  8. * You should INCLUDE this file from another file, that specifies the
  9. * memory map for the part you are using.
  10. */
  11.  
  12. SECTIONS
  13. {
  14. . = ORIGIN(FLASH);
  15. .text :
  16. {
  17. *(.vectors) /* Vector table */
  18. *(.vectors.*) /* Any extra device vectors */
  19. *(.text) /* Program code */
  20. *(.rodata) /* Read only data */
  21. *(.rodata*)
  22. __text_end = .;
  23. } >FLASH
  24.  
  25. /*
  26. * This is the initialized data section
  27. * The program executes knowing that the data is in the RAM
  28. * but the loader puts the initial values in the FLASH (inidata).
  29. * One task of "startup" is to copy the initial values from FLASH to RAM.
  30. */
  31. .data :
  32. {
  33. /* This is used by the startup in order to initialize the .data secion */
  34. PROVIDE (__data_start = .);
  35. *(.data)
  36. *(.data.*)
  37. /* This is used by the startup in order to initialize the .data secion */
  38. PROVIDE (__data_end = .);
  39. } >RAM AT >FLASH
  40.  
  41.  
  42. .bss :
  43. {
  44. PROVIDE(__bss_start = .);
  45. *(.bss)
  46. *(COMMON)
  47. . = ALIGN(4);
  48. PROVIDE(__bss_end = .);
  49. } >RAM
  50.  
  51. . = ALIGN(4);
  52.  
  53. _stack_start = .;
  54.  
  55. }
  56.  
  57. _end = .;
  58.  
  59. PROVIDE(_estack = ORIGIN(RAM) + LENGTH(RAM) - 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement