Skip to content

Commit adb95d8

Browse files
dimajolkindeadprogram
authored andcommitted
WiFi/BLE ROM
1 parent 9e2288b commit adb95d8

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/internal/task/task_stack_tinygoriscv.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,8 @@ func (s *state) pause() {
7171
func SystemStack() uintptr {
7272
return *runtime_systemStackPtr()
7373
}
74+
75+
//export tinygo_task_current
76+
func tinygo_task_current() unsafe.Pointer {
77+
return unsafe.Pointer(Current())
78+
}

targets/esp32c3.ld

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@
2929

3030
MEMORY
3131
{
32-
/* Note: DRAM and IRAM below are actually in the same 384K address space. */
33-
DRAM (rw) : ORIGIN = 0x3FC80000, LENGTH = 384K /* Internal SRAM 1 (data bus) */
34-
IRAM (x) : ORIGIN = 0x40380000, LENGTH = 384K /* Internal SRAM 1 (instruction bus) */
32+
/* Note: DRAM and IRAM below are actually in the same 384K address space.
33+
* WiFi/BLE ROM variables occupy 0x3FCCE710..0x3FCDFFFC, so DRAM must
34+
* stop before that boundary to prevent the Go heap from overwriting them.
35+
*/
36+
DRAM (rw) : ORIGIN = 0x3FC80000, LENGTH = 0x4E710 /* ends at 0x3FCCE710 — WiFi/ROM boundary */
37+
IRAM (x) : ORIGIN = 0x40380000, LENGTH = 0x4E710
3538

3639
/* Note: DROM and IROM below are actually in the same 8M address space. */
3740
DROM (r) : ORIGIN = 0x3C000000, LENGTH = 8M /* Data bus (read-only) */
@@ -59,6 +62,7 @@ SECTIONS
5962
.rodata : ALIGN(4)
6063
{
6164
*(.rodata*)
65+
*(.srodata*)
6266
. = ALIGN (4);
6367
} >DROM
6468

@@ -83,6 +87,7 @@ SECTIONS
8387
. = ALIGN (4);
8488
_sbss = ABSOLUTE(.);
8589
*(.sbss)
90+
*(.sbss.*)
8691
*(.bss .bss.*)
8792
. = ALIGN (4);
8893
_ebss = ABSOLUTE(.);

0 commit comments

Comments
 (0)