Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix esp32c3 FPU issues #2700

Merged
merged 3 commits into from
Jan 9, 2024
Merged

Fix esp32c3 FPU issues #2700

merged 3 commits into from
Jan 9, 2024

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Jan 9, 2024

The HostTests application crashes on the esp32c3 because it doesn't have hardware floating-point support. By default code is compiled with FPU instructions which produce 'illegal instruction' exceptions.

The -march=rv32imc setting is required for these processors so emulation code is used instead. The IDF 5.2 compilers have additional zicsr and zifencei extensions. Haven't looked into these, these settings are just copied from the IDF makefiles.

Similiarly, a scan of the IDF makefiles shows a few missing definitions. Don't know whether these are 100% necessary or not but don't seem to do any harm.

mikee47 added 2 commits January 9, 2024 09:01
From inspection of IDF makelists
Missing compiler and link flags
Probably since 5.0
Copy link

what-the-diff bot commented Jan 9, 2024

PR Summary

  • Inclusion of Additional Components in pthread.mk File
    The PR introduces new components to the present pthread build file. These are pthread_include_pthread_cond_var_impl, pthread_include_pthread_rwlock_impl, and pthread_include_pthread_semaphore_impl. These additions offer more functionality in doing multithreaded programming.

  • Addition of soc.mk File for ESP32
    A new file named soc.mk has been added as part of the update. The content of this file is related to a system-on-chip (SOC) solution specific for ESP32 architecture. This enhances platform compatibility with different SOC solutions.

  • Addition of Conditional Check and Flag Inclusions in app.mk File
    Additional checks have been included in the application build file to add specific flags like -nostartfiles when compiling for an architecture defined by IDF_TARGET_ARCH_RISCV. This allows for greater flexibility and responsiveness when switching between target architectures during development.

  • Introduction of Enhanced Architecture Compatibility in build.mk File
    The build file now includes a logic to define ESP32_RISCV_ARCH based on the IDF_VERSION and implements the -march flag with the ESP32_RISCV_ARCH value if IDF_TARGET_ARCH_RISCV is defined. This feature allows smoother adaptation to new architectural updates or differences in the RISC-V architecture when building the project.

@slaff slaff added this to the 5.2.0 milestone Jan 9, 2024
@mikee47 mikee47 changed the title Fix esp32c3 fpu issues Fix esp32c3 FPU issues Jan 9, 2024
@slaff slaff merged commit 22f8c1a into SmingHub:develop Jan 9, 2024
46 checks passed
@mikee47 mikee47 deleted the fix/esp32c3-fpu branch January 9, 2024 13:19
@slaff slaff mentioned this pull request Feb 5, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants