-
Notifications
You must be signed in to change notification settings - Fork 2.1k
cpu/esp*: Tracking refactoring of ESP MCU implementations #10658
Description
Description
There are already parts of MCU implementations for ESP8266 and ESP32 SoCs which are almost identical or at least very similar. Examples are the implementations of
- context handling, context switching and low level interrupt handling (
cpu/esp*/vendor/xtensa/*) - ESP-NOW netdev driver and interface (
cpu/esp*/esp-now)
All other parts are completely different at the moment, since ESP32 and ESP8266 use SDKs with libraries which are completely different. However, with the ESP8266 RTOS SDK version under development, it seems that upcoming SDK versions for the ESP8266 will be at least partially compatible with the ESP-IDF for ESP32.
Therefore, it is very likely that both MCUs can use more and more the same code base. This issue is intended to track the modules that can be refactored designed to use the same code base and their progress.
Update With the reimplementation of the ESP8266 port based on the ESP8266 RTOS SDK in PR #11108 it became possible to deduplicate a lot. The code in PR #11108 was already prepared for this deduplication.
Refactored modules
-
cpu/esp*/vendor/xtensa(PR cpu/esp*: Xtensa vendor code moved to esp_common #10883) -
cpu/esp*/esp-now - common definitions
Refactoring prerequisites / steps
- adapt makefiles for ESP32 to use
cpu/common/esp/*(PR cpu: esp_common added for common modules of ESP SoCs #10663) - adapt makefiles for ESP8266 to use
cpu/common/esp/*(PR cpu: esp_common added for common modules of ESP SoCs #10663) - remove SDK interrupt handling from ESP8266 (PR cpu/esp8266: change of ETS task handling #10656)
- adapt
cpu/esp*/vendor/xtensa/*to use architecture specific data in thread control block - adapt
cpu/esp32/vendor/xtensa/*(PR cpu/esp*: Xtensa vendor code moved to esp_common #10883) - adapt
cpu/esp8266/vendor/xtensa/*(PR cpu/esp*: Xtensa vendor code moved to esp_common #10883) - move
cpu/esp*/vendor/xtensa/*tocpu/esp_common/vendor(PR cpu/esp*: Xtensa vendor code moved to esp_common #10883) - create common
Makefile*incpu/esp_commonand include them (PR cpu/esp*: code deduplication and cleanup #12955) - move common definitions in
cpu/esp*/Makefile*tocpu/esp_common/Makefile*(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/vendor/esp/*tocpu/esp_common/vendor(PR cpu/esp*: code deduplication and cleanup #12955) - move
gen_esp32part.pytocpu/esp_common/vendor/esp-idf/partition_table(PR cpu/esp*: code deduplication and cleanup #12955) - move common definitions (
cpu.h,esp_common.h, and tocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - move
LOG_TAG*macros (log_module.h,esp_common_log.h) tocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/exceptionstocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/eventstocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/thread_archtocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - [!] move
cpu/esp*/toolstocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/irq_archtocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/syscallstocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/periph/flashtocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - [!] move
cpu/esp*/periph/hrwngtocpu/esp_common/periph(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/periph/i2ctocpu/esp_common/periph(PR cpu/esp*: code deduplication and cleanup #12955) - [!] move
cpu/esp*/periph/spitocpu/esp_common/periph(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/periph/uarttocpu/esp_common/periph(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/freertostocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - move
cpu/esp*/esp_wifitocpu/esp_common(PR cpu/esp*: code deduplication and cleanup #12955) - [!] move
boards/common/esp*/board_commontoboard/common/esp