esp32.template 2.2 KB

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