Skip to content

Commit

Permalink
Merge pull request #17601 from gschorcht/cpu/esp32/upgrade_esp-idf_v4.4
Browse files Browse the repository at this point in the history
cpu/esp32: Upgrade to ESP-IDF v4.4
  • Loading branch information
benpicco authored Jun 2, 2022
2 parents 25d7234 + aa9dd30 commit e1e2b7c
Show file tree
Hide file tree
Showing 330 changed files with 4,914 additions and 64,898 deletions.
58 changes: 29 additions & 29 deletions boards/common/esp32/board_common.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 Gunar Schorcht
* Copyright (C) 2021 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
Expand All @@ -21,13 +21,13 @@

#include "board.h"
#include "esp_common.h"
#include "kernel_defines.h"
#include "log.h"
#include "periph/gpio.h"
#include "periph/spi.h"
#include "rom/ets_sys.h"

#ifdef __cplusplus
extern "C" {
extern "C" {
#endif

void board_init_common(void)
Expand All @@ -46,51 +46,51 @@ void print_board_config(void)
{
ets_printf("\nBoard configuration:\n");

#if MODULE_PERIPH_ADC
#if IS_USED(MODULE_PERIPH_ADC)
adc_print_config();
#endif
#if MODULE_PERIPH_DAC
#endif
#if IS_USED(MODULE_PERIPH_DAC)
dac_print_config();
#endif
#if MODULE_PERIPH_PWM
#endif
#if IS_USED(MODULE_PERIPH_PWM)
pwm_print_config();
#endif
#if MODULE_PERIPH_I2C
#endif
#if IS_USED(MODULE_PERIPH_I2C)
i2c_print_config();
#endif
#if MODULE_PERIPH_SPI
#endif
#if IS_USED(MODULE_PERIPH_SPI)
spi_print_config();
#endif
#if MODULE_PERIPH_UART
#endif
#if IS_USED(MODULE_PERIPH_UART)
uart_print_config();
#endif
#endif

#ifdef MODULE_PERIPH_CAN
#if IS_USED(MODULE_PERIPH_CAN)
can_print_config();
#endif
#endif

ets_printf("\tLED\t\tpins=[ ");
#ifdef LED0_PIN
#ifdef LED0_PIN
ets_printf("%d ", LED0_PIN);
#endif
#ifdef LED1_PIN
#endif
#ifdef LED1_PIN
ets_printf("%d ", LED1_PIN);
#endif
#ifdef LED2_PIN
#endif
#ifdef LED2_PIN
ets_printf("%d ", LED2_PIN);
#endif
#endif
ets_printf("]\n");

ets_printf("\tBUTTONS\t\tpins=[ ");
#ifdef BUTTON0_PIN
#ifdef BUTTON0_PIN
ets_printf("%d ", BUTTON0_PIN);
#endif
#ifdef BUTTON2_PIN
#endif
#ifdef BUTTON2_PIN
ets_printf("%d ", BUTTON1_PIN);
#endif
#ifdef BUTTON3_PIN
#endif
#ifdef BUTTON3_PIN
ets_printf("%d ", BUTTON2_PIN);
#endif
#endif
ets_printf("]\n");

ets_printf("\n");
Expand Down
2 changes: 1 addition & 1 deletion boards/common/esp32/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#endif

#include "periph/gpio.h"
#include "sdk_conf.h"
#include "sdkconfig.h"

#if MODULE_MTD
#include "mtd.h"
Expand Down
20 changes: 10 additions & 10 deletions cpu/esp32/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2020 HAW Hamburg
# 2021 Gunar Schorcht
# 2022 Gunar Schorcht
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
Expand All @@ -20,17 +20,12 @@ config CPU_FAM_ESP32
select HAS_PUF_SRAM

select PACKAGE_ESP32_SDK if TEST_KCONFIG
select PACKAGE_ESP32_SDK_LIBS if TEST_KCONFIG

select MODULE_ESP_IDF_DRIVER if TEST_KCONFIG
select MODULE_ESP_IDF_ESP32 if TEST_KCONFIG
select MODULE_ESP_IDF_SOC if TEST_KCONFIG

select MODULE_PERIPH_RTT if HAS_PERIPH_RTT && MODULE_PM_LAYERED
select MODULE_LIBC_GETTIMEOFDAY if TEST_KCONFIG
select MODULE_RTT_RTC if HAS_PERIPH_RTT && MODULE_PERIPH_RTC
select MODULE_PERIPH_RTT if HAS_PERIPH_RTT && MODULE_PM_LAYERED
select MODULE_PS if MODULE_SHELL
select MODULE_PTHREAD if MODULE_CPP && TEST_KCONFIG
select MODULE_LIBC_GETTIMEOFDAY if TEST_KCONFIG
select MODULE_PTHREAD if MODULE_CPP
imply MODULE_NEWLIB_NANO

## CPU Models
Expand Down Expand Up @@ -125,7 +120,11 @@ menu "ESP32 specific configurations"
config MODULE_ESP_SPI_RAM
bool "SPI RAM support"
depends on HAS_ESP_SPI_RAM
select MODULE_ESP_IDF_EFUSE
select MODULE_ESP_IDF_GPIO
select MODULE_ESP_IDF_HEAP
select MODULE_ESP_IDF_SPI_FLASH
select MODULE_ESP_IDF_SPI_RAM
help
Say y to use external SPI RAM connected through the FSPI interface.

Expand All @@ -135,6 +134,7 @@ menu "ESP32 specific configurations"

endmenu

rsource "bootloader/Kconfig"
rsource "esp-idf/Kconfig"
rsource "periph/Kconfig"
rsource "vendor/esp-idf/Kconfig"
source "$(RIOTCPU)/esp_common/Kconfig"
6 changes: 5 additions & 1 deletion cpu/esp32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ SRC = irq_arch.c startup.c syscalls.c
# Add a list of subdirectories, that should also be built:
DIRS += $(RIOTCPU)/esp_common
DIRS += periph
DIRS += vendor
DIRS += esp-idf

ifneq (, $(filter esp_bootloader, $(USEMODULE)))
DIRS += bootloader
endif

ifneq (, $(filter esp_eth, $(USEMODULE)))
DIRS += esp-eth
Expand Down
48 changes: 28 additions & 20 deletions cpu/esp32/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
include $(RIOTCPU)/esp_common/Makefile.dep

USEPKG += esp32_sdk
USEPKG += esp32_sdk_libs

USEMODULE += esp_idf_driver
USEMODULE += esp_idf_esp32
USEMODULE += esp_idf_soc
USEMODULE += esp_idf_common
USEMODULE += esp_bootloader

ifneq (,$(filter newlib,$(USEMODULE)))
DEFAULT_MODULE += newlib_nano
Expand All @@ -18,28 +16,38 @@ ifneq (,$(filter cpp,$(USEMODULE)))
endif

ifneq (,$(filter esp_eth,$(USEMODULE)))
USEMODULE += esp_freertos
USEMODULE += esp_idf_efuse
USEMODULE += esp_idf_eth
USEMODULE += esp_idf_eth_phy
USEMODULE += esp_idf_event
USEMODULE += esp_idf_gpio
USEMODULE += esp_idf_spi_flash
USEMODULE += netdev_eth
USEMODULE += netopt
USEMODULE += ztimer_msec
endif

ifneq (,$(filter esp_wifi_any,$(USEMODULE)))
# add additional modules used for any WiFi interface
USEMODULE += esp_freertos
# add additional modules and packages used for any WiFi interface
USEPKG += esp32_sdk_lib_phy
USEPKG += esp32_sdk_lib_wifi
USEMODULE += esp_idf_efuse
USEMODULE += esp_idf_event
USEMODULE += esp_idf_heap
USEMODULE += esp_idf_nvs_flash
USEMODULE += esp_idf_wpa_supplicant_crypto
USEMODULE += esp_idf_wpa_supplicant_port
USEMODULE += esp_idf_spi_flash
USEMODULE += esp_idf_wifi
USEMODULE += esp_idf_wpa_supplicant
USEMODULE += pthread
endif

ifneq (,$(filter esp_wifi_enterprise,$(USEMODULE)))
# add additional modules used for WPA2 Enterprise mode
USEMODULE += esp_idf_wpa_supplicant_wpa2_eap_peer
USEMODULE += esp_idf_wpa_supplicant_wpa2_tls
USEMODULE += esp_idf_wpa_supplicant_wpa2_utils
ifneq (,$(filter esp_idf_heap,$(USEMODULE)))
# The ESP-IDF heap component uses the TLSF implementation that is part of
# the component. To avoid conflicts with modules and packages that use the
# RIOT package `tlsf`, this package is also used for the ESP-IDF heap instead
# of its own implementation. There does not seem to be any differences in
# the implementations of TLSF with the exception of heap poisoning, which
# is not configured.
USEPKG += tlsf
endif

ifneq (,$(filter esp_idf_nvs_flash,$(USEMODULE)))
Expand Down Expand Up @@ -74,13 +82,13 @@ ifneq (,$(filter periph_i2c,$(USEMODULE)))
endif
endif

ifneq (,$(filter esp_now esp_wifi esp_spi_ram,$(USEMODULE)))
# the ESP-IDF heap has to be used if SPI RAM is used
USEMODULE += esp_idf_heap
endif

ifneq (,$(filter esp_spi_ram,$(USEMODULE)))
FEATURES_REQUIRED += esp_spi_ram
USEMODULE += esp_idf_efuse
USEMODULE += esp_idf_gpio
USEMODULE += esp_idf_heap
USEMODULE += esp_idf_spi_flash
USEMODULE += esp_idf_spi_ram
endif

ifneq (,$(filter mtd,$(USEMODULE)))
Expand Down
Loading

0 comments on commit e1e2b7c

Please sign in to comment.