-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
143 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
text data bss dec hex filename | ||
159061 46756 367669 573486 8c02e build/template.elf | ||
159173 46760 367669 573602 8c0a2 build/template.elf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") | ||
cmake_policy(SET CMP0135 NEW) | ||
endif() | ||
|
||
if (NOT DEFINED IDF_TARGET) | ||
set(IDF_TARGET esp32s3) | ||
endif() | ||
set(CMAKE_TOOLCHAIN_FILE $ENV{IDF_PATH}/tools/cmake/toolchain-${IDF_TARGET}.cmake) | ||
|
||
project(template) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/idf.cmake) | ||
include(${CMAKE_SOURCE_DIR}/ports/esp_idf/build.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Kyunghwan Kwon | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
set(COMPONENTS_USED | ||
freertos | ||
esptool_py | ||
bt | ||
esp-tls | ||
esp_http_server | ||
esp_http_client | ||
esp_https_ota | ||
app_update | ||
) | ||
|
||
if ($ENV{IDF_VERSION} VERSION_GREATER_EQUAL "5.0.0") | ||
list(APPEND COMPONENTS_USED esp_adc) | ||
else() | ||
list(APPEND COMPONENTS_USED esp_adc_cal) | ||
endif() | ||
|
||
idf_build_process(${IDF_TARGET} | ||
COMPONENTS | ||
${COMPONENTS_USED} | ||
SDKCONFIG_DEFAULTS | ||
"${CMAKE_CURRENT_LIST_DIR}/sdkconfig.defaults" | ||
BUILD_DIR | ||
${CMAKE_CURRENT_BINARY_DIR} | ||
) | ||
|
||
set(mapfile "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.map") | ||
# project_description.json metadata file used for the flash and the monitor of | ||
# idf.py to get the project information. | ||
set(PROJECT_EXECUTABLE ${CMAKE_PROJECT_NAME}.elf) | ||
set(PROJECT_BIN ${CMAKE_PROJECT_NAME}.bin) | ||
set(build_components_json "[]") | ||
set(build_component_paths_json "[]") | ||
configure_file("${IDF_PATH}/tools/cmake/project_description.json.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/project_description.json") | ||
|
||
add_executable(${PROJECT_EXECUTABLE} | ||
${CMAKE_SOURCE_DIR}/src/main.c | ||
) | ||
|
||
target_compile_definitions(${PROJECT_EXECUTABLE} | ||
PRIVATE | ||
ESP_PLATFORM=1 | ||
xPortIsInsideInterrupt=xPortInIsrContext | ||
) | ||
target_include_directories(${PROJECT_EXECUTABLE} | ||
PRIVATE | ||
$ENV{IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/freertos | ||
$ENV{IDF_PATH}/components/freertos/include/freertos | ||
${CMAKE_CURRENT_LIST_DIR} | ||
) | ||
|
||
target_link_libraries(${PROJECT_EXECUTABLE} | ||
idf::freertos | ||
idf::spi_flash | ||
idf::nvs_flash | ||
idf::driver | ||
idf::pthread | ||
idf::esp_http_server | ||
idf::esp_http_client | ||
idf::esp_https_ota | ||
idf::app_update | ||
|
||
-Wl,--cref | ||
-Wl,--Map=\"${mapfile}\" | ||
) | ||
if ($ENV{IDF_VERSION} VERSION_GREATER_EQUAL "5.0.0") | ||
target_link_libraries(${PROJECT_EXECUTABLE} idf::esp_adc) | ||
else() | ||
target_link_libraries(${PROJECT_EXECUTABLE} idf::esp_adc_cal) | ||
endif() | ||
|
||
set(idf_size ${python} $ENV{IDF_PATH}/tools/idf_size.py) | ||
add_custom_target(size DEPENDS ${mapfile} COMMAND ${idf_size} ${mapfile}) | ||
add_custom_target(size-files DEPENDS ${mapfile} COMMAND ${idf_size} --files ${mapfile}) | ||
add_custom_target(size-components DEPENDS ${mapfile} COMMAND ${idf_size} --archives ${mapfile}) | ||
|
||
# Attach additional targets to the executable file for flashing, | ||
# linker script generation, partition_table generation, etc. | ||
idf_build_executable(${PROJECT_EXECUTABLE}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Espressif ESP32 Partition Table | ||
# Name , Type, SubType, Offset, Size, Flags | ||
nvs , data, nvs, 0x10000, 0xc000 | ||
nvs_key , data, nvs_keys, 0x1c000, 0x1000, encrypted | ||
otadata , data, ota, 0x1d000, 0x2000 | ||
phy_init , data, phy, 0x1f000, 0x1000 | ||
ota_0 , app, ota_0, 0x20000, 0x300000 | ||
ota_1 , app, ota_1, 0x320000, 0x300000 | ||
fs , data, spiffs, 0x620000, 0x80000 | ||
nvs_eeprom, data, nvs, 0x6a0000, 0x4000 | ||
spare , data, nvs, 0x6a4000, 0x40000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CONFIG_PARTITION_TABLE_CUSTOM=y | ||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="ports/esp_idf/partitions.csv" | ||
CONFIG_PARTITION_TABLE_FILENAME="ports/esp_idf/partitions.csv" | ||
CONFIG_PARTITION_TABLE_OFFSET=0xE000 | ||
|
||
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y | ||
|
||
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y |
File renamed without changes.