Skip to content

Commit e7eba64

Browse files
committed
targets/esp32: add .rxring and .wifibss sections to DRAM1
Place espradio's RX ring buffer and WiFi-only BSS (ISR tables, timer slots, ISR ring) in SRAM1 pool 7/6 ahead of the arena. Frees ~14 KB of SRAM2 for the Go GC heap. The arena assertion still guarantees ≥32 KB remains for WiFi DMA buffers. Signed-off-by: deadprogram <ron@hybridgroup.com>
1 parent 0fe4c61 commit e7eba64

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

targets/esp32.ld

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,24 @@ SECTIONS
101101
_wifi_bss_end = ABSOLUTE(.);
102102
} >DRAM
103103

104-
/* WiFi blob arena (DMA buffers): owns all of DRAM1 (SRAM1 pool 7/6,
105-
* 0x3FFF0000-0x40000000, 64K) — the only SRAM1 region safe from ROM/MAC
106-
* writes. Outside the Go GC heap; DMA-capable; isolated from GC objects. */
104+
/* RX ring buffer: placed in DRAM1 (ahead of the arena) to free ~9.6 KB
105+
* of SRAM2 for the Go GC heap. espradio's netif.c tags the RX ring
106+
* with __attribute__((section(".rxring"))) on ESP32. */
107+
.rxring (NOLOAD) : ALIGN(16)
108+
{
109+
*(.rxring .rxring.*)
110+
} >DRAM1
111+
112+
/* WiFi-only BSS: ISR tables, timer slots, and ISR ring buffers moved
113+
* from SRAM2 to DRAM1 to free ~2.8 KB for the Go GC heap. */
114+
.wifibss (NOLOAD) : ALIGN(4)
115+
{
116+
*(.wifibss .wifibss.*)
117+
} >DRAM1
118+
119+
/* WiFi blob arena (DMA buffers): owns the remainder of DRAM1 (SRAM1
120+
* pool 7/6) after the RX ring. Outside the Go GC heap; DMA-capable;
121+
* isolated from GC objects. */
107122
.arena (NOLOAD) : ALIGN(16)
108123
{
109124
_arena_start = ABSOLUTE(.);

0 commit comments

Comments
 (0)