dfu_gcc_nrf52.ld 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Linker script to configure memory regions. */
  2. SEARCH_DIR(.)
  3. GROUP(-lgcc -lc -lnosys)
  4. MEMORY
  5. {
  6. /** Flash start address for the bootloader. This setting will also be stored in UICR to allow the
  7. * MBR to init the bootloader when starting the system. This value must correspond to
  8. * BOOTLOADER_REGION_START found in dfu_types.h. The system is prevented from starting up if
  9. * those values do not match. The check is performed in main.c, see
  10. * APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START);
  11. */
  12. FLASH (rx) : ORIGIN = 0x7A000, LENGTH = 0x4000
  13. /** RAM Region for bootloader. This setting is suitable when used with s132. */
  14. RAM (rwx) : ORIGIN = 0x20002C00, LENGTH = 0x5380
  15. /** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information
  16. * from application to bootloader when using buttonluss DFU OTA.
  17. */
  18. NOINIT (rwx) : ORIGIN = 0x20007F80, LENGTH = 0x80
  19. /** Location of bootloader setting in flash. */
  20. BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x0007F000, LENGTH = 0x1000
  21. /** Location in UICR where bootloader start address is stored. */
  22. UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04
  23. /** Location of mbr params page in flash. */
  24. MBR_PARAMS_PAGE (rw) : ORIGIN = 0x0007E000, LENGTH = 0x1000
  25. /** Location in UICR where mbr params page address is stored. */
  26. UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04
  27. }
  28. SECTIONS
  29. {
  30. .fs_data_out ALIGN(4):
  31. {
  32. PROVIDE( __start_fs_data = .);
  33. KEEP(*(fs_data))
  34. PROVIDE( __stop_fs_data = .);
  35. } = 0
  36. /* Place the bootloader settings page in flash. */
  37. .bootloaderSettings(NOLOAD) :
  38. {
  39. } > BOOTLOADER_SETTINGS
  40. /* Write the bootloader address in UICR. */
  41. .uicrBootStartAddress :
  42. {
  43. KEEP(*(.uicrBootStartAddress))
  44. } > UICR_BOOTLOADER
  45. /* Place the mbr params page in flash. */
  46. .mbrParamsPage(NOLOAD) :
  47. {
  48. } > MBR_PARAMS_PAGE
  49. /* Write the bootloader address in UICR. */
  50. .uicrMbrParamsPageAddress :
  51. {
  52. KEEP(*(.uicrMbrParamsPageAddress))
  53. } > UICR_MBR_PARAM_PAGE
  54. /* No init RAM section in bootloader. Used for bond information exchange. */
  55. .noinit(NOLOAD) :
  56. {
  57. } > NOINIT
  58. /* other placements follow here... */
  59. }
  60. INCLUDE "nrf52_common.ld"