Merge branch 'feature/esp32c2_hal_rom_impl' into 'master'

esp32c2: clean up ROM impl && enable pytest build

See merge request espressif/esp-idf!18021
This commit is contained in:
morris 2022-05-12 14:11:45 +08:00
commit 8ff7b0c998
43 changed files with 270 additions and 145 deletions

View File

@ -65,6 +65,13 @@ build_pytest_examples_esp32c3:
script:
- run_cmd python tools/ci/build_pytest_apps.py examples --target esp32c3 --size-info $SIZE_INFO_LOCATION -vv
build_pytest_examples_esp32c2:
extends:
- .build_pytest_template
- .rules:build:example_test-esp32c2
script:
- run_cmd python tools/ci/build_pytest_apps.py examples --target esp32c2 --size-info $SIZE_INFO_LOCATION -vv
build_pytest_components_esp32:
extends:
- .build_pytest_template
@ -93,6 +100,13 @@ build_pytest_components_esp32c3:
script:
- run_cmd python tools/ci/build_pytest_apps.py components --target esp32c3 --size-info $SIZE_INFO_LOCATION -vv
build_pytest_components_esp32c2:
extends:
- .build_pytest_template
- .rules:build:component_ut-esp32c2
script:
- run_cmd python tools/ci/build_pytest_apps.py components --target esp32c2 --size-info $SIZE_INFO_LOCATION -vv
build_non_test_components_apps:
extends:
- .build_template

View File

@ -88,7 +88,7 @@ if(${target} STREQUAL "esp32")
"esp32/dac.c")
endif()
if(IDF_TARGET STREQUAL "esp32s2")
if(${target} STREQUAL "esp32s2")
list(APPEND srcs "dac_common.c"
"touch_sensor_common.c"
"esp32s2/touch_sensor.c"
@ -103,7 +103,7 @@ if(${target} STREQUAL "esp32s3")
"esp32s3/touch_sensor.c")
endif()
if(IDF_TARGET STREQUAL "esp32c3")
if(${target} STREQUAL "esp32c3")
list(APPEND srcs "esp32c3/adc2_init_cal.c")
endif()

View File

@ -128,7 +128,7 @@ void rtc_vddsdio_set_config(rtc_vddsdio_config_t config)
static void set_ocode_by_efuse(int calib_version)
{
// ESP32C2-TODO: IDF-4940
abort();
ESP_HW_LOGW(TAG, "set_ocode_by_efuse not supported yet");
}
static void calibrate_ocode(void)

View File

@ -200,7 +200,7 @@ else() # Regular app build
rom_linker_script("newlib-nano")
endif()
if(CONFIG_HEAP_ROM_IMPL)
if(CONFIG_HEAP_TLSF_USE_ROM_IMPL)
rom_linker_script("heap")
endif()
endif()

View File

@ -26,3 +26,15 @@ config ESP_ROM_GET_CLK_FREQ
config ESP_ROM_HAS_RVFPLIB
bool
default y
config ESP_ROM_HAS_HAL_WDT
bool
default y
config ESP_ROM_HAS_HAL_SYSTIMER
bool
default y
config ESP_ROM_HAS_HEAP_TLSF
bool
default y

View File

@ -11,4 +11,7 @@
#define ESP_ROM_UART_CLK_IS_XTAL (1) // UART clock source is selected to XTAL in ROM
#define ESP_ROM_HAS_RETARGETABLE_LOCKING (1) // ROM was built with retargetable locking
#define ESP_ROM_GET_CLK_FREQ (1) // Get clk frequency with rom function `ets_get_cpu_frequency`
#define ESP_ROM_HAS_RVFPLIB (1) // ROM has the rvfplib
#define ESP_ROM_HAS_RVFPLIB (1) // ROM has the rvfplib
#define ESP_ROM_HAS_HAL_WDT (1) // ROM has the implementation of Watchdog HAL driver
#define ESP_ROM_HAS_HAL_SYSTIMER (1) // ROM has the implementation of Systimer HAL driver
#define ESP_ROM_HAS_HEAP_TLSF (1) // ROM has the implementation of the tlsf and multi-heap library

View File

@ -38,3 +38,7 @@ config ESP_ROM_HAS_ERASE_0_REGION_BUG
config ESP_ROM_GET_CLK_FREQ
bool
default y
config ESP_ROM_HAS_HAL_WDT
bool
default y

View File

@ -15,3 +15,4 @@
#define ESP_ROM_USB_SERIAL_DEVICE_NUM (4) // The serial port ID (UART, USB, ...) of USB_SERIAL_JTAG in the ROM.
#define ESP_ROM_HAS_ERASE_0_REGION_BUG (1) // ROM has esp_flash_erase_region(size=0) bug
#define ESP_ROM_GET_CLK_FREQ (1) // Get clk frequency with rom function `ets_get_cpu_frequency`
#define ESP_ROM_HAS_HAL_WDT (1) // ROM has the implementation of Watchdog HAL driver

View File

@ -366,6 +366,7 @@ menu "ESP System Settings"
config ESP_INT_WDT
bool "Interrupt watchdog"
default n if IDF_TARGET_ESP32C2 # add support in IDF-4114
default y
help
This watchdog timer can detect if the FreeRTOS tick interrupt has not been called for a certain time,

View File

@ -151,9 +151,6 @@ void esp_int_wdt_cpu_init(void)
#if SOC_TIMER_GROUPS > 1
esp_rom_route_intr_matrix(cpu_hal_get_core_id(), ETS_TG1_WDT_LEVEL_INTR_SOURCE, WDT_INT_NUM);
#else
// TODO: Clean up code for ESP32-C2, IDF-4114
ESP_EARLY_LOGW("INT_WDT", "ESP32-C2 only has one timer group");
#endif
/* Set the type and priority to watch dog interrupts */

View File

@ -8,7 +8,7 @@ set(srcs "mpu_hal.c"
set(includes "${target}/include" "include" "platform_port/include")
if(NOT CONFIG_HAL_WDT_ROM_IMPL)
if(NOT CONFIG_HAL_WDT_USE_ROM_IMPL)
list(APPEND srcs "wdt_hal_iram.c")
endif()
@ -16,7 +16,7 @@ if(NOT ${target} STREQUAL "esp32")
list(APPEND srcs "cache_hal.c")
endif()
if(target STREQUAL "esp32h2")
if(${target} STREQUAL "esp32h2")
if(CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_1)
list(APPEND includes "${target}/include/rev1")
elseif(CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2)
@ -49,50 +49,64 @@ if(NOT BOOTLOADER_BUILD)
"adc_hal_common.c"
"adc_hal.c")
if(CONFIG_SOC_SYSTIMER_SUPPORTED)
if(NOT CONFIG_HAL_SYSTIMER_ROM_IMPL)
list(APPEND srcs "systimer_hal.c")
endif()
if(CONFIG_SOC_SYSTIMER_SUPPORTED AND NOT CONFIG_HAL_SYSTIMER_USE_ROM_IMPL)
list(APPEND srcs "systimer_hal.c")
endif()
if(CONFIG_SOC_RMT_SUPPORTED)
list(APPEND srcs "rmt_hal.c")
endif()
if(CONFIG_SOC_PCNT_SUPPORTED)
list(APPEND srcs "pcnt_hal.c")
endif()
if(CONFIG_SOC_MCPWM_SUPPORTED)
list(APPEND srcs "mcpwm_hal.c")
endif()
if(CONFIG_SOC_TWAI_SUPPORTED)
list(APPEND srcs "twai_hal.c" "twai_hal_iram.c")
endif()
if(CONFIG_SOC_GDMA_SUPPORTED)
list(APPEND srcs "gdma_hal.c")
endif()
if(CONFIG_SOC_I2S_SUPPORTED)
list(APPEND srcs "i2s_hal.c")
endif()
if(CONFIG_SOC_SIGMADELTA_SUPPORTED)
list(APPEND srcs "sigmadelta_hal.c")
endif()
if(CONFIG_ETH_USE_ESP32_EMAC)
list(APPEND srcs "emac_hal.c")
endif()
if(${target} STREQUAL "esp32")
list(APPEND srcs
"dac_hal.c"
"rmt_hal.c"
"sigmadelta_hal.c"
"mcpwm_hal.c"
"pcnt_hal.c"
"sdio_slave_hal.c"
"touch_sensor_hal.c"
"i2s_hal.c"
"twai_hal.c"
"twai_hal_iram.c"
"aes_hal.c"
"esp32/adc_hal.c"
"esp32/brownout_hal.c"
"esp32/interrupt_descriptor_table.c"
"esp32/touch_sensor_hal.c"
"esp32/gpio_hal_workaround.c")
if(NOT BOOTLOADER_BUILD AND CONFIG_ETH_USE_ESP32_EMAC)
list(APPEND srcs "emac_hal.c")
endif()
endif()
if(${target} STREQUAL "esp32s2")
list(APPEND srcs
"dac_hal.c"
"rmt_hal.c"
"sigmadelta_hal.c"
"pcnt_hal.c"
"spi_flash_hal_gpspi.c"
"spi_slave_hd_hal.c"
"touch_sensor_hal.c"
"usb_hal.c"
"usb_phy_hal.c"
"xt_wdt_hal.c"
"i2s_hal.c"
"twai_hal.c"
"twai_hal_iram.c"
"aes_hal.c"
"esp32s2/brownout_hal.c"
"esp32s2/cp_dma_hal.c"
@ -105,21 +119,13 @@ if(NOT BOOTLOADER_BUILD)
if(${target} STREQUAL "esp32s3")
list(APPEND srcs
"ds_hal.c"
"rmt_hal.c"
"sigmadelta_hal.c"
"gdma_hal.c"
"lcd_hal.c"
"mcpwm_hal.c"
"pcnt_hal.c"
"spi_flash_hal_gpspi.c"
"spi_slave_hd_hal.c"
"touch_sensor_hal.c"
"usb_hal.c"
"usb_phy_hal.c"
"xt_wdt_hal.c"
"i2s_hal.c"
"twai_hal.c"
"twai_hal_iram.c"
"aes_hal.c"
"esp32s3/brownout_hal.c"
"esp32s3/hmac_hal.c"
@ -132,15 +138,9 @@ if(NOT BOOTLOADER_BUILD)
if(${target} STREQUAL "esp32c3")
list(APPEND srcs
"ds_hal.c"
"gdma_hal.c"
"rmt_hal.c"
"sigmadelta_hal.c"
"spi_flash_hal_gpspi.c"
"spi_slave_hd_hal.c"
"xt_wdt_hal.c"
"i2s_hal.c"
"twai_hal.c"
"twai_hal_iram.c"
"aes_hal.c"
"esp32c3/adc_hal.c"
"esp32c3/brownout_hal.c"
@ -151,14 +151,8 @@ if(NOT BOOTLOADER_BUILD)
if(${target} STREQUAL "esp32h2")
list(APPEND srcs
"ds_hal.c"
"gdma_hal.c"
"rmt_hal.c"
"sigmadelta_hal.c"
"spi_flash_hal_gpspi.c"
"spi_slave_hd_hal.c"
"i2s_hal.c"
"twai_hal.c"
"twai_hal_iram.c"
"aes_hal.c"
"esp32h2/brownout_hal.c"
"esp32h2/hmac_hal.c"
@ -168,7 +162,6 @@ if(NOT BOOTLOADER_BUILD)
if(${target} STREQUAL "esp32c2")
list(APPEND srcs
"ecc_hal.c"
"gdma_hal.c"
"spi_flash_hal_gpspi.c"
"spi_slave_hd_hal.c"
"esp32c2/brownout_hal.c"

View File

@ -65,14 +65,9 @@ menu "Hardware Abstraction Layer (HAL) and Low Level (LL)"
default 4 if HAL_LOG_LEVEL_DEBUG
default 5 if HAL_LOG_LEVEL_VERBOSE
config HAL_SYSTIMER_HAS_ROM_IMPL
bool
depends on IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32S3
default y if IDF_TARGET_ESP32C2 # TODO: IDF-4917
config HAL_SYSTIMER_ROM_IMPL
bool "Use systimer HAL implementation in ROM"
depends on HAL_SYSTIMER_HAS_ROM_IMPL
config HAL_SYSTIMER_USE_ROM_IMPL
bool "Use ROM implementation of SysTimer HAL driver"
depends on ESP_ROM_HAS_HAL_SYSTIMER
default y
help
Enable this flag to use HAL functions from ROM instead of ESP-IDF.
@ -83,14 +78,9 @@ menu "Hardware Abstraction Layer (HAL) and Low Level (LL)"
features will be added and bugs will be fixed in the IDF source
but cannot be synced to ROM.
config HAL_WDT_HAS_ROM_IMPL
bool
depends on IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32S3
default y if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32S3
config HAL_WDT_ROM_IMPL
bool "Use WDT HAL implementation in ROM"
depends on HAL_WDT_HAS_ROM_IMPL
config HAL_WDT_USE_ROM_IMPL
bool "Use ROM implementation of WDT HAL driver"
depends on ESP_ROM_HAS_HAL_WDT
default y
help
Enable this flag to use HAL functions from ROM instead of ESP-IDF.

View File

@ -16,14 +16,14 @@ entries:
i2c_hal_iram (noflash)
cpu_hal (noflash)
soc_hal (noflash)
if HAL_WDT_HAS_ROM_IMPL = n || HAL_WDT_ROM_IMPL = n:
if HAL_WDT_USE_ROM_IMPL = n:
wdt_hal_iram (noflash)
if SOC_SYSTIMER_SUPPORTED = y && HAL_SYSTIMER_USE_ROM_IMPL = n:
systimer_hal (noflash)
if TWAI_ISR_IN_IRAM = y:
twai_hal_iram (noflash)
if IDF_TARGET_ESP32 = n:
spi_flash_hal_gpspi (noflash)
if HAL_SYSTIMER_HAS_ROM_IMPL = n || HAL_SYSTIMER_ROM_IMPL = n:
systimer_hal (noflash)
if GPTIMER_CTRL_FUNC_IN_IRAM = y:
timer_hal_iram (noflash)
if GPIO_CTRL_FUNC_IN_IRAM = y:

View File

@ -3,7 +3,7 @@ set(srcs
"heap_caps_init.c"
"multi_heap.c")
if(NOT CONFIG_HEAP_ROM_IMPL)
if(NOT CONFIG_HEAP_TLSF_USE_ROM_IMPL)
list(APPEND srcs "heap_tlsf.c")
endif()

View File

@ -71,14 +71,9 @@ menu "Heap memory debugging"
help
When enabled, if a memory allocation operation fails it will cause a system abort.
config HEAP_HAS_ROM_IMPL
bool
depends on IDF_TARGET_ESP32C2
default y if IDF_TARGET_ESP32C2
config HEAP_ROM_IMPL
bool "Use heap implementation in ROM"
depends on HEAP_HAS_ROM_IMPL
config HEAP_TLSF_USE_ROM_IMPL
bool "Use ROM implementation of heap tlsf library"
depends on ESP_ROM_HAS_HEAP_TLSF
default y
help
Enable this flag to use heap functions from ROM instead of ESP-IDF.

View File

@ -49,7 +49,7 @@ void heap_caps_enable_nonos_stack_heaps(void)
*/
void heap_caps_init(void)
{
#ifdef CONFIG_HEAP_ROM_IMPL
#ifdef CONFIG_HEAP_TLSF_USE_ROM_IMPL
extern void multi_heap_in_rom_init(void);
multi_heap_in_rom_init();
#endif

View File

@ -1,7 +1,7 @@
[mapping:heap]
archive: libheap.a
entries:
if HEAP_HAS_ROM_IMPL = n || HEAP_ROM_IMPL = n:
if HEAP_TLSF_USE_ROM_IMPL = n:
heap_tlsf (noflash)
multi_heap (noflash)
if HEAP_POISONING_DISABLED = n:

View File

@ -22,7 +22,7 @@
/* Defines compile-time configuration macros */
#include "multi_heap_config.h"
#if (!defined MULTI_HEAP_POISONING) && (!defined CONFIG_HEAP_ROM_IMPL)
#if (!defined MULTI_HEAP_POISONING) && (!defined CONFIG_HEAP_TLSF_USE_ROM_IMPL)
/* if no heap poisoning, public API aliases directly to these implementations */
void *multi_heap_malloc(multi_heap_handle_t heap, size_t size)
__attribute__((alias("multi_heap_malloc_impl")));
@ -77,7 +77,7 @@ typedef struct multi_heap_info {
tlsf_t heap_data;
} heap_t;
#ifdef CONFIG_HEAP_ROM_IMPL
#ifdef CONFIG_HEAP_TLSF_USE_ROM_IMPL
void _multi_heap_lock(void *lock)
{
@ -99,7 +99,7 @@ void multi_heap_in_rom_init(void)
multi_heap_os_funcs_init(&multi_heap_os_funcs);
}
#else //#ifndef CONFIG_HEAP_ROM_IMPL
#else //#ifndef CONFIG_HEAP_TLSF_USE_ROM_IMPL
/* Return true if this block is free. */
static inline bool is_free(const block_header_t *block)

View File

@ -334,7 +334,7 @@ multi_heap_handle_t multi_heap_register(void *start, size_t size)
memset(start, FREE_FILL_PATTERN, size);
}
#endif
#ifdef CONFIG_HEAP_ROM_IMPL
#ifdef CONFIG_HEAP_TLSF_USE_ROM_IMPL
tlsf_poison_fill_pfunc_set(multi_heap_internal_poison_fill_region);
#endif
return multi_heap_register_impl(start, size);

View File

@ -32,8 +32,8 @@ from _pytest.terminal import TerminalReporter
from pytest_embedded.plugin import apply_count, parse_configuration
from pytest_embedded.utils import find_by_suffix
SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3']
PREVIEW_TARGETS = ['linux', 'esp32h2', 'esp32c2']
SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2']
PREVIEW_TARGETS = ['linux', 'esp32h2']
DEFAULT_SDKCONFIG = 'default'
@ -195,16 +195,20 @@ class IdfPytestEmbedded:
)
self._failed_cases: List[
Tuple[str, bool]
] = [] # (test_case_name, is_known_failure_cases)
Tuple[str, bool, bool]
] = [] # (test_case_name, is_known_failure_cases, is_xfail)
@property
def failed_cases(self) -> List[str]:
return [case for case, is_known in self._failed_cases if not is_known]
return [case for case, is_known, is_xfail in self._failed_cases if not is_known and not is_xfail]
@property
def known_failure_cases(self) -> List[str]:
return [case for case, is_known in self._failed_cases if is_known]
return [case for case, is_known, _ in self._failed_cases if is_known]
@property
def xfail_cases(self) -> List[str]:
return [case for case, _, is_xfail in self._failed_cases if is_xfail]
@staticmethod
def _parse_known_failure_cases_file(
@ -278,7 +282,8 @@ class IdfPytestEmbedded:
if report.outcome == 'failed':
test_case_name = item.funcargs.get('test_case_name', '')
is_known_failure = self._is_known_failure(test_case_name)
self._failed_cases.append((test_case_name, is_known_failure))
is_xfail = report.keywords.get('xfail', False)
self._failed_cases.append((test_case_name, is_known_failure, is_xfail))
return report
@ -327,6 +332,10 @@ class IdfPytestEmbedded:
terminalreporter.section('Known failure cases', bold=True, yellow=True)
terminalreporter.line('\n'.join(self.known_failure_cases))
if self.xfail_cases:
terminalreporter.section('xfail cases', bold=True, yellow=True)
terminalreporter.line('\n'.join(self.xfail_cases))
if self.failed_cases:
terminalreporter.section('Failed cases', bold=True, red=True)
terminalreporter.line('\n'.join(self.failed_cases))

View File

@ -411,6 +411,25 @@ VFS
* :ref:`CONFIG_VFS_SUPPORT_DIR` — can be disabled if the application doesn't use directory related functions, such as ``readdir`` (see the description of this option for the complete list). Applications which only open, read and write specific files and don't need to enumerate or create directories can disable this option, reducing the code size by 0.5 kB or more, depending on the filesystem drivers in use.
* :ref:`CONFIG_VFS_SUPPORT_IO` — can be disabled if the application doesn't use filesystems or file-like peripheral drivers. This disables all VFS functionality, including the three options mentioned above. When this option is disabled, :doc:`console </api-reference/system/console>` can't be used. Note that the application can still use standard I/O functions with socket file descriptors when this option is disabled. Compared to the default configuration, disabling this option reduces code size by about 9.4 kB.
.. only:: esp32c2
HAL
@@@
.. list::
:CONFIG_ESP_ROM_HAS_HAL_SYSTIMER: * Enabling :ref:`CONFIG_HAL_SYSTIMER_USE_ROM_IMPL` can reduce the IRAM usage and binary size by linking in the systimer HAL driver of ROM implementation.
:CONFIG_ESP_ROM_HAS_HAL_WDT: * Enabling :ref:`CONFIG_HAL_WDT_USE_ROM_IMPL` can reduce the IRAM usage and binary size by linking in the watchdog HAL driver of ROM implementation.
.. only:: esp32c2
Heap
@@@@
.. list::
:CONFIG_ESP_ROM_HAS_HEAP_TLSF: * Enabling :ref:`CONFIG_HEAP_TLSF_USE_ROM_IMPL` can reduce the IRAM usage and binary size by linking in the TLSF library of ROM implementation.
Bootloader Size
---------------

View File

@ -1,15 +1,14 @@
/* Hello World Example
/*
* SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
*/
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_chip_info.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
void app_main(void)

View File

@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#include <stdbool.h>
#include <setjmp.h>

View File

@ -0,0 +1,28 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define CHIP_FEATURE_EMB_FLASH (1UL << 0)
#define CHIP_FEATURE_BT (1UL << 4)
#define CHIP_FEATURE_BLE (1UL << 5)
typedef struct {
uint32_t features; //!< bit mask of CHIP_FEATURE_x feature flags
uint8_t cores; //!< number of CPU cores
uint8_t revision; //!< chip revision number
} esp_chip_info_t;
void esp_chip_info(esp_chip_info_t *out_info);
#ifdef __cplusplus
}
#endif

View File

@ -1,15 +1,16 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#pragma once
#include <stdint.h>
#define CHIP_FEATURE_EMB_FLASH (1UL << 0)
#define CHIP_FEATURE_BT (1UL << 4)
#define CHIP_FEATURE_BLE (1UL << 5)
typedef struct {
uint32_t features; //!< bit mask of CHIP_FEATURE_x feature flags
uint8_t cores; //!< number of CPU cores
uint8_t revision; //!< chip revision number
} esp_chip_info_t;
#ifdef __cplusplus
extern "C" {
#endif
void esp_restart(void);
void esp_chip_info(esp_chip_info_t* out_info);
#ifdef __cplusplus
}
#endif

View File

@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#include "esp_spi_flash.h"
int spi_flash_get_chip_size(void)

View File

@ -1,7 +1,12 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#include <stdio.h>
#include <unistd.h>
#include <setjmp.h>
#include "esp_system.h"
#include "esp_chip_info.h"
extern jmp_buf buf;

View File

@ -1,7 +1,20 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define portTICK_PERIOD_MS 1000
void vTaskDelay( const uint32_t xTicksToDelay );
#ifdef __cplusplus
}
#endif

View File

@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#include <unistd.h>
#include "freertos/task.h"

View File

@ -1,5 +1,19 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#pragma once
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
int spi_flash_get_chip_size(void);
#ifdef __cplusplus
}
#endif

View File

@ -1,3 +1,9 @@
idf_component_register(SRCS "src/led_strip_rmt_dev.c" "src/led_strip_rmt_encoder.c"
set(srcs)
if(CONFIG_SOC_RMT_SUPPORTED)
list(APPEND srcs "src/led_strip_rmt_dev.c" "src/led_strip_rmt_encoder.c")
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS "include" "interface"
PRIV_REQUIRES "driver")

View File

@ -12,7 +12,7 @@ Before project configuration and build, be sure to set the correct chip target u
### Hardware Required
* A development board with ESP32/ESP32-S2/ESP32-S3/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
* A development board with Espressif SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
* A USB cable for Power supply and programming
Some development boards use an addressable LED instead of a regular one. These development boards include:
@ -48,7 +48,7 @@ See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/l
## Example Output
As you run the example, you will see the LED blinking, according to the previously defined period. For the addressable LED, you can also change the LED color by setting the `led_strip_set_pixel(pStrip_a, 0, 16, 16, 16);` (LED Strip, Pixel Number, Red, Green, Blue) with values from 0 to 255 in the `blink.c` file.
As you run the example, you will see the LED blinking, according to the previously defined period. For the addressable LED, you can also change the LED color by setting the `led_strip_set_pixel(led_strip, 0, 16, 16, 16);` (LED Strip, Pixel Number, Red, Green, Blue) with values from 0 to 255 in the [source file](main/blink_example_main.c).
```
I (315) example: Example configured to blink addressable LED!

View File

@ -1,2 +1,2 @@
idf_component_register(SRCS "blink_example_main.c"
INCLUDE_DIRS ".")
INCLUDE_DIRS ".")

View File

@ -2,7 +2,7 @@ menu "Example Configuration"
choice BLINK_LED
prompt "Blink LED type"
default BLINK_LED_GPIO if IDF_TARGET_ESP32
default BLINK_LED_GPIO if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C2
default BLINK_LED_RMT
help
Defines the default peripheral for blink example
@ -16,7 +16,7 @@ menu "Example Configuration"
config BLINK_GPIO
int "Blink GPIO number"
range 0 48
default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2
default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2 || IDF_TARGET_ESP32C2
default 18 if IDF_TARGET_ESP32S2
default 48 if IDF_TARGET_ESP32S3
default 5

View File

@ -1,3 +1,5 @@
| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 |
| ----------------- | ----- | -------- | -------- | -------- |
# Wi-Fi Provisioning Manager Example
(See the README.md file in the upper level 'examples' directory for more information about examples.)

View File

@ -1,3 +1,5 @@
| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 |
| ----------------- | ----- | -------- | -------- | -------- |
# Native OTA example
This example is based on `app_update` component's APIs.

View File

@ -19,8 +19,9 @@ markers =
esp32s2: support esp32s2 target
esp32s3: support esp32s3 target
esp32c3: support esp32c3 target
supported_targets: support all supported targets ('esp32', 'esp32s2', 'esp32c3', 'esp32s3')
preview_targets: support all preview targets ('linux', 'esp32h2', 'esp32c2')
esp32c2: support esp32c2 target
supported_targets: support all supported targets ('esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2')
preview_targets: support all preview targets ('linux', 'esp32h2')
all_targets: support all targets, including supported ones and preview ones
# env markers

View File

@ -18,13 +18,13 @@ from idf_ci_utils import IDF_PATH, get_pytest_cases
try:
from build_apps import build_apps
from find_apps import find_builds_for_app
from find_build_apps import BuildItem, config_rules_from_str, setup_logging
from find_build_apps import BuildItem, CMakeBuildSystem, config_rules_from_str, setup_logging
except ImportError:
sys.path.append(os.path.join(IDF_PATH, 'tools'))
from build_apps import build_apps
from find_apps import find_builds_for_app
from find_build_apps import BuildItem, config_rules_from_str, setup_logging
from find_build_apps import BuildItem, CMakeBuildSystem, config_rules_from_str, setup_logging
def main(args: argparse.Namespace) -> None:
@ -50,15 +50,16 @@ def main(args: argparse.Namespace) -> None:
config_rules = config_rules_from_str(args.config or [])
for app_dir in app_dirs:
app_dir = os.path.realpath(app_dir)
build_items += find_builds_for_app(
app_path=app_dir,
work_dir=app_dir,
build_dir='build_@t_@w',
build_log=f'{app_dir}/build_@t_@w/build.log',
target_arg=args.target,
build_system='cmake',
config_rules=config_rules,
)
if args.target in CMakeBuildSystem.supported_targets(app_dir):
build_items += find_builds_for_app(
app_path=app_dir,
work_dir=app_dir,
build_dir='build_@t_@w',
build_log=f'{app_dir}/build_@t_@w/build.log',
target_arg=args.target,
build_system='cmake',
config_rules=config_rules,
)
modified_build_items = []
# auto clean up the binaries if no flag --preserve-all

View File

@ -1947,14 +1947,6 @@ examples/bluetooth/nimble/bleprph_wifi_coex/main/bleprph.h
examples/bluetooth/nimble/bleprph_wifi_coex/main/gatt_svr.c
examples/bluetooth/nimble/bleprph_wifi_coex/main/main.c
examples/build_system/cmake/component_manager/main/component_manager.c
examples/build_system/cmake/idf_as_lib/main.c
examples/build_system/cmake/idf_as_lib/stubs/esp32/cpu_start.c
examples/build_system/cmake/idf_as_lib/stubs/esp32/esp_system.h
examples/build_system/cmake/idf_as_lib/stubs/esp32/flash_ops.c
examples/build_system/cmake/idf_as_lib/stubs/esp32/system_api.c
examples/build_system/cmake/idf_as_lib/stubs/freertos/freertos/task.h
examples/build_system/cmake/idf_as_lib/stubs/freertos/task.c
examples/build_system/cmake/idf_as_lib/stubs/spi_flash/esp_spi_flash.h
examples/build_system/cmake/import_lib/main/main.cpp
examples/build_system/cmake/import_prebuilt/main/main.c
examples/build_system/cmake/import_prebuilt/prebuilt/components/prebuilt/prebuilt.c

View File

@ -25,5 +25,5 @@ if os.name != 'nt':
URL_TO_DOC = 'https://docs.espressif.com/projects/esp-idf'
SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3']
PREVIEW_TARGETS = ['linux', 'esp32h2', 'esp32c2']
SUPPORTED_TARGETS = ['esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2']
PREVIEW_TARGETS = ['linux', 'esp32h2']

View File

@ -0,0 +1,5 @@
CONFIG_IDF_TARGET="esp32c2"
CONFIG_HAL_WDT_USE_ROM_IMPL=y
CONFIG_HAL_SYSTIMER_USE_ROM_IMPL=y
CONFIG_HEAP_TLSF_USE_ROM_IMPL=y
CONFIG_SPI_FLASH_ROM_IMPL=y

View File

@ -1,5 +0,0 @@
CONFIG_IDF_TARGET="esp32c2"
CONFIG_HAL_WDT_ROM_IMPL=n
CONFIG_HAL_SYSTIMER_ROM_IMPL=n
CONFIG_HEAP_ROM_IMPL=n
CONFIG_SPI_FLASH_ROM_IMPL=y

View File

@ -0,0 +1,5 @@
CONFIG_IDF_TARGET="esp32c2"
CONFIG_HAL_WDT_USE_ROM_IMPL=n
CONFIG_HAL_SYSTIMER_USE_ROM_IMPL=n
CONFIG_HEAP_TLSF_USE_ROM_IMPL=n
CONFIG_SPI_FLASH_ROM_IMPL=n