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

Update ESP32 series to IDF 5.1.3 #2829

Merged
merged 165 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
9000598
IDF 5.1.1 update
AdrianSoundy Aug 23, 2023
cedac61
Code style fixes
nfbot Nov 14, 2023
71f92cc
update tools cache key
AdrianSoundy Nov 14, 2023
91e2be6
Update Esp32 build for azure pipelines and idf 5.1.1
AdrianSoundy Nov 16, 2023
955e05f
Make sure mbedtls/version.h is included.
AdrianSoundy Nov 17, 2023
298a7af
Azure builds don't have lwip
AdrianSoundy Nov 17, 2023
358b6eb
Further changes for AzureRtos - Network
AdrianSoundy Nov 17, 2023
a6209ce
Update download-install-esp32-build-components.yml
AdrianSoundy Nov 17, 2023
c33e029
Update docker sources and add diagnostics for build
AdrianSoundy Nov 19, 2023
b66b2af
Back out changes
AdrianSoundy Nov 20, 2023
5500093
Remove fix install.ps1 step again
AdrianSoundy Nov 20, 2023
f9e0efe
Comment out code to remove cmake from path to see what happens
AdrianSoundy Nov 23, 2023
a39d75e
Update devcontainer to python 3.11
AdrianSoundy Nov 23, 2023
618b513
For ESP32 BLE targets allow ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION to…
AdrianSoundy Nov 23, 2023
f804a6c
Minor fixes in comments
josesimoes Dec 7, 2023
7f5a449
Add missing entry for new API
josesimoes Dec 7, 2023
31010da
Remove commented code
josesimoes Dec 7, 2023
6446cfa
Minor style fixes
josesimoes Dec 7, 2023
25e4e1d
Bump version
josesimoes Dec 7, 2023
a26440c
Add missing empty line at end of file
josesimoes Dec 7, 2023
b8ce9ef
Code style fixes
josesimoes Dec 7, 2023
8148d6b
Add check for platform ESP32 as currently is the only one using mbedT…
josesimoes Dec 7, 2023
53ee30f
Add empty line
josesimoes Dec 7, 2023
6eb6a7e
Code style fixes
josesimoes Dec 7, 2023
12cd406
Rename and code style fixes
josesimoes Dec 7, 2023
6bc2954
Add back comment
josesimoes Dec 7, 2023
769d77b
Code style fixes
josesimoes Dec 7, 2023
0a7d851
Replace license header
josesimoes Dec 7, 2023
fe42b8a
Code style fixes
josesimoes Dec 7, 2023
c9273ef
Code style fixes
josesimoes Dec 7, 2023
d79a189
Fix install and cache of python requirements
josesimoes Dec 12, 2023
69ca7fe
Update github tag for IDF repo
josesimoes Dec 12, 2023
e5be262
Fix path to requirements file
josesimoes Dec 12, 2023
bd58c0c
Fix path to requirements file
josesimoes Dec 12, 2023
348bd57
Add back tweaks to IDF install
josesimoes Dec 12, 2023
c9c9af2
Fix installing IDF without Python features
josesimoes Dec 12, 2023
dc4b754
Fix getting path to IDF tools
josesimoes Dec 12, 2023
4159b7c
Disable Thread from build options
josesimoes Dec 12, 2023
6e56c74
Add missing build Presets for new ESP32 targets
josesimoes Dec 12, 2023
52e7a3f
Fix H2 doesn't seem to have support for ADC
josesimoes Dec 12, 2023
d10d6c2
Fix generating 16MB partition tables
josesimoes Dec 12, 2023
9a33412
Update ADC driver to use SOC config
AdrianSoundy Dec 13, 2023
b885481
Minimum Thread assembly for build
AdrianSoundy Dec 14, 2023
1b106a6
Fix devcontainers
networkfusion Dec 27, 2023
21fb593
Bump IDF to 5.1.2
josesimoes Jan 5, 2024
1b063ba
Revert "Bump IDF to 5.1.2"
josesimoes Jan 5, 2024
c786c58
Fix to BlockStorage to unitialize devices
AdrianSoundy Jan 7, 2024
efe809f
Merge branch 'main' into IDF5.1
AdrianSoundy Jan 7, 2024
d7fc395
Update sdkconfig.default_nopsram_rev3.esp32
AdrianSoundy Jan 7, 2024
f0a0cdb
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jan 9, 2024
50cbb43
Merge branch 'IDF5.1' of https://github.com/AdrianSoundy/nf-interpret…
AdrianSoundy Jan 10, 2024
2434243
IDF 5.1.1 update
AdrianSoundy Aug 23, 2023
026dc6e
Code style fixes
nfbot Nov 14, 2023
749770e
update tools cache key
AdrianSoundy Nov 14, 2023
71433c7
Update Esp32 build for azure pipelines and idf 5.1.1
AdrianSoundy Nov 16, 2023
b3f15a1
Make sure mbedtls/version.h is included.
AdrianSoundy Nov 17, 2023
1348aae
Further changes for AzureRtos - Network
AdrianSoundy Nov 17, 2023
410ded4
Update download-install-esp32-build-components.yml
AdrianSoundy Nov 17, 2023
cca58c0
Update docker sources and add diagnostics for build
AdrianSoundy Nov 19, 2023
ac08e2e
Back out changes
AdrianSoundy Nov 20, 2023
f20457f
Remove fix install.ps1 step again
AdrianSoundy Nov 20, 2023
0a56950
Comment out code to remove cmake from path to see what happens
AdrianSoundy Nov 23, 2023
96b0ffe
Update devcontainer to python 3.11
AdrianSoundy Nov 23, 2023
dec7d28
For ESP32 BLE targets allow ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION to…
AdrianSoundy Nov 23, 2023
c78a7ec
Minor fixes in comments
josesimoes Dec 7, 2023
330bb80
Add missing entry for new API
josesimoes Dec 7, 2023
dcffcaa
Remove commented code
josesimoes Dec 7, 2023
f515d75
Minor style fixes
josesimoes Dec 7, 2023
96b92c1
Add missing empty line at end of file
josesimoes Dec 7, 2023
eb99111
Code style fixes
josesimoes Dec 7, 2023
7ea4da1
Add check for platform ESP32 as currently is the only one using mbedT…
josesimoes Dec 7, 2023
a83d8db
Add empty line
josesimoes Dec 7, 2023
8c93968
Add back comment
josesimoes Dec 7, 2023
5da172e
Code style fixes
josesimoes Dec 7, 2023
9a3fd06
Replace license header
josesimoes Dec 7, 2023
93a5b2d
Code style fixes
josesimoes Dec 7, 2023
5d71cbe
Code style fixes
josesimoes Dec 7, 2023
c3089be
Fix install and cache of python requirements
josesimoes Dec 12, 2023
130db2e
Update github tag for IDF repo
josesimoes Dec 12, 2023
ab56781
Fix path to requirements file
josesimoes Dec 12, 2023
5576c8e
Fix path to requirements file
josesimoes Dec 12, 2023
51618ee
Add back tweaks to IDF install
josesimoes Dec 12, 2023
ddb2472
Fix installing IDF without Python features
josesimoes Dec 12, 2023
b1ea30e
Fix getting path to IDF tools
josesimoes Dec 12, 2023
498b62f
Disable Thread from build options
josesimoes Dec 12, 2023
3810f5c
Add missing build Presets for new ESP32 targets
josesimoes Dec 12, 2023
e2267b4
Fix H2 doesn't seem to have support for ADC
josesimoes Dec 12, 2023
7cc318b
Fix generating 16MB partition tables
josesimoes Dec 12, 2023
d017aea
Update ADC driver to use SOC config
AdrianSoundy Dec 13, 2023
f84d87b
Minimum Thread assembly for build
AdrianSoundy Dec 14, 2023
1e10672
Fix devcontainers
networkfusion Dec 27, 2023
97fac0e
Bump IDF to 5.1.2
josesimoes Jan 5, 2024
98d3c67
Revert "Bump IDF to 5.1.2"
josesimoes Jan 5, 2024
5d15dc5
Update sdkconfig.default_nopsram_rev3.esp32
AdrianSoundy Jan 7, 2024
93d2ae6
IDF 5.1.2 update
AdrianSoundy Jan 23, 2024
a60d5e8
Code style fixes
nfbot Jan 23, 2024
8ef0df6
Merge pull request #102 from nanoframework/nfbot/clang-format-fix/b3f…
AdrianSoundy Jan 23, 2024
2de038b
Fix merge error
AdrianSoundy Jan 23, 2024
fbf69f3
Merge branch 'IDF5.1' of https://github.com/AdrianSoundy/nf-interpret…
AdrianSoundy Jan 23, 2024
8d078f1
Fix PWM merge issue
AdrianSoundy Jan 23, 2024
b92ff66
IPV6 merge issue (duplication)
AdrianSoundy Jan 24, 2024
180f7e9
Code style fixes
nfbot Jan 24, 2024
64d0c01
Merge remote-tracking branch 'upstream/nfbot/clang-format-fix/e44fed3…
AdrianSoundy Jan 24, 2024
4d12c51
IDF 5.1.3 update
AdrianSoundy Mar 21, 2024
32f7d5e
IDF 5.1.1 update
AdrianSoundy Aug 23, 2023
cefa672
Code style fixes
nfbot Nov 14, 2023
d9f725f
Update Esp32 build for azure pipelines and idf 5.1.1
AdrianSoundy Nov 16, 2023
b33b243
Make sure mbedtls/version.h is included.
AdrianSoundy Nov 17, 2023
7b712c9
Further changes for AzureRtos - Network
AdrianSoundy Nov 17, 2023
b67790e
Update download-install-esp32-build-components.yml
AdrianSoundy Nov 17, 2023
a6618a1
Update docker sources and add diagnostics for build
AdrianSoundy Nov 19, 2023
d5b6644
Back out changes
AdrianSoundy Nov 20, 2023
1bada43
Remove fix install.ps1 step again
AdrianSoundy Nov 20, 2023
856f119
Comment out code to remove cmake from path to see what happens
AdrianSoundy Nov 23, 2023
583c959
Update devcontainer to python 3.11
AdrianSoundy Nov 23, 2023
cfccdaf
For ESP32 BLE targets allow ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION to…
AdrianSoundy Nov 23, 2023
7e01b06
Minor fixes in comments
josesimoes Dec 7, 2023
846f477
Add missing entry for new API
josesimoes Dec 7, 2023
af931a1
Remove commented code
josesimoes Dec 7, 2023
9885ac2
Minor style fixes
josesimoes Dec 7, 2023
f472bc0
Add missing empty line at end of file
josesimoes Dec 7, 2023
e001ff1
Code style fixes
josesimoes Dec 7, 2023
dab6da4
Add check for platform ESP32 as currently is the only one using mbedT…
josesimoes Dec 7, 2023
9b1fe99
Add empty line
josesimoes Dec 7, 2023
54814c4
Add back comment
josesimoes Dec 7, 2023
21d92de
Code style fixes
josesimoes Dec 7, 2023
b0aa891
Replace license header
josesimoes Dec 7, 2023
67bada9
Code style fixes
josesimoes Dec 7, 2023
72f20d6
Code style fixes
josesimoes Dec 7, 2023
bf1ed1e
Fix install and cache of python requirements
josesimoes Dec 12, 2023
eb3130f
Fix path to requirements file
josesimoes Dec 12, 2023
b2f44b2
Fix path to requirements file
josesimoes Dec 12, 2023
b3ef66c
Add back tweaks to IDF install
josesimoes Dec 12, 2023
d29b92a
Fix installing IDF without Python features
josesimoes Dec 12, 2023
4742c82
Fix getting path to IDF tools
josesimoes Dec 12, 2023
dcc65c4
Disable Thread from build options
josesimoes Dec 12, 2023
e416459
Add missing build Presets for new ESP32 targets
josesimoes Dec 12, 2023
5225662
Fix H2 doesn't seem to have support for ADC
josesimoes Dec 12, 2023
6811e79
Fix generating 16MB partition tables
josesimoes Dec 12, 2023
34a6f6b
Update ADC driver to use SOC config
AdrianSoundy Dec 13, 2023
9d2f59d
Minimum Thread assembly for build
AdrianSoundy Dec 14, 2023
7a02f8c
Fix devcontainers
networkfusion Dec 27, 2023
258548e
Bump IDF to 5.1.2
josesimoes Jan 5, 2024
2e9fb61
Revert "Bump IDF to 5.1.2"
josesimoes Jan 5, 2024
5264246
Update sdkconfig.default_nopsram_rev3.esp32
AdrianSoundy Jan 7, 2024
47721db
IDF 5.1.2 update
AdrianSoundy Jan 23, 2024
3b40d93
Fix merge error
AdrianSoundy Jan 23, 2024
105fa51
Fix PWM merge issue
AdrianSoundy Jan 23, 2024
2f4bc56
IPV6 merge issue (duplication)
AdrianSoundy Jan 24, 2024
5d377bf
Code style fixes
nfbot Jan 24, 2024
046cd33
Merge branch 'Thread-improvements' into IDF5.1
AdrianSoundy Mar 22, 2024
11ebc35
Merge branch 'IDF5.1' of https://github.com/AdrianSoundy/nf-interpret…
AdrianSoundy Mar 22, 2024
a820135
Fix merge issue
AdrianSoundy Mar 22, 2024
1bd29b6
Update tasks.TEMPLATE.json
AdrianSoundy Mar 22, 2024
708823c
Fixes
AdrianSoundy Apr 2, 2024
0408952
Fix factory partition size for ESP32 builds (m5core2)
AdrianSoundy Apr 16, 2024
a9e8f3c
Merge branch 'main' into IDF5.1
AdrianSoundy Apr 16, 2024
d3853ae
Code style fixes
nfbot Apr 16, 2024
9957daa
Merge remote-tracking branch 'upstream/nfbot/clang-format-fix/482351d…
AdrianSoundy Apr 16, 2024
ca3c48c
Fix include for sdmmc header for v5.1.3
AdrianSoundy Apr 16, 2024
5aa8fc0
Further fix to Windows_storage merge from main branch
AdrianSoundy Apr 16, 2024
5f184c9
Merge branch 'main' into IDF5.1
josesimoes May 6, 2024
6587271
Fix line endings
josesimoes May 6, 2024
89b613e
Merge branch 'IDF5.1' of https://github.com/AdrianSoundy/nf-interpret…
josesimoes May 6, 2024
f887395
Update azure-pipelines.yml
josesimoes May 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .devcontainer/All/Dockerfile.All.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN mkdir -p /tmp/dc-extracted/titools \
&& curl -o /tmp/dc-downloads/titools.zip $TI_TOOL_URL -L \
&& unzip -d /tmp/dc-extracted/titools /tmp/dc-downloads/titools.zip

FROM python:3.10 AS devcontainer
FROM python:3.11 AS devcontainer

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand Down 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 v4.4.7 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
RUN git clone --branch v5.1.3 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 Expand Up @@ -125,12 +125,12 @@ RUN ln -fs /usr/bin/python3 /usr/bin/python \

# Install ESP-IDF
ENV IDF_PATH=/sources/esp-idf
ENV ESP_PATCH_VER=esp-2021r2-patch5-8.4.0
ENV ESP_PATCH_VER=esp-12.2.0_20230208
# This is now taking care in the following line
# RUN python -m pip install -r $IDF_PATH/requirements.txt
RUN $IDF_PATH/install.sh

ENV PATH=/root/.espressif/python_env/idf4.4_py3.10_env/bin:$PATH:\
ENV PATH=/root/.espressif/python_env/idf5.1_py3.11_env/bin:$PATH:\
$IDF_PATH/components/esptool_py/esptool:\
$IDF_PATH/components/espcoredump:\
$IDF_PATH/components/partition_table/:\
Expand Down
8 changes: 4 additions & 4 deletions .devcontainer/ESP32/Dockerfile.ESP32.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN wget $CMAKE_SCRIPT \
&& /tmp/dc-downloads/cmake-install.sh --skip-license --prefix=/tmp/dc-extracted/cmake \
&& rm /tmp/dc-downloads/cmake-install.sh

FROM python:3.10 AS devcontainer
FROM python:3.11 AS devcontainer

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand Down 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 v4.4.7 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
RUN git clone --branch v5.1.3 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 All @@ -61,12 +61,12 @@ ENV PATH=/usr/bin/cmake/bin:${PATH}

# Install ESP-IDF
ENV IDF_PATH=/sources/esp-idf
ENV ESP_PATCH_VER=esp-2021r2-patch5-8.4.0
ENV ESP_PATCH_VER=esp-12.2.0_20230208
# This is now taking care in the following line
# RUN python -m pip install -r $IDF_PATH/requirements.txt
RUN $IDF_PATH/install.sh

ENV PATH=/root/.espressif/python_env/idf4.4_py3.10_env/bin:$PATH:\
ENV PATH=/root/.espressif/python_env/idf5.1_py3.11_env/bin:$PATH:\
$IDF_PATH/components/esptool_py/esptool:\
$IDF_PATH/components/espcoredump:\
$IDF_PATH/components/partition_table/:\
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.TEMPLATE.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"problemMatcher": []
},
{
"label": "Flash nanoCLR to ESP32-C3 | ESP32-S3",
"label": "Flash nanoCLR to ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S3",
"type": "shell",
"command": "python ${env:IDF_PATH}/components/esptool_py/esptool/esptool.py --chip auto --port \"${input:comPort}\" --baud 1500000 --before \"default_reset\" --after \"hard_reset\" write_flash -z --flash_size detect 0x0 ${workspaceFolder}/build/bootloader/bootloader.bin 0x10000 ${workspaceFolder}/build/nanoCLR.bin 0x8000 ${workspaceFolder}/build/partitions_${input:esp32Partitions}.bin",
"presentation": {
Expand All @@ -38,7 +38,7 @@
{
"label": "Erase ESP32 flash",
"type": "shell",
"command": "python ${env:IDF_PATH}/components/esptool_py/esptool/esptool.py --chip detect --port \"${input:comPort}\" --baud 1500000 --before \"default_reset\" --after \"hard_reset\" erase_flash",
"command": "python ${env:IDF_PATH}/components/esptool_py/esptool/esptool.py --chip auto --port \"${input:comPort}\" --baud 1500000 --before \"default_reset\" --after \"hard_reset\" erase_flash",
"presentation": {
"reveal": "always",
"panel": "shared"
Expand Down
53 changes: 53 additions & 0 deletions CMake/Modules/ESP32_C6_GCC_options.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
#

# need to specify linker flags here
set(CMAKE_EXE_LINKER_FLAGS " -Wl,--print-memory-usage " CACHE INTERNAL "executable linker flags")

# TARGET parameter to set the target that's setting them for
# optional EXTRA_COMPILE_OPTIONS with compile options to be added
macro(nf_set_compile_options)

# parse arguments
cmake_parse_arguments(NFSCO "" "TARGET" "EXTRA_COMPILE_OPTIONS" ${ARGN})

if(NOT NFSCO_TARGET OR "${NFSCO_TARGET}" STREQUAL "")
message(FATAL_ERROR "Need to set TARGET argument when calling nf_set_compile_options()")
endif()

# include any extra options coming from any extra args?
target_compile_options(${NFSCO_TARGET} PUBLIC ${NFSCO_EXTRA_COMPILE_OPTIONS} -Wall -Wextra -Werror -Wno-sign-compare -Wno-unused-parameter -Wshadow -Wimplicit-fallthrough -fshort-wchar -fno-builtin -fno-common -fno-exceptions -fcheck-new )

# this series has FPU
target_compile_definitions(${NFSCO_TARGET} PUBLIC -DTARGET=esp32c6 -DUSE_FPU=TRUE -DPLATFORM_ESP32 -DESP_PLATFORM)

endmacro()

# TARGET parameter to set the target that's setting them for
# optional EXTRA_LINK_FLAGS with link flags to be added
macro(nf_set_link_options)

# parse arguments
cmake_parse_arguments(NFSLO "" "TARGET;EXTRA_LINK_FLAGS" "" ${ARGN})

if(NOT NFSLO_TARGET OR "${NFSLO_TARGET}" STREQUAL "")
message(FATAL_ERROR "Need to set TARGET argument when calling nf_set_link_options()")
endif()

# set optimization linker flags for RELEASE and MinSizeRel
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
set_property(TARGET ${NFSLO_TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Os ")
endif()

# include libraries in build
nf_include_libraries_in_build(${NFSLO_TARGET})

# set extra linker flags
set_property(TARGET ${NFSLO_TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${NFSLO_EXTRA_LINK_FLAGS} ")

# set optimization flags
nf_set_optimization_options(${NFSLO_TARGET})

endmacro()
4 changes: 4 additions & 0 deletions CMake/Modules/ESP32_C6_sources.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
#
53 changes: 53 additions & 0 deletions CMake/Modules/ESP32_H2_GCC_options.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
#

# need to specify linker flags here
set(CMAKE_EXE_LINKER_FLAGS " -Wl,--print-memory-usage " CACHE INTERNAL "executable linker flags")

# TARGET parameter to set the target that's setting them for
# optional EXTRA_COMPILE_OPTIONS with compile options to be added
macro(nf_set_compile_options)

# parse arguments
cmake_parse_arguments(NFSCO "" "TARGET" "EXTRA_COMPILE_OPTIONS" ${ARGN})

if(NOT NFSCO_TARGET OR "${NFSCO_TARGET}" STREQUAL "")
message(FATAL_ERROR "Need to set TARGET argument when calling nf_set_compile_options()")
endif()

# include any extra options coming from any extra args?
target_compile_options(${NFSCO_TARGET} PUBLIC ${NFSCO_EXTRA_COMPILE_OPTIONS} -Wall -Wextra -Werror -Wno-sign-compare -Wno-unused-parameter -Wshadow -Wimplicit-fallthrough -fshort-wchar -fno-builtin -fno-common -fno-exceptions -fcheck-new )

# this series has FPU
target_compile_definitions(${NFSCO_TARGET} PUBLIC -DTARGET=esp32c3 -DUSE_FPU=TRUE -DPLATFORM_ESP32 -DESP_PLATFORM)

endmacro()

# TARGET parameter to set the target that's setting them for
# optional EXTRA_LINK_FLAGS with link flags to be added
macro(nf_set_link_options)

# parse arguments
cmake_parse_arguments(NFSLO "" "TARGET;EXTRA_LINK_FLAGS" "" ${ARGN})

if(NOT NFSLO_TARGET OR "${NFSLO_TARGET}" STREQUAL "")
message(FATAL_ERROR "Need to set TARGET argument when calling nf_set_link_options()")
endif()

# set optimization linker flags for RELEASE and MinSizeRel
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
set_property(TARGET ${NFSLO_TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Os ")
endif()

# include libraries in build
nf_include_libraries_in_build(${NFSLO_TARGET})

# set extra linker flags
set_property(TARGET ${NFSLO_TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${NFSLO_EXTRA_LINK_FLAGS} ")

# set optimization flags
nf_set_optimization_options(${NFSLO_TARGET})

endmacro()
4 changes: 4 additions & 0 deletions CMake/Modules/ESP32_H2_sources.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
#
58 changes: 48 additions & 10 deletions CMake/Modules/FindESP32_IDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,33 @@ list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/hal/includ
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/hal/${TARGET_SERIES_SHORT}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/soc/${TARGET_SERIES_SHORT}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/soc/${TARGET_SERIES_SHORT}/include/soc)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_hw_support/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_hw_support/include/soc)

list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/include/driver)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/gptimer/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/uart/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/gpio/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/spi/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/i2c/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/i2s/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/dac/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/ledc/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/pcnt/include)
#list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/rmt/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/sdmmc/include)

# Use depecated drivers for RMT, I2S etc
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/deprecated)

# includes specific to ESP32 or ESP32S2 or ESP32S3
if(${TARGET_SERIES_SHORT} STREQUAL "esp32" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32s2" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32s3")
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/touch_sensor/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/touch_sensor/${TARGET_SERIES_SHORT}/include)
endif()

list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_adc/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_adc/${TARGET_SERIES_SHORT}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_common/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_event/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_eth/include)
Expand All @@ -35,11 +58,17 @@ list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_ringbu
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_timer/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_system/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_wifi/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_partition/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_pm/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/fatfs/diskio)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/fatfs/vfs)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/fatfs/src)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/lwip/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/lwip/port/esp32/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/lwip/include/apps)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/lwip/port/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/lwip/port/esp32xx/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/lwip/port/freertos/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/lwip/port/freertos/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/lwip/lwip/src/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/lwip/lwip/src/include/lwip)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/log/include)
Expand All @@ -51,22 +80,29 @@ list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/mbedtls/mb
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/nvs_flash/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/newlib/platform_include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/wpa_supplicant/include/esp_supplicant)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/sdmmc)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/spiffs/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/spi_flash/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/sdmmc/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/soc/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/vfs/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/wear_levelling/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/driver/usb_serial_jtag/include)

list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_rom/include/${TARGET_SERIES_SHORT}/rom)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_rom/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_rom/${TARGET_SERIES_SHORT})

# includes specific to ESP32S2 and ESP32S3
if(${TARGET_SERIES_SHORT} STREQUAL "esp32s2" OR ${TARGET_SERIES_SHORT} STREQUAL "esp32s3")
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/tinyusb/additions/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/tinyusb/tinyusb/src)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/include/freertos)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/esp_tinyusb/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/tinyusb/src)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/FreeRTOS-Kernel/include/freertos)
endif()

# includes specific to Thread, native only for ESP32C6 and ESP32H2. Other mcu as attached network chip (EPS32-H2 etc)
if(HAL_USE_THREAD_OPTION)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/openthread/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/openthread/openthread/include)
endif()

# including here the CMake files for the source files specific to the target series
Expand All @@ -78,8 +114,10 @@ include(${TARGET_SERIES}_GCC_options)
# freertos #
############

list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/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/include/esp_additions/freertos)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/port/${ESP32_CPU_TYPE}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/port/${ESP32_CPU_TYPE}/include/freertos)
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)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/FreeRTOS-Kernel/portable/${ESP32_CPU_TYPE}/include)
list(APPEND ESP32_IDF_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/freertos/FreeRTOS-Kernel/portable/${ESP32_CPU_TYPE}/include/freertos)
8 changes: 7 additions & 1 deletion CMake/Modules/FindNF_NativeAssemblies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ option(API_nanoFramework.System.Security.Cryptography "option for nanoFramewor
# Esp32 only
option(API_Hardware.Esp32 "option for Hardware.Esp32")
option(API_nanoFramework.Hardware.Esp32.Rmt "option for nanoFramework.Hardware.Esp32.Rmt")

option(API_nanoFramework.Networking.Thread "option for nanoFramework.Networking.Thread API")

# Stm32 only
option(API_Hardware.Stm32 "option for Hardware.Stm32")
Expand Down Expand Up @@ -191,6 +191,12 @@ if(API_nanoFramework.Hardware.Esp32.Rmt)
PerformSettingsForApiEntry("nanoFramework.Hardware.Esp32.Rmt")
endif()

# nanoFramework.Networking.Thread
if(API_nanoFramework.Networking.Thread)
##### API name here (doted name)
PerformSettingsForApiEntry("nanoFramework.Networking.Thread")
endif()

# nanoFramework.Device.Bluetooth
if(API_nanoFramework.Device.Bluetooth)
##### API name here (doted name)
Expand Down
1 change: 1 addition & 0 deletions CMake/Modules/FindnanoFramework.Device.Bluetooth.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ list(APPEND nanoFramework.Device.Bluetooth_INCLUDE_DIRS "${NIMBLE_COMPONENT_PATH
list(APPEND nanoFramework.Device.Bluetooth_INCLUDE_DIRS "${NIMBLE_COMPONENT_PATH}/nimble/nimble/host/util/include")
list(APPEND nanoFramework.Device.Bluetooth_INCLUDE_DIRS "${NIMBLE_COMPONENT_PATH}/nimble/nimble/host/services/gap/include")
list(APPEND nanoFramework.Device.Bluetooth_INCLUDE_DIRS "${NIMBLE_COMPONENT_PATH}/nimble/nimble/host/services/gatt/include")
list(APPEND nanoFramework.Device.Bluetooth_INCLUDE_DIRS "${NIMBLE_COMPONENT_PATH}/nimble/nimble/transport/include")

# source files
set(nanoFramework.Device.Bluetooth_SRCS
Expand Down
1 change: 1 addition & 0 deletions CMake/Modules/FindnanoFramework.Hardware.Esp32.Ble.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ list(APPEND nanoFramework.Hardware.Esp32.Ble_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR
list(APPEND nanoFramework.Hardware.Esp32.Ble_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/bt/host/nimble/nimble/nimble/host/util/include)
list(APPEND nanoFramework.Hardware.Esp32.Ble_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/bt/host/nimble/nimble/nimble/host/services/gap/include)
list(APPEND nanoFramework.Hardware.Esp32.Ble_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/bt/host/nimble/nimble/nimble/host/services/gatt/include)
list(APPEND nanoFramework.Hardware.Esp32.Ble_INCLUDE_DIRS ${esp32_idf_SOURCE_DIR}/components/bt/host/nimble/nimble/nimble/transport/include)

# source files
set(nanoFramework.Hardware.Esp32.Ble_SRCS
Expand Down
Loading