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

Upgrade ESP32 IDF to v5.2.2 #2991

Merged
merged 15 commits into from
Jul 30, 2024
2 changes: 1 addition & 1 deletion .devcontainer/All/Dockerfile.All.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-
RUN git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip

# Clone ESP-IDF
RUN git clone --branch v5.1.4 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
RUN git clone --branch v5.2.2 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf

# Clone what is needed for TI
RUN git clone --branch 4.10.00.07 https://github.com/nanoframework/SimpleLink_CC32xx_SDK.git --depth 1 ./sources/SimpleLinkCC32 \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/ESP32/Dockerfile.ESP32.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ RUN mkdir -p /usr/local/bin/gcc
RUN git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs

# Clone ESP-IDF
RUN git clone --branch v5.1.4 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
RUN git clone --branch v5.2.2 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf

# Creating static link python for pyhton3
RUN ln -fs /usr/bin/python3 /usr/bin/python \
Expand Down
4 changes: 3 additions & 1 deletion CMake/Modules/FindESP32_IDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ include(${TARGET_SERIES}_GCC_options)
# freertos #
############

list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/config/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/config/include/freertos)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/config/${ESP32_CPU_TYPE}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/FreeRTOS-Kernel/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/include/esp_additions)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/esp_additions/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/esp_additions/include/freertos)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/esp_additions/arch/${ESP32_CPU_TYPE}/include)
Expand Down
4 changes: 0 additions & 4 deletions CMake/binutils.ESP32.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,6 @@ macro(nf_add_idf_as_library)

if(ESP32_USB_CDC)

#idf_build_set_property(IDF_COMPONENT_MANAGER 1)
#idf_build_set_property(__COMPONENT_MANAGER_INTERFACE_VERSION 2)
#message(STATUS "Support for component manager enabled")

# add IDF components specific to ESP32S2/S3 series
# They have to be added in a specific order so they compile/link ok
list(APPEND IDF_COMPONENTS_TO_ADD tinyusb)
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:
type: github
name: espressif/esp-idf
endpoint: nanoframework
ref: refs/tags/v5.1.4
ref: refs/tags/v5.2.2

# scheduled build
# the schedule is defined at the AZDO web interface because of inconsistencies with time zones
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ resources:
type: github
name: espressif/esp-idf
endpoint: nanoframework
ref: 'refs/tags/v5.1.4'
ref: 'refs/tags/v5.2.2'
- repository: mscorlib
type: github
name: nanoframework/CoreLibrary
Expand Down
2 changes: 1 addition & 1 deletion targets/ESP32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ endif()
# WHEN CHANGING THIS MAKE SURE TO UPDATE:
# 1. the dev containers
# 2. ref in AZDO pipeline yaml in Community Targets repo
set(ESP32_IDF_TAG "5.1.4" CACHE INTERNAL "ESP32 IDF tag")
set(ESP32_IDF_TAG "5.2.2" CACHE INTERNAL "ESP32 IDF tag")

if(NO_ESP32_IDF_PATH)
# no ESP32 IDF source specified, download it from official repo
Expand Down
6 changes: 3 additions & 3 deletions targets/ESP32/_Network/NF_ESP32_OpenThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern void ThreadSetInterfaceNumber(int networkInterfaceNumber);
.host_connection_mode = HOST_CONNECTION_MODE_RCP_UART, \
.host_uart_config = \
{ \
.port = 0, \
.port = (uart_port_t)0, \
.uart_config = \
{ \
.baud_rate = 460800, \
Expand Down Expand Up @@ -72,7 +72,7 @@ extern void ThreadSetInterfaceNumber(int networkInterfaceNumber);
.sclk_io_num = 0, \
.quadwp_io_num = -1, \
.quadhd_io_num = -1, \
.isr_cpu_id = INTR_CPU_ID_0, \
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_0, \
}, \
.slave_config = \
{ \
Expand Down Expand Up @@ -384,7 +384,7 @@ esp_err_t initOpenThread(ThreadDeviceType deviceType, esp_openthread_radio_mode_
config.host_config = ESP_OPENTHREAD_DEFAULT_UART_HOST_CONFIG();

// Set COM port using ESP32 configured pins
config.host_config.host_uart_config.port = port;
config.host_config.host_uart_config.port = (uart_port_t)port;

config.host_config.host_uart_config.uart_config.baud_rate = baud_rate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ HRESULT sys_dev_pwm_native_System_Device_Pwm_PwmChannelHelpers::ConfigureAndStar

duty_res = (ledc_timer_bit_t)optimumDutyResolution;

timer_conf = {mode, duty_res, timer_sel, (uint32_t)desiredFrequency, LEDC_AUTO_CLK};
timer_conf = {mode, duty_res, timer_sel, (uint32_t)desiredFrequency, LEDC_AUTO_CLK, true};

result = ledc_timer_config(&timer_conf);

Expand Down Expand Up @@ -316,7 +316,7 @@ HRESULT Library_sys_dev_pwm_native_System_Device_Pwm_PwmChannel::NativeSetDesire

duty_res = (ledc_timer_bit_t)optimumDutyResolution;

timer_conf = {mode, duty_res, timer, (uint32_t)desiredFrequency, LEDC_AUTO_CLK};
timer_conf = {mode, duty_res, timer, (uint32_t)desiredFrequency, LEDC_AUTO_CLK, true};

result = ledc_timer_config(&timer_conf);

Expand Down
2 changes: 1 addition & 1 deletion targets/ESP32/_nanoCLR/System.Device.Spi/cpu_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ bool CPU_SPI_Initialize(uint8_t busIndex, const SPI_DEVICE_CONFIGURATION &spiDev
max_transfer_sz : 16384,
// SPICOMMON_BUSFLAG_* flags
flags : 0,
isr_cpu_id : INTR_CPU_ID_0,
isr_cpu_id : ESP_INTR_CPU_AFFINITY_AUTO,
intr_flags : ESP_INTR_FLAG_IRAM
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ static const char *TAG = "SerialDevice";

NF_PAL_UART Uart0_PAL;
NF_PAL_UART Uart1_PAL;
#if defined(UART_NUM_2)
#if SOC_UART_HP_NUM > 2
NF_PAL_UART Uart2_PAL;
#endif
#if SOC_UART_HP_NUM > 3
NF_PAL_UART Uart3_PAL;
#endif

NF_PAL_UART *GetPalUartFromUartNum_sys(int uart_num)
{
Expand All @@ -36,12 +39,18 @@ NF_PAL_UART *GetPalUartFromUartNum_sys(int uart_num)
// set UART PAL
return &Uart1_PAL;

#if defined(UART_NUM_2)
#if SOC_UART_HP_NUM > 2
case UART_NUM_2:
// set UART PAL
return &Uart2_PAL;
#endif

#if SOC_UART_HP_NUM > 3
case UART_NUM_2:
// set UART PAL
return &Uart3_PAL;
#endif

default:
break;
}
Expand Down Expand Up @@ -1433,11 +1442,14 @@ HRESULT Library_sys_io_ser_native_System_IO_Ports_SerialPort::GetDeviceSelector_
#if defined(CONFIG_TINYUSB_CDC_ENABLED) || defined(CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED)
"COM1,"
#endif
#if defined(UART_NUM_1)
#if SOC_UART_HP_NUM > 1
"COM2,"
#endif
#if defined(UART_NUM_2)
#if SOC_UART_HP_NUM > 2
"COM3,"
#endif
#if SOC_UART_HP_NUM > 3
"COM4,"
#endif
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ HRESULT Library_nanoFramework_hardware_esp32_native_nanoFramework_Hardware_Esp32
NANOCLR_HEADER();
{
esp_err_t err;
int uartNum;
uart_port_t uartNum;
int threshold;

// Static arguments starts at 0
uartNum = stack.Arg0().NumericByRef().s4;
uartNum = (uart_port_t)stack.Arg0().NumericByRef().s4;
threshold = stack.Arg1().NumericByRef().s4;
uart_set_wakeup_threshold(uartNum, threshold);
err = esp_sleep_enable_uart_wakeup(uartNum);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void IsrCallBack(void *arg)
#if defined(CONFIG_IDF_TARGET_ESP32)
touch_pad_intr_clear();
#else
touch_pad_intr_clear(TOUCH_PAD_INTR_MASK_ACTIVE | TOUCH_PAD_INTR_MASK_INACTIVE | TOUCH_PAD_INTR_MASK_TIMEOUT);
touch_pad_intr_clear((touch_pad_intr_mask_t)(TOUCH_PAD_INTR_MASK_ACTIVE | TOUCH_PAD_INTR_MASK_INACTIVE | TOUCH_PAD_INTR_MASK_TIMEOUT));
#endif
for (int i = 0; i < TOUCH_PAD_MAX; i++)
{
Expand Down Expand Up @@ -71,7 +71,7 @@ static void TouchPad_Uninitialize()
#if defined(CONFIG_IDF_TARGET_ESP32)
touch_pad_intr_disable();
#else
touch_pad_intr_disable(TOUCH_PAD_INTR_MASK_ACTIVE | TOUCH_PAD_INTR_MASK_INACTIVE | TOUCH_PAD_INTR_MASK_TIMEOUT);
touch_pad_intr_disable((touch_pad_intr_mask_t)(TOUCH_PAD_INTR_MASK_ACTIVE | TOUCH_PAD_INTR_MASK_INACTIVE | TOUCH_PAD_INTR_MASK_TIMEOUT));
#endif
touch_pad_isr_deregister(IsrCallBack, NULL);
// Clean filter and uninstall the driver
Expand Down
Loading