Skip to content

ESP32S2: move to official IDF submodule #3492

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

Merged
merged 4 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@
[submodule "frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center"]
path = frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center
url = https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center
[submodule "ports/esp32s2/esp-idf"]
path = ports/esp32s2/esp-idf
url = https://github.com/tannewt/esp-idf.git
[submodule "frozen/Adafruit_CircuitPython_RFM9x"]
path = frozen/Adafruit_CircuitPython_RFM9x
url = https://github.com/adafruit/Adafruit_CircuitPython_RFM9x.git
[submodule "frozen/Adafruit_CircuitPython_RFM69"]
path = frozen/Adafruit_CircuitPython_RFM69
url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git
[submodule "ports/esp32s2/esp-idf"]
path = ports/esp32s2/esp-idf
url = https://github.com/hierophect/esp-idf.git
54 changes: 30 additions & 24 deletions ports/esp32s2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,36 @@ INC += -I./peripherals
INC += -I../../lib/mp-readline
INC += -I../../lib/tinyusb/src
INC += -I../../supervisor/shared/usb
INC += -Iesp-idf/components/freertos/include/freertos
INC += -Iesp-idf/components/freertos/xtensa/include
INC += -Iesp-idf/components/esp32s2/include
INC += -Iesp-idf/components/xtensa/esp32s2/include
INC += -Iesp-idf/components/esp_common/include
INC += -Iesp-idf/components/esp_event/include
INC += -Iesp-idf/components/esp_netif/include
INC += -Iesp-idf/components/esp_ringbuf/include
INC += -Iesp-idf/components/esp_rom/include
INC += -Iesp-idf/components/esp_wifi/include
INC += -Iesp-idf/components/xtensa/include
INC += -Iesp-idf/components/esp_timer/include
INC += -Iesp-idf/components/mbedtls/mbedtls/include
INC += -Iesp-idf/components/mbedtls/port/include/
INC += -Iesp-idf/components/newlib/platform_include
INC += -Iesp-idf/components/lwip/lwip/src/include
INC += -Iesp-idf/components/lwip/port/esp32/include
INC += -Iesp-idf/components/lwip/include/apps/sntp
INC += -Iesp-idf/components/soc/include
INC += -Iesp-idf/components/soc/src/esp32s2/include
INC += -Iesp-idf/components/soc/soc/include
INC += -Iesp-idf/components/soc/soc/esp32s2/include
INC += -Iesp-idf/components/heap/include
INC += -Iesp-idf/components/esp_system/include

INC += -isystem esp-idf
INC += -isystem esp-idf/components/driver/include
INC += -isystem esp-idf/components/freertos/include/freertos
INC += -isystem esp-idf/components/freertos/xtensa/include
INC += -isystem esp-idf/components/esp32s2/include
INC += -isystem esp-idf/components/xtensa/esp32s2/include
INC += -isystem esp-idf/components/esp_common/include
INC += -isystem esp-idf/components/esp_event/include
INC += -isystem esp-idf/components/esp_netif/include
INC += -isystem esp-idf/components/esp_ringbuf/include
INC += -isystem esp-idf/components/esp_rom/include
INC += -isystem esp-idf/components/esp_wifi/include
INC += -isystem esp-idf/components/xtensa/include
INC += -isystem esp-idf/components/esp_timer/include
INC += -isystem esp-idf/components/mbedtls/mbedtls/include
INC += -isystem esp-idf/components/mbedtls/port/include/
INC += -isystem esp-idf/components/newlib/platform_include
INC += -isystem esp-idf/components/lwip/lwip/src/include
INC += -isystem esp-idf/components/lwip/port/esp32/include
INC += -isystem esp-idf/components/lwip/include/apps/sntp
INC += -isystem esp-idf/components/hal/include
INC += -isystem esp-idf/components/hal/esp32s2/include
INC += -isystem esp-idf/components/log/include/
INC += -isystem esp-idf/components/soc/include
INC += -isystem esp-idf/components/soc/src/esp32s2/include
INC += -isystem esp-idf/components/soc/soc/include
INC += -isystem esp-idf/components/soc/soc/esp32s2/include
INC += -isystem esp-idf/components/heap/include
INC += -isystem esp-idf/components/esp_system/include
INC += -I$(BUILD)/esp-idf/config

CFLAGS += -DHAVE_CONFIG_H \
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/bindings/espidf/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "bindings/espidf/__init__.h"

#include "esp-idf/components/heap/include/esp_heap_caps.h"
#include "components/heap/include/esp_heap_caps.h"

//| """Direct access to a few ESP-IDF details. This module *should not* include any functionality
//| that could be implemented by other frameworks. It should only include ESP-IDF specific
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/busio/I2C.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "py/mperrno.h"
#include "py/runtime.h"

#include "driver/i2c.h"
#include "components/driver/include/driver/i2c.h"

#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Pin.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/busio/I2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "common-hal/microcontroller/Pin.h"

#include "esp-idf/components/soc/include/hal/i2c_types.h"
#include "components/soc/include/hal/i2c_types.h"
#include "FreeRTOS.h"
#include "freertos/semphr.h"
#include "py/obj.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self,
self->bits = bits;
self->target_frequency = baudrate;
self->hal_context.timing_conf = &self->timing_conf;
esp_err_t result = spi_hal_get_clock_conf(&self->hal_context,
esp_err_t result = spi_hal_cal_clock_conf(&self->hal_context,
self->target_frequency,
128 /* duty_cycle */,
self->connected_through_gpio,
Expand Down
6 changes: 3 additions & 3 deletions ports/esp32s2/common-hal/busio/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

#include "common-hal/microcontroller/Pin.h"

#include "esp-idf/components/driver/include/driver/spi_common_internal.h"
#include "esp-idf/components/soc/include/hal/spi_hal.h"
#include "esp-idf/components/soc/include/hal/spi_types.h"
#include "components/driver/include/driver/spi_common_internal.h"
#include "components/soc/include/hal/spi_hal.h"
#include "components/soc/include/hal/spi_types.h"
#include "py/obj.h"

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/busio/UART.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/busio/UART.h"

#include "driver/uart.h"
#include "components/driver/include/driver/uart.h"

#include "mpconfigport.h"
#include "lib/utils/interrupt_char.h"
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/busio/UART.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "common-hal/microcontroller/Pin.h"

#include "esp-idf/components/soc/include/hal/uart_types.h"
#include "components/soc/include/hal/uart_types.h"
#include "py/obj.h"

typedef struct {
Expand Down
4 changes: 2 additions & 2 deletions ports/esp32s2/common-hal/digitalio/DigitalInOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include "py/runtime.h"
#include "supervisor/shared/translate.h"

#include "driver/gpio.h"
#include "components/driver/include/driver/gpio.h"

#include "esp-idf/components/soc/include/hal/gpio_hal.h"
#include "components/soc/include/hal/gpio_hal.h"

void common_hal_digitalio_digitalinout_never_reset(
digitalio_digitalinout_obj_t *self) {
Expand Down
4 changes: 2 additions & 2 deletions ports/esp32s2/common-hal/microcontroller/Pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

#include "py/mphal.h"

#include "esp-idf/components/driver/include/driver/gpio.h"
#include "esp-idf/components/soc/include/hal/gpio_hal.h"
#include "components/driver/include/driver/gpio.h"
#include "components/soc/include/hal/gpio_hal.h"

#ifdef MICROPY_HW_NEOPIXEL
bool neopixel_in_use;
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/microcontroller/Processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include "soc/efuse_reg.h"

#include "esp-idf/components/driver/esp32s2/include/driver/temp_sensor.h"
#include "components/driver/esp32s2/include/driver/temp_sensor.h"

float common_hal_mcu_processor_get_temperature(void) {
float tsens_out;
Expand Down
4 changes: 2 additions & 2 deletions ports/esp32s2/common-hal/neopixel_write/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#include "py/mphal.h"
#include "py/runtime.h"
#include "shared-bindings/neopixel_write/__init__.h"
#include "driver/rmt.h"
#include "rmt.h"
#include "components/driver/include/driver/rmt.h"
#include "peripherals/rmt.h"

#define WS2812_T0H_NS (350)
#define WS2812_T0L_NS (1000)
Expand Down
4 changes: 2 additions & 2 deletions ports/esp32s2/common-hal/pulseio/PulseIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include "common-hal/microcontroller/Pin.h"

#include "py/obj.h"
#include "driver/rmt.h"
#include "rmt.h"
#include "components/driver/include/driver/rmt.h"
#include "peripherals/rmt.h"

typedef struct {
mp_obj_base_t base;
Expand Down
4 changes: 2 additions & 2 deletions ports/esp32s2/common-hal/pulseio/PulseOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H

#include "common-hal/microcontroller/Pin.h"
#include "driver/rmt.h"
#include "rmt.h"
#include "components/driver/include/driver/rmt.h"
#include "peripherals/rmt.h"

#include "py/obj.h"

Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/pwmio/PWMOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "common-hal/pwmio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "py/runtime.h"
#include "driver/ledc.h"
#include "components/driver/include/driver/ledc.h"

#define INDEX_EMPTY 0xFF

Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/pwmio/PWMOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H

#include "common-hal/microcontroller/Pin.h"
#include "driver/ledc.h"
#include "components/driver/include/driver/ledc.h"

typedef struct {
mp_obj_base_t base;
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/rtc/RTC.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "py/obj.h"
#include "py/runtime.h"
#include "soc/rtc_periph.h"
#include "components/soc/soc/include/soc/rtc_periph.h"
#include "shared-bindings/rtc/RTC.h"

void common_hal_rtc_get_time(timeutils_struct_time_t *tm) {
Expand Down
3 changes: 2 additions & 1 deletion ports/esp32s2/common-hal/socketpool/Socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
#include "common-hal/socketpool/SocketPool.h"
#include "common-hal/ssl/SSLContext.h"

#include "esp-idf/components/esp-tls/esp_tls.h"
#include "components/esp-tls/esp_tls.h"
#include "components/log/include/esp_log.h"

typedef struct {
mp_obj_base_t base;
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/socketpool/SocketPool.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "py/runtime.h"
#include "shared-bindings/wifi/__init__.h"

#include "esp-idf/components/lwip/lwip/src/include/lwip/netdb.h"
#include "components/lwip/lwip/src/include/lwip/netdb.h"

#include "bindings/espidf/__init__.h"

Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/ssl/SSLContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "py/obj.h"

#include "esp-idf/components/esp-tls/esp_tls.h"
#include "components/esp-tls/esp_tls.h"

typedef struct {
mp_obj_base_t base;
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/ssl/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "shared-bindings/ssl/SSLContext.h"

#include "esp-idf/components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h"
#include "components/mbedtls/esp_crt_bundle/include/esp_crt_bundle.h"

void common_hal_ssl_create_default_context(ssl_sslcontext_obj_t* self) {
memset(&self->ssl_config, 0, sizeof(esp_tls_cfg_t));
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/wifi/Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "py/obj.h"

#include "esp-idf/components/esp_wifi/include/esp_wifi_types.h"
#include "components/esp_wifi/include/esp_wifi_types.h"

typedef struct {
mp_obj_base_t base;
Expand Down
4 changes: 2 additions & 2 deletions ports/esp32s2/common-hal/wifi/Radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#include "shared-bindings/wifi/ScannedNetworks.h"
#include "shared-module/ipaddress/__init__.h"

#include "esp-idf/components/esp_wifi/include/esp_wifi.h"
#include "esp-idf/components/lwip/include/apps/ping/ping_sock.h"
#include "components/esp_wifi/include/esp_wifi.h"
#include "components/lwip/include/apps/ping/ping_sock.h"

static void start_station(wifi_radio_obj_t *self) {
if (self->sta_mode) {
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/wifi/Radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "py/obj.h"

#include "esp-idf/components/esp_event/include/esp_event.h"
#include "components/esp_event/include/esp_event.h"

#include "shared-bindings/wifi/ScannedNetworks.h"

Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/wifi/ScannedNetworks.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "shared-bindings/wifi/Radio.h"
#include "shared-bindings/wifi/ScannedNetworks.h"

#include "esp-idf/components/esp_wifi/include/esp_wifi.h"
#include "components/esp_wifi/include/esp_wifi.h"

static void wifi_scannednetworks_done(wifi_scannednetworks_obj_t *self) {
self->done = true;
Expand Down
3 changes: 2 additions & 1 deletion ports/esp32s2/common-hal/wifi/ScannedNetworks.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
#include "FreeRTOS.h"
#include "freertos/event_groups.h"

#include "esp-idf/components/esp_wifi/include/esp_wifi_types.h"
#include "components/esp_wifi/include/esp_wifi_types.h"
#include "components/log/include/esp_log.h"

typedef struct {
mp_obj_base_t base;
Expand Down
7 changes: 4 additions & 3 deletions ports/esp32s2/common-hal/wifi/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@

#include "py/runtime.h"

#include "esp-idf/components/esp_wifi/include/esp_wifi.h"
#include "components/esp_wifi/include/esp_wifi.h"

#include "esp-idf/components/heap/include/esp_heap_caps.h"
#include "components/heap/include/esp_heap_caps.h"

wifi_radio_obj_t common_hal_wifi_radio_obj;

#include "esp_log.h"
#include "components/log/include/esp_log.h"

static const char* TAG = "wifi";

static void event_handler(void* arg, esp_event_base_t event_base,
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/esp-idf
Submodule esp-idf updated 526 files
4 changes: 2 additions & 2 deletions ports/esp32s2/mphalport.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include "py/mpstate.h"
#include "py/gc.h"

#include "esp-idf/components/xtensa/include/esp_debug_helpers.h"
#include "esp-idf/components/esp_rom/include/esp32s2/rom/ets_sys.h"
#include "components/xtensa/include/esp_debug_helpers.h"
#include "components/esp_rom/include/esp32s2/rom/ets_sys.h"

void mp_hal_delay_us(mp_uint_t delay) {
ets_delay_us(delay);
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/peripherals/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include "esp32s2_peripherals_config.h"
#include "esp-idf/config/sdkconfig.h"
#include "esp-idf/components/soc/include/hal/gpio_types.h"
#include "components/soc/include/hal/gpio_types.h"

typedef struct {
PIN_PREFIX_FIELDS
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/peripherals/rmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* THE SOFTWARE.
*/

#include "rmt.h"
#include "peripherals/rmt.h"
#include "py/runtime.h"

bool rmt_reserved_channels[RMT_CHANNEL_MAX];
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/peripherals/rmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define MICROPY_INCLUDED_ESP32S2_PERIPHERALS_RMT_H

#include "py/mphal.h"
#include "driver/rmt.h"
#include "components/driver/include/driver/rmt.h"
#include <stdint.h>

void esp32s2_peripherals_rmt_reset(void);
Expand Down
2 changes: 1 addition & 1 deletion ports/esp32s2/supervisor/internal_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "py/runtime.h"
#include "lib/oofatfs/ff.h"

#include "esp-idf/components/spi_flash/include/esp_partition.h"
#include "components/spi_flash/include/esp_partition.h"

#include "supervisor/usb.h"

Expand Down
4 changes: 2 additions & 2 deletions ports/esp32s2/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
#include "shared-bindings/rtc/__init__.h"

#include "peripherals/rmt.h"
#include "esp-idf/components/heap/include/esp_heap_caps.h"
#include "esp-idf/components/soc/soc/esp32s2/include/soc/cache_memory.h"
#include "components/heap/include/esp_heap_caps.h"
#include "components/soc/soc/esp32s2/include/soc/cache_memory.h"

#define HEAP_SIZE (48 * 1024)

Expand Down
Loading