mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 22:13:39 +00:00
machine/esp32c3: implement BlockDevice for esp32c3 flash
- Add `machine_esp32c3_flash.go` to implement the `BlockDevice` interface for ESP32-C3. - Map internal ESP ROM SPI flash and cache invalidation functions via CGo. - Update `targets/esp32c3.ld` to expose `__flash_data_start` and `__flash_data_end` linker variables. - Add `esp32c3` to build tags in `src/machine/flash.go`. - Ensure atomic flash operations by disabling interrupts and invalidating cache to prevent stale reads. Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -161,8 +161,12 @@ SECTIONS
|
||||
*(.text.exception_vectors)
|
||||
. = ALIGN (4);
|
||||
*(.text .text.*)
|
||||
_irom_end = .;
|
||||
} >IROM
|
||||
|
||||
PROVIDE(__flash_data_start = ALIGN(_irom_end - 0x42000000 + 0x3C000000, 4096));
|
||||
PROVIDE(__flash_data_end = 0x3C000000 + 4M);
|
||||
|
||||
/DISCARD/ :
|
||||
{
|
||||
*(.eh_frame) /* causes 'no memory region specified' error in lld */
|
||||
|
||||
Reference in New Issue
Block a user