diff --git a/Sming/Arch/Esp32/Components/esp32/sdk/pthread.mk b/Sming/Arch/Esp32/Components/esp32/sdk/pthread.mk index c24e62cb1e..77f07fc36a 100644 --- a/Sming/Arch/Esp32/Components/esp32/sdk/pthread.mk +++ b/Sming/Arch/Esp32/Components/esp32/sdk/pthread.mk @@ -4,7 +4,10 @@ SDK_UNDEF_SYMBOLS += \ pthread_include_pthread_impl \ pthread_include_pthread_cond_impl \ - pthread_include_pthread_local_storage_impl + pthread_include_pthread_cond_var_impl \ + pthread_include_pthread_local_storage_impl \ + pthread_include_pthread_rwlock_impl \ + pthread_include_pthread_semaphore_impl ifdef CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP SDK_WRAP_SYMBOLS += vPortCleanUpTCB diff --git a/Sming/Arch/Esp32/Components/esp32/sdk/soc.mk b/Sming/Arch/Esp32/Components/esp32/sdk/soc.mk new file mode 100644 index 0000000000..276e5f6138 --- /dev/null +++ b/Sming/Arch/Esp32/Components/esp32/sdk/soc.mk @@ -0,0 +1,8 @@ +# +# soc +# + +ifeq (esp32,$(SMING_SOC)) + SDK_UNDEF_SYMBOLS += \ + esp_dport_access_reg_read +endif diff --git a/Sming/Arch/Esp32/app.mk b/Sming/Arch/Esp32/app.mk index 42271785d1..8fc7a3c151 100644 --- a/Sming/Arch/Esp32/app.mk +++ b/Sming/Arch/Esp32/app.mk @@ -9,6 +9,12 @@ LDFLAGS += \ -nostdlib \ -Wl,-static +ifdef IDF_TARGET_ARCH_RISCV + LDFLAGS += \ + -nostartfiles \ + -march=$(ESP32_RISCV_ARCH) \ + --specs=nosys.specs +endif .PHONY: application application: $(TARGET_BIN) diff --git a/Sming/Arch/Esp32/build.mk b/Sming/Arch/Esp32/build.mk index 2c615737e9..4db95bf8c7 100644 --- a/Sming/Arch/Esp32/build.mk +++ b/Sming/Arch/Esp32/build.mk @@ -41,6 +41,12 @@ ESP32_COMPILER_PREFIX := xtensa-$(ESP_VARIANT)-elf else ESP32_COMPILER_PREFIX := riscv32-esp-elf IDF_TARGET_ARCH_RISCV := 1 +# This is important as no hardware FPU is available on these SOCs +ifeq ($(IDF_VERSION),v5.2) +ESP32_RISCV_ARCH := rv32imc_zicsr_zifencei +else +ESP32_RISCV_ARCH := rv32imc +endif endif # $1 => Tool sub-path/name @@ -153,7 +159,10 @@ export PROJECT_VER # Flags which control code generation and dependency generation, both for C and C++ CPPFLAGS += -Wno-frame-address -ifndef IDF_TARGET_ARCH_RISCV +ifdef IDF_TARGET_ARCH_RISCV +CPPFLAGS += \ + -march=$(ESP32_RISCV_ARCH) +else CPPFLAGS += \ -mlongcalls \ -mtext-section-literals