diff options
Diffstat (limited to 'examples')
29 files changed, 59 insertions, 64 deletions
diff --git a/examples/device/audio_4_channel_mic/CMakeLists.txt b/examples/device/audio_4_channel_mic/CMakeLists.txt index 9cae652ea..f2c81c4d3 100644 --- a/examples/device/audio_4_channel_mic/CMakeLists.txt +++ b/examples/device/audio_4_channel_mic/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/audio_test/CMakeLists.txt b/examples/device/audio_test/CMakeLists.txt index 9cae652ea..f2c81c4d3 100644 --- a/examples/device/audio_test/CMakeLists.txt +++ b/examples/device/audio_test/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt index 32c0329ea..c41ad92ab 100644 --- a/examples/device/board_test/CMakeLists.txt +++ b/examples/device/board_test/CMakeLists.txt @@ -1,4 +1,6 @@ -# use directory name for project id +cmake_minimum_required(VERSION 3.5) + +# use BOARD-Directory name for project id get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME) set(PROJECT ${BOARD}-${PROJECT}) @@ -7,7 +9,7 @@ set(TOP "../../..") get_filename_component(TOP "${TOP}" REALPATH) # Check for -DFAMILY= -if(FAMILY STREQUAL "esp32s2") +if(FAMILY MATCHES "^esp32s[2-3]") cmake_minimum_required(VERSION 3.5) include(${TOP}/hw/bsp/${FAMILY}/family.cmake) @@ -38,5 +40,5 @@ elseif(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/board_test/sdkconfig.defaults b/examples/device/board_test/sdkconfig.defaults index cede66031..83871619e 100644 --- a/examples/device/board_test/sdkconfig.defaults +++ b/examples/device/board_test/sdkconfig.defaults @@ -1,4 +1,3 @@ CONFIG_IDF_CMAKE=y -CONFIG_IDF_TARGET="esp32s2" -CONFIG_IDF_TARGET_ESP32S2=y +CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y diff --git a/examples/device/board_test/src/CMakeLists.txt b/examples/device/board_test/src/CMakeLists.txt index e59661069..e4e1f4e9a 100644 --- a/examples/device/board_test/src/CMakeLists.txt +++ b/examples/device/board_test/src/CMakeLists.txt @@ -1,12 +1,13 @@ -# FAMILY = "esp32s2" +# FAMILY = esp32sx idf_component_register(SRCS "main.c" INCLUDE_DIRS "." REQUIRES freertos soc) -target_compile_options(${COMPONENT_TARGET} PUBLIC - "-DCFG_TUSB_MCU=OPT_MCU_ESP32S2" - "-DCFG_TUSB_OS=OPT_OS_FREERTOS" -) +file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake) + +if(EXISTS ${board_cmake}) + include(${board_cmake}) +endif() idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH) target_include_directories(${COMPONENT_TARGET} PUBLIC diff --git a/examples/device/board_test/src/main.c b/examples/device/board_test/src/main.c index d94b24650..c77dd5647 100644 --- a/examples/device/board_test/src/main.c +++ b/examples/device/board_test/src/main.c @@ -70,7 +70,7 @@ int main(void) return 0; } -#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 +#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3 void app_main(void) { main(); diff --git a/examples/device/cdc_dual_ports/CMakeLists.txt b/examples/device/cdc_dual_ports/CMakeLists.txt index bb6416cc7..4160c0c88 100644 --- a/examples/device/cdc_dual_ports/CMakeLists.txt +++ b/examples/device/cdc_dual_ports/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/cdc_msc/CMakeLists.txt b/examples/device/cdc_msc/CMakeLists.txt index d4ee8c050..6c828a396 100644 --- a/examples/device/cdc_msc/CMakeLists.txt +++ b/examples/device/cdc_msc/CMakeLists.txt @@ -7,18 +7,13 @@ set(TOP "../../..") get_filename_component(TOP "${TOP}" REALPATH) # Check for -DFAMILY= -if(FAMILY STREQUAL "esp32s2") - cmake_minimum_required(VERSION 3.5) - include(${TOP}/hw/bsp/${FAMILY}/family.cmake) - project(${PROJECT}) - -elseif(FAMILY STREQUAL "rp2040") +if(FAMILY STREQUAL "rp2040") cmake_minimum_required(VERSION 3.12) include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake) project(${PROJECT}) add_executable(${PROJECT}) - + include(${TOP}/hw/bsp/${FAMILY}/family.cmake) # Example source @@ -39,5 +34,5 @@ elseif(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/cdc_msc_freertos/CMakeLists.txt b/examples/device/cdc_msc_freertos/CMakeLists.txt index dabb4bc80..1d04a8518 100644 --- a/examples/device/cdc_msc_freertos/CMakeLists.txt +++ b/examples/device/cdc_msc_freertos/CMakeLists.txt @@ -9,10 +9,12 @@ set(TOP "../../..") get_filename_component(TOP "${TOP}" REALPATH) # Check for -DFAMILY= -if(FAMILY STREQUAL "esp32s2") +if(FAMILY MATCHES "^esp32s[2-3]") + cmake_minimum_required(VERSION 3.5) + include(${TOP}/hw/bsp/${FAMILY}/family.cmake) project(${PROJECT}) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/cdc_msc_freertos/sdkconfig.defaults b/examples/device/cdc_msc_freertos/sdkconfig.defaults index 3253f605c..83871619e 100644 --- a/examples/device/cdc_msc_freertos/sdkconfig.defaults +++ b/examples/device/cdc_msc_freertos/sdkconfig.defaults @@ -1,5 +1,3 @@ CONFIG_IDF_CMAKE=y -CONFIG_IDF_TARGET="esp32s2" -CONFIG_IDF_TARGET_ESP32S2=y CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y diff --git a/examples/device/cdc_msc_freertos/src/CMakeLists.txt b/examples/device/cdc_msc_freertos/src/CMakeLists.txt index a7ece92c9..6b188fd30 100644 --- a/examples/device/cdc_msc_freertos/src/CMakeLists.txt +++ b/examples/device/cdc_msc_freertos/src/CMakeLists.txt @@ -2,9 +2,11 @@ idf_component_register(SRCS "main.c" "usb_descriptors.c" "msc_disk.c" INCLUDE_DIRS "." REQUIRES freertos soc) -target_compile_options(${COMPONENT_TARGET} PUBLIC - "-DCFG_TUSB_MCU=OPT_MCU_ESP32S2" -) +file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake) + +if(EXISTS ${board_cmake}) + include(${board_cmake}) +endif() idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH) target_include_directories(${COMPONENT_TARGET} PUBLIC @@ -26,5 +28,5 @@ target_sources(${COMPONENT_TARGET} PUBLIC "${TOP}/src/class/net/net_device.c" "${TOP}/src/class/usbtmc/usbtmc_device.c" "${TOP}/src/class/vendor/vendor_device.c" - "${TOP}/src/portable/espressif/esp32s2/dcd_esp32s2.c" + "${TOP}/src/portable/espressif/esp32sx/dcd_esp32sx.c" ) diff --git a/examples/device/cdc_msc_freertos/src/main.c b/examples/device/cdc_msc_freertos/src/main.c index ccff2e0fb..c27b7feda 100644 --- a/examples/device/cdc_msc_freertos/src/main.c +++ b/examples/device/cdc_msc_freertos/src/main.c @@ -94,15 +94,15 @@ int main(void) // Create CDC task (void) xTaskCreateStatic( cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, cdc_stack, &cdc_taskdef); - // skip starting scheduler (and return) for ESP32-S2 -#if CFG_TUSB_MCU != OPT_MCU_ESP32S2 + // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3 +#if CFG_TUSB_MCU != OPT_MCU_ESP32S2 && CFG_TUSB_MCU != OPT_MCU_ESP32S3 vTaskStartScheduler(); #endif return 0; } -#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 +#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3 void app_main(void) { main(); diff --git a/examples/device/dfu_runtime/CMakeLists.txt b/examples/device/dfu_runtime/CMakeLists.txt index d59d2e9a1..2bac7c329 100644 --- a/examples/device/dfu_runtime/CMakeLists.txt +++ b/examples/device/dfu_runtime/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/dynamic_configuration/CMakeLists.txt b/examples/device/dynamic_configuration/CMakeLists.txt index a9c343994..a99b755d3 100644 --- a/examples/device/dynamic_configuration/CMakeLists.txt +++ b/examples/device/dynamic_configuration/CMakeLists.txt @@ -34,5 +34,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/hid_composite/CMakeLists.txt b/examples/device/hid_composite/CMakeLists.txt index 7f85a3a40..3b677b3b1 100644 --- a/examples/device/hid_composite/CMakeLists.txt +++ b/examples/device/hid_composite/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/hid_composite_freertos/CMakeLists.txt b/examples/device/hid_composite_freertos/CMakeLists.txt index dabb4bc80..ed734b954 100644 --- a/examples/device/hid_composite_freertos/CMakeLists.txt +++ b/examples/device/hid_composite_freertos/CMakeLists.txt @@ -9,10 +9,9 @@ set(TOP "../../..") get_filename_component(TOP "${TOP}" REALPATH) # Check for -DFAMILY= -if(FAMILY STREQUAL "esp32s2") +if(FAMILY MATCHES "^esp32s[2-3]") include(${TOP}/hw/bsp/${FAMILY}/family.cmake) project(${PROJECT}) - else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/hid_composite_freertos/sdkconfig.defaults b/examples/device/hid_composite_freertos/sdkconfig.defaults index 3253f605c..83871619e 100644 --- a/examples/device/hid_composite_freertos/sdkconfig.defaults +++ b/examples/device/hid_composite_freertos/sdkconfig.defaults @@ -1,5 +1,3 @@ CONFIG_IDF_CMAKE=y -CONFIG_IDF_TARGET="esp32s2" -CONFIG_IDF_TARGET_ESP32S2=y CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y diff --git a/examples/device/hid_composite_freertos/src/CMakeLists.txt b/examples/device/hid_composite_freertos/src/CMakeLists.txt index f79e8f845..6d4a3c1e2 100644 --- a/examples/device/hid_composite_freertos/src/CMakeLists.txt +++ b/examples/device/hid_composite_freertos/src/CMakeLists.txt @@ -2,9 +2,11 @@ idf_component_register(SRCS "main.c" "usb_descriptors.c" INCLUDE_DIRS "." REQUIRES freertos soc) -target_compile_options(${COMPONENT_TARGET} PUBLIC - "-DCFG_TUSB_MCU=OPT_MCU_ESP32S2" -) +file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake) + +if(EXISTS ${board_cmake}) + include(${board_cmake}) +endif() idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH) target_include_directories(${COMPONENT_TARGET} PUBLIC @@ -26,5 +28,5 @@ target_sources(${COMPONENT_TARGET} PUBLIC "${TOP}/src/class/net/net_device.c" "${TOP}/src/class/usbtmc/usbtmc_device.c" "${TOP}/src/class/vendor/vendor_device.c" - "${TOP}/src/portable/espressif/esp32s2/dcd_esp32s2.c" + "${TOP}/src/portable/espressif/esp32sx/dcd_esp32sx.c" ) diff --git a/examples/device/hid_composite_freertos/src/main.c b/examples/device/hid_composite_freertos/src/main.c index 37b4a0cf7..47f976427 100644 --- a/examples/device/hid_composite_freertos/src/main.c +++ b/examples/device/hid_composite_freertos/src/main.c @@ -95,15 +95,15 @@ int main(void) // Create HID task (void) xTaskCreateStatic( hid_task, "hid", HID_STACK_SZIE, NULL, configMAX_PRIORITIES-2, hid_stack, &hid_taskdef); - // skip starting scheduler (and return) for ESP32-S2 -#if CFG_TUSB_MCU != OPT_MCU_ESP32S2 + // skip starting scheduler (and return) for ESP32-S2 or ESP32-S3 +#if CFG_TUSB_MCU != OPT_MCU_ESP32S2 && CFG_TUSB_MCU != OPT_MCU_ESP32S3 vTaskStartScheduler(); #endif return 0; } -#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 +#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3 void app_main(void) { main(); diff --git a/examples/device/hid_generic_inout/CMakeLists.txt b/examples/device/hid_generic_inout/CMakeLists.txt index d59d2e9a1..2bac7c329 100644 --- a/examples/device/hid_generic_inout/CMakeLists.txt +++ b/examples/device/hid_generic_inout/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/hid_multiple_interface/CMakeLists.txt b/examples/device/hid_multiple_interface/CMakeLists.txt index d59d2e9a1..2bac7c329 100644 --- a/examples/device/hid_multiple_interface/CMakeLists.txt +++ b/examples/device/hid_multiple_interface/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/midi_test/CMakeLists.txt b/examples/device/midi_test/CMakeLists.txt index d59d2e9a1..2bac7c329 100644 --- a/examples/device/midi_test/CMakeLists.txt +++ b/examples/device/midi_test/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/msc_dual_lun/CMakeLists.txt b/examples/device/msc_dual_lun/CMakeLists.txt index 454c5a08a..8b4722278 100644 --- a/examples/device/msc_dual_lun/CMakeLists.txt +++ b/examples/device/msc_dual_lun/CMakeLists.txt @@ -34,5 +34,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/net_lwip_webserver/CMakeLists.txt b/examples/device/net_lwip_webserver/CMakeLists.txt index 76f7be6cc..4325b4ea6 100644 --- a/examples/device/net_lwip_webserver/CMakeLists.txt +++ b/examples/device/net_lwip_webserver/CMakeLists.txt @@ -80,5 +80,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/uac2_headset/CMakeLists.txt b/examples/device/uac2_headset/CMakeLists.txt index d59d2e9a1..2bac7c329 100644 --- a/examples/device/uac2_headset/CMakeLists.txt +++ b/examples/device/uac2_headset/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/usbtmc/CMakeLists.txt b/examples/device/usbtmc/CMakeLists.txt index f9ba2b529..c14595dbe 100644 --- a/examples/device/usbtmc/CMakeLists.txt +++ b/examples/device/usbtmc/CMakeLists.txt @@ -34,5 +34,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/webusb_serial/CMakeLists.txt b/examples/device/webusb_serial/CMakeLists.txt index d59d2e9a1..2bac7c329 100644 --- a/examples/device/webusb_serial/CMakeLists.txt +++ b/examples/device/webusb_serial/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/host/cdc_msc_hid/CMakeLists.txt b/examples/host/cdc_msc_hid/CMakeLists.txt index 30b6c713e..a9a4f08ad 100644 --- a/examples/host/cdc_msc_hid/CMakeLists.txt +++ b/examples/host/cdc_msc_hid/CMakeLists.txt @@ -7,12 +7,7 @@ set(TOP "../../..") get_filename_component(TOP "${TOP}" REALPATH) # Check for -DFAMILY= -if(FAMILY STREQUAL "esp32s2") - cmake_minimum_required(VERSION 3.5) - include(${TOP}/hw/bsp/${FAMILY}/family.cmake) - project(${PROJECT}) - -elseif(FAMILY STREQUAL "rp2040") +if(FAMILY STREQUAL "rp2040") cmake_minimum_required(VERSION 3.12) include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake) @@ -38,5 +33,5 @@ elseif(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/rules.mk b/examples/rules.mk index e5fbee828..2d86d5c79 100644 --- a/examples/rules.mk +++ b/examples/rules.mk @@ -5,8 +5,9 @@ # Set all as default goal .DEFAULT_GOAL := all -# ESP32-S2 and RP2040 has its own CMake build system +# ESP32-SX and RP2040 has its own CMake build system ifneq ($(FAMILY),esp32s2) +ifneq ($(FAMILY),esp32s3) ifneq ($(FAMILY),rp2040) # --------------------------------------- # GNU Make build system @@ -136,6 +137,7 @@ else endif endif +endif endif # GNU Make # --------------------------------------- |
