esp32.ld 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* ESP32 Linker Script Memory Layout
  2. This file describes the memory layout (memory blocks) as virtual
  3. memory addresses.
  4. esp32.common.ld contains output sections to link compiler output
  5. into these memory blocks.
  6. ***
  7. This linker script is passed through the C preprocessor to include
  8. configuration options.
  9. Please use preprocessor features sparingly! Restrict
  10. to simple macros with numeric values, and/or #if/#endif blocks.
  11. */
  12. #include "sdkconfig.h"
  13. MEMORY
  14. {
  15. /* All these values assume the flash cache is on, and have the blocks this uses subtracted from the length
  16. of the various regions. The 'data access port' dram/drom regions map to the same iram/irom regions but
  17. are connected to the data port of the CPU and eg allow bytewise access. */
  18. /* IRAM for PRO cpu. Not sure if happy with this, this is MMU area... */
  19. iram0_0_seg (RX) : org = 0x40080000, len = 0x20000
  20. /* Even though the segment name is iram, it is actually mapped to flash */
  21. iram0_2_seg (RX) : org = 0x400D0018, len = 0x330000
  22. /* Shared data RAM, excluding memory reserved for ROM bss/data/stack.
  23. Enabling Bluetooth & Trace Memory features in menuconfig will decrease
  24. the amount of RAM available.
  25. */
  26. dram0_0_seg (RW) : org = 0x3FFB0000 + CONFIG_BT_RESERVE_DRAM,
  27. len = 0x50000 - CONFIG_TRACEMEM_RESERVE_DRAM - CONFIG_BT_RESERVE_DRAM
  28. /* Flash mapped constant data */
  29. drom0_0_seg (R) : org = 0x3F400010, len = 0x800000
  30. /* RTC fast memory (executable). Persists over deep sleep.
  31. */
  32. rtc_iram_seg(RWX) : org = 0x400C0000, len = 0x2000
  33. /* RTC slow memory (data accessible). Persists over deep sleep.
  34. Start of RTC slow memory is reserved for ULP co-processor code + data, if enabled.
  35. */
  36. rtc_slow_seg(RW) : org = 0x50000000 + CONFIG_ULP_COPROC_RESERVE_MEM,
  37. len = 0x1000 - CONFIG_ULP_COPROC_RESERVE_MEM
  38. }
  39. /* Heap ends at top of dram0_0_seg */
  40. _heap_end = 0x40000000 - CONFIG_TRACEMEM_RESERVE_DRAM;