Skip to content

Commit

Permalink
esp32/sdkconfig: Disable PMP_IDRAM_SPLIT to fix native emit support.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Leech <[email protected]>
  • Loading branch information
pi-anl committed Oct 9, 2024
1 parent e2058bc commit 717866b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ports/esp32/boards/sdkconfig.base
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,9 @@ CONFIG_ETH_SPI_ETHERNET_DM9051=y
# formatting in ROM instead and should override this, check
# ESP_ROM_HAS_NEWLIB_NANO_FORMAT.
CONFIG_NEWLIB_NANO_FORMAT=y

# IRAM/DRAM split protection is a memory protection feature on some parts
# that support SOC_CPU_IDRAM_SPLIT_USING_PMP, eg. C2, C5, C6, H2
# Due to limitations in the PMP system this feature breaks native emitters
# so is disabled by default.
CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT=n
8 changes: 8 additions & 0 deletions ports/esp32/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
// emitters
#define MICROPY_PERSISTENT_CODE_LOAD (1)
#if CONFIG_IDF_TARGET_ARCH_RISCV
#if CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT
#define MICROPY_EMIT_RV32 (0)
#else
#define MICROPY_EMIT_RV32 (1)
#endif
#else
#define MICROPY_EMIT_XTENSAWIN (1)
#endif
Expand Down Expand Up @@ -263,8 +267,12 @@
// type definitions for the specific machine

#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p)))
#if SOC_CPU_IDRAM_SPLIT_USING_PMP && !CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT
// On targets with this configuration all RAM is executable so no need for a custom commit function.
#else
void *esp_native_code_commit(void *, size_t, void *);
#define MP_PLAT_COMMIT_EXEC(buf, len, reloc) esp_native_code_commit(buf, len, reloc)
#endif
#define MP_SSIZE_MAX (0x7fffffff)

#if MICROPY_PY_SOCKET_EVENTS
Expand Down

0 comments on commit 717866b

Please sign in to comment.