Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit c6c5302

Browse files
committed
vendors/espressif: Add support for esp32s3
1 parent d0e1de0 commit c6c5302

File tree

84 files changed

+9403
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+9403
-21
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake")
2+
3+
set(CMAKE_SYSTEM_NAME Generic)
4+
5+
# Find GCC for Xtensa-ESP32S2.
6+
afr_find_compiler(AFR_COMPILER_CC xtensa-esp32s3-elf-gcc)
7+
afr_find_compiler(AFR_COMPILER_CXX xtensa-esp32s3-elf-g++)
8+
9+
# Specify the cross compiler.
10+
set(CMAKE_C_COMPILER ${AFR_COMPILER_CC} CACHE FILEPATH "C compiler")
11+
set(CMAKE_CXX_COMPILER ${AFR_COMPILER_CXX} CACHE FILEPATH "C++ compiler")
12+
set(CMAKE_ASM_COMPILER ${AFR_COMPILER_CC} CACHE FILEPATH "ASM compiler")
13+
14+
# Disable compiler checks.
15+
set(CMAKE_C_COMPILER_FORCED TRUE)
16+
set(CMAKE_CXX_COMPILER_FORCED TRUE)
17+
18+
# Add target system root to cmake find path.
19+
get_filename_component(AFR_COMPILER_DIR "${AFR_COMPILER_CC}" DIRECTORY)
20+
get_filename_component(CMAKE_FIND_ROOT_PATH "${AFR_COMPILER_DIR}" DIRECTORY)
21+
22+
# Look for includes and libraries only in the target system prefix.
23+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
24+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
25+
26+
# Helper variables to abstracts some common compiler flags.
27+
set(AFR_COMPILER_NO_WARNINGS "-w" CACHE INTERNAL "")
28+
29+
# Global compiler flags.
30+
set(CMAKE_C_FLAGS "-mlongcalls" CACHE STRING "C Compiler Base Flags")
31+
set(CMAKE_CXX_FLAGS "-mlongcalls" CACHE STRING "C++ Compiler Base Flags")

vendors/espressif/boards/components/freertos/CMakeLists.txt

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ set(AMAZON_FREERTOS_KERNEL_DIR "${AFR_KERNEL_DIR}")
22
set(AMAZON_FREERTOS_FREERTOS_PLUS_DIR "${AFR_MODULES_FREERTOS_PLUS_DIR}")
33
set(AMAZON_FREERTOS_3RDPARTY_DIR "${AFR_3RDPARTY_DIR}")
44

5+
string(FIND "${AFR_BOARD_NAME}" "esp32s3" SOC_NAME_ESP32S3)
56
string(FIND "${AFR_BOARD_NAME}" "esp32s2" SOC_NAME_ESP32S2)
67
string(FIND "${AFR_BOARD_NAME}" "esp32" SOC_NAME_ESP32)
78

8-
if (NOT(${SOC_NAME_ESP32S2} EQUAL -1))
9+
if(NOT(${SOC_NAME_ESP32S3} EQUAL -1))
10+
set(SOC_NAME "esp32s3")
11+
elseif(NOT(${SOC_NAME_ESP32S2} EQUAL -1))
912
set(SOC_NAME "esp32s2")
1013
elseif(NOT($SOC_NAME_ESP32) EQUAL -1)
1114
set(SOC_NAME "esp32")
@@ -22,27 +25,12 @@ if(AFR_ENABLE_TESTS)
2225
list(APPEND include_dirs
2326
"${AMAZON_FREERTOS_FREERTOS_PLUS_DIR}/standard/freertos_plus_posix/include"
2427
"${AMAZON_FREERTOS_3RDPARTY_DIR}/unity/src"
28+
"${CMAKE_CURRENT_LIST_DIR}/../../${SOC_NAME}/aws_tests/config_files"
2529
)
26-
if(SOC_NAME STREQUAL "esp32s2")
27-
list(APPEND include_dirs
28-
"${CMAKE_CURRENT_LIST_DIR}/../../esp32s2/aws_tests/config_files"
29-
)
30-
else()
31-
list(APPEND include_dirs
32-
"${CMAKE_CURRENT_LIST_DIR}/../../esp32/aws_tests/config_files"
33-
)
34-
endif()
35-
3630
else()
37-
if(SOC_NAME STREQUAL "esp32s2")
38-
list(APPEND include_dirs
39-
"${CMAKE_CURRENT_LIST_DIR}/../../esp32s2/aws_demos/config_files"
40-
)
41-
else()
42-
list(APPEND include_dirs
43-
"${CMAKE_CURRENT_LIST_DIR}/../../esp32/aws_demos/config_files"
44-
)
45-
endif()
31+
list(APPEND include_dirs
32+
"${CMAKE_CURRENT_LIST_DIR}/../../${SOC_NAME}/aws_demos/config_files"
33+
)
4634
endif()
4735

4836
# Edit following two lines to set component requirements (see docs)

vendors/espressif/boards/components/mbedtls/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ set(MBEDTLS_DIR "${AFR_VENDORS_DIR}/espressif/esp-idf/components/mbedtls")
66
set(ESP_HW_SUPPORT_DIR "${AFR_VENDORS_DIR}/espressif/esp-idf/components/esp_hw_support")
77
set(ESP_PM_DIR "${AFR_VENDORS_DIR}/espressif/esp-idf/components/esp_pm")
88

9+
string(FIND "${AFR_BOARD_NAME}" "esp32s3" SOC_NAME_ESP32S3)
910
string(FIND "${AFR_BOARD_NAME}" "esp32s2" SOC_NAME_ESP32S2)
1011
string(FIND "${AFR_BOARD_NAME}" "esp32" SOC_NAME_ESP32)
1112

12-
if (NOT(${SOC_NAME_ESP32S2} EQUAL -1))
13+
if(NOT(${SOC_NAME_ESP32S3} EQUAL -1))
14+
set(SOC_NAME "esp32s3")
15+
elseif(NOT(${SOC_NAME_ESP32S2} EQUAL -1))
1316
set(SOC_NAME "esp32s2")
1417
elseif(NOT($SOC_NAME_ESP32) EQUAL -1)
1518
set(SOC_NAME "esp32")
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore the build artifacts in the projects.
2+
*build*

0 commit comments

Comments
 (0)