Skip to content

Commit

Permalink
Merge branch 'espressif:release/v5.3' into release/v5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Oct 25, 2024
2 parents 4c885a2 + a0f798c commit 1030f48
Show file tree
Hide file tree
Showing 176 changed files with 5,628 additions and 3,689 deletions.
3 changes: 3 additions & 0 deletions .gitlab/ci/pre_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ check_blobs:
- IDF_TARGET=esp32c2 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32c3 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32c6 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32c5 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32_host $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
# Check if Coexistence library header files match between IDF and the version used when compiling the libraries
- IDF_TARGET=esp32 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
- IDF_TARGET=esp32s2 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
Expand All @@ -52,6 +54,7 @@ check_blobs:
- IDF_TARGET=esp32c3 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
- IDF_TARGET=esp32c6 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
- IDF_TARGET=esp32h2 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
- IDF_TARGET=esp32c5 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
# Check if Wi-Fi, PHY, BT blobs contain references to specific symbols
- bash $IDF_PATH/tools/ci/check_blobs.sh

Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ if(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE)
list(APPEND compile_definitions "-DNDEBUG")
endif()

if(CONFIG_COMPILER_NO_MERGE_CONSTANTS)
list(APPEND compile_options "-fno-merge-constants")
endif()

if(CONFIG_COMPILER_STACK_CHECK_MODE_NORM)
list(APPEND compile_options "-fstack-protector")
elseif(CONFIG_COMPILER_STACK_CHECK_MODE_STRONG)
Expand Down
9 changes: 9 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,15 @@ mainmenu "Espressif IoT Development Framework Configuration"
help
Stack smashing protection.

config COMPILER_NO_MERGE_CONSTANTS
bool "Disable merging const sections"
depends on IDF_TOOLCHAIN_GCC
help
Disable merging identical constants (string/floating-point) across compilation units.
This helps in better size analysis of the application binary as the rodata section
distribution is more uniform across libraries. On downside, it may increase
the binary size and hence should be used during development phase only.

config COMPILER_WARN_WRITE_STRINGS
bool "Enable -Wwrite-strings warning flag"
default "n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ void bootloader_spi_flash_reset(void)
******************************************************************************/

#define XMC_SUPPORT CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT
#define XMC_VENDOR_ID 0x20
#define XMC_VENDOR_ID_1 0x20

#if BOOTLOADER_BUILD
#define BOOTLOADER_FLASH_LOG(level, ...) ESP_EARLY_LOG##level(TAG, ##__VA_ARGS__)
Expand All @@ -714,7 +714,7 @@ static IRAM_ATTR bool is_xmc_chip_strict(uint32_t rdid)
uint32_t mfid = BYTESHIFT(rdid, 1);
uint32_t cpid = BYTESHIFT(rdid, 0);

if (vendor_id != XMC_VENDOR_ID) {
if (vendor_id != XMC_VENDOR_ID_1) {
return false;
}

Expand Down Expand Up @@ -747,7 +747,7 @@ esp_err_t IRAM_ATTR bootloader_flash_xmc_startup(void)
// Check the Manufacturer ID in SFDP registers (JEDEC standard). If not XMC chip, no need to run the flow
const int sfdp_mfid_addr = 0x10;
uint8_t mf_id = (bootloader_flash_read_sfdp(sfdp_mfid_addr, 1) & 0xff);
if (mf_id != XMC_VENDOR_ID) {
if (mf_id != XMC_VENDOR_ID_1) {
BOOTLOADER_FLASH_LOG(D, "non-XMC chip detected by SFDP Read (%02X), skip.", mf_id);
return ESP_OK;
}
Expand Down Expand Up @@ -779,7 +779,7 @@ esp_err_t IRAM_ATTR bootloader_flash_xmc_startup(void)
static IRAM_ATTR bool is_xmc_chip(uint32_t rdid)
{
uint32_t vendor_id = (rdid >> 16) & 0xFF;
return (vendor_id == XMC_VENDOR_ID);
return (vendor_id == XMC_VENDOR_ID_1);
}

esp_err_t IRAM_ATTR bootloader_flash_xmc_startup(void)
Expand Down
2 changes: 1 addition & 1 deletion components/bt/host/nimble/nimble
4 changes: 0 additions & 4 deletions components/driver/test_apps/.build-test-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ components/driver/test_apps/touch_sensor_v2:
components/driver/test_apps/twai:
disable:
- if: SOC_TWAI_SUPPORTED != 1
disable_test:
- if: IDF_TARGET == "esp32p4"
temporary: true
reason: test not pass, should be re-enable # TODO: IDF-8966
depends_filepatterns:
- components/driver/twai/**/*
depends_components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,23 +231,19 @@ void spitest_gpio_input_sel(uint32_t gpio_num, int func, uint32_t signal_idx)
esp_rom_gpio_connect_in_signal(gpio_num, signal_idx, 0);
}

//Note this cs_num is the ID of the connected devices' ID, e.g. if 2 devices are connected to the bus,
//then the cs_num of the 1st and 2nd devices are 0 and 1 respectively.
void same_pin_func_sel(spi_bus_config_t bus, spi_device_interface_config_t dev, uint8_t cs_num)
//Note this cs_dev_id is the ID of the connected devices' ID, e.g. if 2 devices are connected to the bus,
//then the cs_dev_id of the 1st and 2nd devices are 0 and 1 respectively.
void same_pin_func_sel(spi_bus_config_t bus, spi_device_interface_config_t dev, uint8_t cs_dev_id)
{
spitest_gpio_output_sel(bus.mosi_io_num, FUNC_GPIO, spi_periph_signal[TEST_SPI_HOST].spid_out);
spitest_gpio_input_sel(bus.mosi_io_num, FUNC_GPIO, spi_periph_signal[TEST_SLAVE_HOST].spid_in);

spitest_gpio_output_sel(bus.miso_io_num, FUNC_GPIO, spi_periph_signal[TEST_SLAVE_HOST].spiq_out);
spitest_gpio_input_sel(bus.miso_io_num, FUNC_GPIO, spi_periph_signal[TEST_SPI_HOST].spiq_in);

spitest_gpio_output_sel(dev.spics_io_num, FUNC_GPIO, spi_periph_signal[TEST_SPI_HOST].spics_out[cs_num]);
spitest_gpio_output_sel(dev.spics_io_num, FUNC_GPIO, spi_periph_signal[TEST_SPI_HOST].spics_out[cs_dev_id]);
spitest_gpio_input_sel(dev.spics_io_num, FUNC_GPIO, spi_periph_signal[TEST_SLAVE_HOST].spics_in);

spitest_gpio_output_sel(bus.sclk_io_num, FUNC_GPIO, spi_periph_signal[TEST_SPI_HOST].spiclk_out);
spitest_gpio_input_sel(bus.sclk_io_num, FUNC_GPIO, spi_periph_signal[TEST_SLAVE_HOST].spiclk_in);

#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
GPIO.func_in_sel_cfg[FSPIQ_IN_IDX].sig_in_sel = 1;
#endif
}
11 changes: 7 additions & 4 deletions components/driver/test_apps/twai/main/test_twai_interactive.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -16,6 +16,9 @@
#include "soc/soc_caps.h"
#include "esp_log.h"

#define TEST_TWAI_TX_PIN 4
#define TEST_TWAI_RX_PIN 5

#if CONFIG_TWAI_ISR_IN_IRAM
static void IRAM_ATTR test_delay_post_cache_disable(void *args)
{
Expand All @@ -27,7 +30,7 @@ TEST_CASE("twai_listen_only", "[twai]")
{
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_250KBITS();
twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL();
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(4, 5, TWAI_MODE_LISTEN_ONLY);
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(TEST_TWAI_TX_PIN, TEST_TWAI_RX_PIN, TWAI_MODE_LISTEN_ONLY);
#if CONFIG_TWAI_ISR_IN_IRAM
g_config.intr_flags |= ESP_INTR_FLAG_IRAM;
#endif
Expand Down Expand Up @@ -60,8 +63,8 @@ TEST_CASE("twai_remote_request", "[twai]")
twai_handle_t bus_handle;
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_250KBITS();
twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL();
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(4, 5, TWAI_MODE_NORMAL);
#if CONFIG_IDF_TARGET_ESP32C6
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT(TEST_TWAI_TX_PIN, TEST_TWAI_RX_PIN, TWAI_MODE_NORMAL);
#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4
g_config.controller_id = 1;
#endif
TEST_ESP_OK(twai_driver_install_v2(&g_config, &t_config, &f_config, &bus_handle));
Expand Down
10 changes: 6 additions & 4 deletions components/driver/test_apps/twai/main/test_twai_loop_back.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -99,25 +99,27 @@ TEST_CASE("twai_mode_ext_no_ack_250kbps", "[twai-loop-back]")
.extd = true, // Extended Frame Format (29bit ID)
};

printf("install twai driver\r\n");
for (int i = 0; i < SOC_TWAI_CONTROLLER_NUM; i++) {
g_config.controller_id = i;
g_config.tx_io = i;
g_config.rx_io = i;
printf("install twai driver %d\r\n", g_config.controller_id);
TEST_ESP_OK(twai_driver_install_v2(&g_config, &t_config, &f_config, &twai_buses[i]));
TEST_ESP_OK(twai_start_v2(twai_buses[i]));
}

printf("transmit message\r\n");
for (int i = 0; i < SOC_TWAI_CONTROLLER_NUM; i++) {
printf("transmit message from %d\r\n", i);
tx_msg.data[5] = SOC_TWAI_CONTROLLER_NUM - i;
TEST_ESP_OK(twai_transmit_v2(twai_buses[i], &tx_msg, pdMS_TO_TICKS(1000)));
}

printf("receive message\r\n");
twai_message_t rx_msg;
for (int i = 0; i < SOC_TWAI_CONTROLLER_NUM; i++) {
printf("receive message from %d\r\n", i);
TEST_ESP_OK(twai_receive_v2(twai_buses[i], &rx_msg, pdMS_TO_TICKS(1000)));
TEST_ASSERT_TRUE(rx_msg.data_length_code == 6);
tx_msg.data[5] = SOC_TWAI_CONTROLLER_NUM - i;
for (int i = 0; i < 6; i++) {
TEST_ASSERT_EQUAL(tx_msg.data[i], rx_msg.data[i]);
}
Expand Down
7 changes: 5 additions & 2 deletions components/driver/test_apps/twai/pytest_twai.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0

import logging
import subprocess
from time import sleep

import pytest
from can import Bus, Message
from can import Bus
from can import Message
from pytest_embedded import Dut


Expand All @@ -16,6 +16,7 @@
@pytest.mark.esp32h2
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32p4
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
Expand Down Expand Up @@ -46,6 +47,7 @@ def fixture_create_socket_can() -> Bus:
@pytest.mark.esp32h2
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32p4
@pytest.mark.twai_std
@pytest.mark.parametrize(
'config',
Expand Down Expand Up @@ -79,6 +81,7 @@ def test_twai_listen_only(dut: Dut, socket_can: Bus) -> None:
@pytest.mark.esp32h2
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32p4
@pytest.mark.twai_std
@pytest.mark.parametrize(
'config',
Expand Down
2 changes: 1 addition & 1 deletion components/esp-tls/esp_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static ssize_t tcp_write(esp_tls_t *tls, const char *data, size_t datalen)

ssize_t esp_tls_conn_read(esp_tls_t *tls, void *data, size_t datalen)
{
if (!tls || !data) {
if (!tls) {
return -1;
}
return tls->read(tls, (char *)data, datalen);
Expand Down
4 changes: 3 additions & 1 deletion components/esp_coex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ if(CONFIG_ESP_COEX_ENABLED)
endif()

if(CONFIG_ESP_WIFI_ENABLED)
list(APPEND srcs "${idf_target}/esp_coex_adapter.c")
list(APPEND srcs "${idf_target}/esp_coex_adapter.c"
"src/coexist_debug_diagram.c"
"src/coexist_debug.c")
endif()
endif()

Expand Down
Loading

0 comments on commit 1030f48

Please sign in to comment.