summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/device/audio_4_channel_mic/CMakeLists.txt6
-rw-r--r--examples/device/audio_test/CMakeLists.txt6
-rw-r--r--examples/device/audio_test_multi_rate/CMakeLists.txt6
-rw-r--r--examples/device/board_test/CMakeLists.txt6
-rw-r--r--examples/device/cdc_dual_ports/CMakeLists.txt6
-rw-r--r--examples/device/cdc_msc/CMakeLists.txt2
-rw-r--r--examples/device/cdc_msc_freertos/CMakeLists.txt9
-rw-r--r--examples/device/dfu/CMakeLists.txt6
-rw-r--r--examples/device/dfu_runtime/CMakeLists.txt6
-rw-r--r--examples/device/dynamic_configuration/CMakeLists.txt6
-rw-r--r--examples/device/hid_boot_interface/CMakeLists.txt6
-rw-r--r--examples/device/hid_composite/CMakeLists.txt6
-rw-r--r--examples/device/hid_composite_freertos/CMakeLists.txt9
-rw-r--r--examples/device/hid_generic_inout/CMakeLists.txt6
-rw-r--r--examples/device/hid_multiple_interface/CMakeLists.txt6
-rw-r--r--examples/device/midi_test/CMakeLists.txt6
-rw-r--r--examples/device/msc_dual_lun/CMakeLists.txt6
-rw-r--r--examples/device/net_lwip_webserver/CMakeLists.txt6
-rw-r--r--examples/device/uac2_headset/CMakeLists.txt6
-rw-r--r--examples/device/usbtmc/CMakeLists.txt6
-rw-r--r--examples/device/video_capture/CMakeLists.txt6
-rw-r--r--examples/device/webusb_serial/CMakeLists.txt6
-rw-r--r--examples/dual/host_hid_to_device_cdc/CMakeLists.txt6
-rw-r--r--examples/host/bare_api/CMakeLists.txt6
-rw-r--r--examples/host/cdc_msc_hid/CMakeLists.txt6
-rw-r--r--examples/host/hid_controller/CMakeLists.txt6
-rw-r--r--examples/host/msc_file_explorer/CMakeLists.txt6
-rw-r--r--examples/typec/power_delivery/CMakeLists.txt6
-rw-r--r--examples/typec/power_delivery/src/tusb_config.h14
-rw-r--r--hw/bsp/family_support.cmake164
-rw-r--r--hw/bsp/imxrt/family.cmake19
-rw-r--r--hw/bsp/kinetis_kl/family.cmake19
-rw-r--r--hw/bsp/lpc18/family.cmake19
-rw-r--r--hw/bsp/lpc55/family.cmake19
-rw-r--r--hw/bsp/mcx/family.cmake19
-rw-r--r--hw/bsp/nrf/family.cmake19
-rw-r--r--hw/bsp/rp2040/family.cmake43
-rw-r--r--hw/bsp/stm32f0/family.cmake19
-rw-r--r--hw/bsp/stm32f1/family.cmake19
-rw-r--r--hw/bsp/stm32f7/family.cmake19
-rw-r--r--hw/bsp/stm32g0/family.cmake19
-rw-r--r--hw/bsp/stm32g4/family.cmake19
-rw-r--r--hw/bsp/stm32h7/family.cmake19
-rw-r--r--hw/bsp/stm32l4/family.cmake19
-rw-r--r--src/common/tusb_compiler.h8
-rw-r--r--test/fuzz/device/cdc/CMakeLists.txt18
-rw-r--r--test/fuzz/device/msc/CMakeLists.txt6
-rw-r--r--test/fuzz/device/net/CMakeLists.txt6
48 files changed, 272 insertions, 404 deletions
diff --git a/examples/device/audio_4_channel_mic/CMakeLists.txt b/examples/device/audio_4_channel_mic/CMakeLists.txt
index 87b7d07d4..f61e1b640 100644
--- a/examples/device/audio_4_channel_mic/CMakeLists.txt
+++ b/examples/device/audio_4_channel_mic/CMakeLists.txt
@@ -28,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/audio_test/CMakeLists.txt b/examples/device/audio_test/CMakeLists.txt
index 87b7d07d4..f61e1b640 100644
--- a/examples/device/audio_test/CMakeLists.txt
+++ b/examples/device/audio_test/CMakeLists.txt
@@ -28,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/audio_test_multi_rate/CMakeLists.txt b/examples/device/audio_test_multi_rate/CMakeLists.txt
index 87b7d07d4..f61e1b640 100644
--- a/examples/device/audio_test_multi_rate/CMakeLists.txt
+++ b/examples/device/audio_test_multi_rate/CMakeLists.txt
@@ -28,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt
index 4ab8d5a65..012eff095 100644
--- a/examples/device/board_test/CMakeLists.txt
+++ b/examples/device/board_test/CMakeLists.txt
@@ -27,6 +27,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/cdc_dual_ports/CMakeLists.txt b/examples/device/cdc_dual_ports/CMakeLists.txt
index 87b7d07d4..f61e1b640 100644
--- a/examples/device/cdc_dual_ports/CMakeLists.txt
+++ b/examples/device/cdc_dual_ports/CMakeLists.txt
@@ -28,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/cdc_msc/CMakeLists.txt b/examples/device/cdc_msc/CMakeLists.txt
index 4ec172f17..9415f8c68 100644
--- a/examples/device/cdc_msc/CMakeLists.txt
+++ b/examples/device/cdc_msc/CMakeLists.txt
@@ -32,4 +32,4 @@ target_include_directories(${PROJECT} PUBLIC
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/cdc_msc_freertos/CMakeLists.txt b/examples/device/cdc_msc_freertos/CMakeLists.txt
index 319ad0356..33c7a1ec0 100644
--- a/examples/device/cdc_msc_freertos/CMakeLists.txt
+++ b/examples/device/cdc_msc_freertos/CMakeLists.txt
@@ -30,9 +30,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
-
-# Add FreeRTOS for this example
-family_add_freertos(${PROJECT})
+# Configure compilation flags and libraries for the example with FreeRTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} freertos)
diff --git a/examples/device/dfu/CMakeLists.txt b/examples/device/dfu/CMakeLists.txt
index eb4c198d6..a01eb3456 100644
--- a/examples/device/dfu/CMakeLists.txt
+++ b/examples/device/dfu/CMakeLists.txt
@@ -27,6 +27,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/dfu_runtime/CMakeLists.txt b/examples/device/dfu_runtime/CMakeLists.txt
index eb4c198d6..a01eb3456 100644
--- a/examples/device/dfu_runtime/CMakeLists.txt
+++ b/examples/device/dfu_runtime/CMakeLists.txt
@@ -27,6 +27,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/dynamic_configuration/CMakeLists.txt b/examples/device/dynamic_configuration/CMakeLists.txt
index 046a32257..2b20d2234 100644
--- a/examples/device/dynamic_configuration/CMakeLists.txt
+++ b/examples/device/dynamic_configuration/CMakeLists.txt
@@ -28,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/hid_boot_interface/CMakeLists.txt b/examples/device/hid_boot_interface/CMakeLists.txt
index eb4c198d6..a01eb3456 100644
--- a/examples/device/hid_boot_interface/CMakeLists.txt
+++ b/examples/device/hid_boot_interface/CMakeLists.txt
@@ -27,6 +27,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/hid_composite/CMakeLists.txt b/examples/device/hid_composite/CMakeLists.txt
index eb4c198d6..a01eb3456 100644
--- a/examples/device/hid_composite/CMakeLists.txt
+++ b/examples/device/hid_composite/CMakeLists.txt
@@ -27,6 +27,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/hid_composite_freertos/CMakeLists.txt b/examples/device/hid_composite_freertos/CMakeLists.txt
index 211904cf9..eb22014fb 100644
--- a/examples/device/hid_composite_freertos/CMakeLists.txt
+++ b/examples/device/hid_composite_freertos/CMakeLists.txt
@@ -29,9 +29,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
-
-# Add FreeRTOS for this example
-family_add_freertos(${PROJECT})
+# Configure compilation flags and libraries for the example with FreeRTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} freertos)
diff --git a/examples/device/hid_generic_inout/CMakeLists.txt b/examples/device/hid_generic_inout/CMakeLists.txt
index eb4c198d6..a01eb3456 100644
--- a/examples/device/hid_generic_inout/CMakeLists.txt
+++ b/examples/device/hid_generic_inout/CMakeLists.txt
@@ -27,6 +27,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/hid_multiple_interface/CMakeLists.txt b/examples/device/hid_multiple_interface/CMakeLists.txt
index eb4c198d6..a01eb3456 100644
--- a/examples/device/hid_multiple_interface/CMakeLists.txt
+++ b/examples/device/hid_multiple_interface/CMakeLists.txt
@@ -27,6 +27,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/midi_test/CMakeLists.txt b/examples/device/midi_test/CMakeLists.txt
index 5b1a5547d..e51f14c02 100644
--- a/examples/device/midi_test/CMakeLists.txt
+++ b/examples/device/midi_test/CMakeLists.txt
@@ -26,6 +26,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/msc_dual_lun/CMakeLists.txt b/examples/device/msc_dual_lun/CMakeLists.txt
index dc8d5512c..e69fead35 100644
--- a/examples/device/msc_dual_lun/CMakeLists.txt
+++ b/examples/device/msc_dual_lun/CMakeLists.txt
@@ -29,6 +29,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/net_lwip_webserver/CMakeLists.txt b/examples/device/net_lwip_webserver/CMakeLists.txt
index 2c21aa52b..1e34428fe 100644
--- a/examples/device/net_lwip_webserver/CMakeLists.txt
+++ b/examples/device/net_lwip_webserver/CMakeLists.txt
@@ -88,6 +88,6 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
endif ()
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/uac2_headset/CMakeLists.txt b/examples/device/uac2_headset/CMakeLists.txt
index d142e9c04..e92a57148 100644
--- a/examples/device/uac2_headset/CMakeLists.txt
+++ b/examples/device/uac2_headset/CMakeLists.txt
@@ -28,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/usbtmc/CMakeLists.txt b/examples/device/usbtmc/CMakeLists.txt
index a6b22ab36..a63ca2d81 100644
--- a/examples/device/usbtmc/CMakeLists.txt
+++ b/examples/device/usbtmc/CMakeLists.txt
@@ -29,6 +29,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/video_capture/CMakeLists.txt b/examples/device/video_capture/CMakeLists.txt
index e0bd975c4..80dc39ca5 100644
--- a/examples/device/video_capture/CMakeLists.txt
+++ b/examples/device/video_capture/CMakeLists.txt
@@ -34,6 +34,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/device/webusb_serial/CMakeLists.txt b/examples/device/webusb_serial/CMakeLists.txt
index d142e9c04..e92a57148 100644
--- a/examples/device/webusb_serial/CMakeLists.txt
+++ b/examples/device/webusb_serial/CMakeLists.txt
@@ -28,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/dual/host_hid_to_device_cdc/CMakeLists.txt b/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
index c6d19a720..a6557c2d0 100644
--- a/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
+++ b/examples/dual/host_hid_to_device_cdc/CMakeLists.txt
@@ -23,9 +23,9 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_dual_usb_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_dual_usb_example(${PROJECT} noos)
# due to warnings from Pico-PIO-USB
target_compile_options(${PROJECT} PUBLIC
diff --git a/examples/host/bare_api/CMakeLists.txt b/examples/host/bare_api/CMakeLists.txt
index b6d8c9c89..95af48718 100644
--- a/examples/host/bare_api/CMakeLists.txt
+++ b/examples/host/bare_api/CMakeLists.txt
@@ -22,9 +22,9 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_host_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_host_example(${PROJECT} noos)
# Add pico-pio-usb for rp2040 since user can choose to run on bit-banging host
if(FAMILY STREQUAL "rp2040")
diff --git a/examples/host/cdc_msc_hid/CMakeLists.txt b/examples/host/cdc_msc_hid/CMakeLists.txt
index 68b52e274..3fdc832ab 100644
--- a/examples/host/cdc_msc_hid/CMakeLists.txt
+++ b/examples/host/cdc_msc_hid/CMakeLists.txt
@@ -25,9 +25,9 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_host_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_host_example(${PROJECT} noos)
# Add pico-pio-usb for rp2040 since user can choose to run on bit-banging host
if(FAMILY STREQUAL "rp2040")
diff --git a/examples/host/hid_controller/CMakeLists.txt b/examples/host/hid_controller/CMakeLists.txt
index e27f83c53..d1d901b53 100644
--- a/examples/host/hid_controller/CMakeLists.txt
+++ b/examples/host/hid_controller/CMakeLists.txt
@@ -23,9 +23,9 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_host_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_host_example(${PROJECT} noos)
# Add pico-pio-usb for rp2040 since user can choose to run on bit-banging host
if(FAMILY STREQUAL "rp2040")
diff --git a/examples/host/msc_file_explorer/CMakeLists.txt b/examples/host/msc_file_explorer/CMakeLists.txt
index 327d1218a..99c797275 100644
--- a/examples/host/msc_file_explorer/CMakeLists.txt
+++ b/examples/host/msc_file_explorer/CMakeLists.txt
@@ -35,9 +35,9 @@ target_include_directories(${PROJECT} PUBLIC
${TOP}/lib/embedded-cli
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_host_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_host_example(${PROJECT} noos)
# Add pico-pio-usb for rp2040 since user can choose to run on bit-banging host
if(FAMILY STREQUAL "rp2040")
diff --git a/examples/typec/power_delivery/CMakeLists.txt b/examples/typec/power_delivery/CMakeLists.txt
index 4ab8d5a65..012eff095 100644
--- a/examples/typec/power_delivery/CMakeLists.txt
+++ b/examples/typec/power_delivery/CMakeLists.txt
@@ -27,6 +27,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/examples/typec/power_delivery/src/tusb_config.h b/examples/typec/power_delivery/src/tusb_config.h
index deddcbfa4..f7cb3cc04 100644
--- a/examples/typec/power_delivery/src/tusb_config.h
+++ b/examples/typec/power_delivery/src/tusb_config.h
@@ -30,11 +30,6 @@
extern "C" {
#endif
-// special example that doesn't enable device or host stack
-// This can cause some TinyUSB API missing, this define hack to allow us to fill those API
-// to pass the compilation process
-#define tud_int_handler(x)
-
//--------------------------------------------------------------------
// COMMON CONFIGURATION
//--------------------------------------------------------------------
@@ -54,6 +49,15 @@
// Enable TYPEC stack
#define CFG_TUC_ENABLED 1
+
+// special example that doesn't enable device or host stack
+// This can cause some TinyUSB API missing, this define hack to allow us to fill those API
+// to pass the compilation process
+#if CFG_TUD_ENABLED == 0
+#define tud_int_handler(x)
+#endif
+
+
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
// #define CFG_TUSB_DEBUG 0
diff --git a/hw/bsp/family_support.cmake b/hw/bsp/family_support.cmake
index 93cab8723..781c67bf7 100644
--- a/hw/bsp/family_support.cmake
+++ b/hw/bsp/family_support.cmake
@@ -64,6 +64,8 @@ set(WARNING_FLAGS_GNU
set(WARNINGS_FLAGS_IAR "")
+
+# Filter example based on only.txt and skip.txt
function(family_filter RESULT DIR)
get_filename_component(DIR ${DIR} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
@@ -142,112 +144,136 @@ function(family_initialize_project PROJECT DIR)
endfunction()
-# Add segger rtt to example
-function(family_add_segger_rtt TARGET)
- if (NOT TARGET segger_rtt)
- add_library(segger_rtt STATIC
- ${TOP}/lib/SEGGER_RTT/RTT/SEGGER_RTT.c
- )
- target_include_directories(segger_rtt PUBLIC ${TOP}/lib/SEGGER_RTT/RTT)
- endif()
+#-------------------------------------------------------------
+# Common Target Configure
+# Most families use these settings except rp2040 and espressif
+#-------------------------------------------------------------
+
+# Add RTOS to example
+function(family_add_rtos TARGET RTOS)
+ if (RTOS STREQUAL "freertos")
+ # freertos config
+ if (NOT TARGET freertos_config)
+ add_library(freertos_config INTERFACE)
+ target_include_directories(freertos_config INTERFACE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/${FAMILY}/FreeRTOSConfig)
+ # add board definition to freertos_config mostly for SystemCoreClock
+ target_link_libraries(freertos_config INTERFACE board_${BOARD})
+ endif()
- target_link_libraries(${TARGET} PUBLIC segger_rtt)
+ # freertos kernel
+ if (NOT TARGET freertos_kernel)
+ add_subdirectory(${TOP}/lib/FreeRTOS-Kernel ${CMAKE_BINARY_DIR}/lib/freertos_kernel)
+ endif ()
+
+ target_link_libraries(${TARGET} PUBLIC freertos_kernel)
+ endif ()
endfunction()
-#------------------------------------
-# Main target configure
-#------------------------------------
# Add common configuration to example
-function(family_configure_common TARGET)
+function(family_configure_common TARGET RTOS)
+ family_add_rtos(${TARGET} ${RTOS})
+
# run size after build
add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_SIZE} $<TARGET_FILE:${TARGET}>
)
+ # Add warnings flags
target_compile_options(${TARGET} PUBLIC ${WARNING_FLAGS_${CMAKE_C_COMPILER_ID}})
+ # Generate linker map file
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- # Generate map file
- target_link_options(${TARGET} PUBLIC
- # link map
- "LINKER:-Map=$<TARGET_FILE:${TARGET}>.map"
- )
+ target_link_options(${TARGET} PUBLIC "LINKER:-Map=$<TARGET_FILE:${TARGET}>.map")
endif()
- # LOGGER
- if (DEFINED LOGGER)
- target_compile_definitions(${TARGET} PUBLIC LOGGER_${LOGGER})
- if(LOGGER STREQUAL "RTT" OR LOGGER STREQUAL "rtt")
- family_add_segger_rtt(${TARGET})
- endif ()
- endif ()
-
- # ETM Trace
+ # ETM Trace option
if (TRACE_ETM STREQUAL "1")
target_compile_definitions(${TARGET} PUBLIC TRACE_ETM)
endif ()
-endfunction()
-
-
-# configure an executable target to link to tinyusb in device mode, and add the board implementation
-function(family_configure_device_example TARGET)
- # default implementation is empty, the function should be redefined in the FAMILY/family.cmake
-endfunction()
-
+ # LOGGER option
+ if (DEFINED LOGGER)
+ target_compile_definitions(${TARGET} PUBLIC LOGGER_${LOGGER})
-# configure an executable target to link to tinyusb in host mode, and add the board implementation
-function(family_configure_host_example TARGET)
- # default implementation is empty, the function should be redefined in the FAMILY/family.cmake
+ # Add segger rtt to example
+ if(LOGGER STREQUAL "RTT" OR LOGGER STREQUAL "rtt")
+ if (NOT TARGET segger_rtt)
+ add_library(segger_rtt STATIC ${TOP}/lib/SEGGER_RTT/RTT/SEGGER_RTT.c)
+ target_include_directories(segger_rtt PUBLIC ${TOP}/lib/SEGGER_RTT/RTT)
+ endif()
+ target_link_libraries(${TARGET} PUBLIC segger_rtt)
+ endif ()
+ endif ()
endfunction()
# Add tinyusb to example
-function(family_add_tinyusb TARGET OPT_MCU)
+function(family_add_tinyusb TARGET OPT_MCU RTOS)
# tinyusb target is built for each example since it depends on example's tusb_config.h
set(TINYUSB_TARGET_PREFIX ${TARGET}-)
add_library(${TARGET}-tinyusb_config INTERFACE)
+ # path to tusb_config.h
target_include_directories(${TARGET}-tinyusb_config INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_compile_definitions(${TARGET}-tinyusb_config INTERFACE CFG_TUSB_MCU=${OPT_MCU})
+
if (DEFINED LOG)
target_compile_definitions(${TARGET}-tinyusb_config INTERFACE CFG_TUSB_DEBUG=${LOG})
endif()
+ if (RTOS STREQUAL "freertos")
+ target_compile_definitions(${TARGET}-tinyusb_config INTERFACE CFG_TUSB_OS=OPT_OS_FREERTOS)
+ endif ()
+
# tinyusb's CMakeList.txt
add_subdirectory(${TOP}/src ${CMAKE_CURRENT_BINARY_DIR}/tinyusb)
+
+ if (RTOS STREQUAL "freertos")
+ # link tinyusb with freeRTOS kernel
+ target_link_libraries(${TARGET}-tinyusb PUBLIC freertos_kernel)
+ endif ()
endfunction()
-# Add freeRTOS support to example
-function(family_add_freertos TARGET)
- # freeros config
- if (NOT TARGET freertos_config)
- add_library(freertos_config INTERFACE)
- target_include_directories(freertos_config INTERFACE
- ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/${FAMILY}/FreeRTOSConfig
- )
- # add board definition to freertos_config mostly for SystemCoreClock
- target_link_libraries(freertos_config INTERFACE board_${BOARD})
- endif()
+# Add bin/hex output
+function(family_add_bin_hex TARGET)
+ add_custom_command(TARGET ${TARGET} POST_BUILD
+ COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin
+ COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex
+ VERBATIM)
+endfunction()
- # freertos kernel should be generic as freertos_config however, CMAKE complains with missing variable
- # such as CMAKE_C_COMPILE_OBJECT
- if (NOT TARGET freertos_kernel)
- add_subdirectory(${TOP}/lib/FreeRTOS-Kernel ${CMAKE_BINARY_DIR}/lib/freertos_kernel)
- endif ()
- # Add FreeRTOS option to tinyusb_config
- target_compile_definitions(${TARGET}-tinyusb_config INTERFACE
- CFG_TUSB_OS=OPT_OS_FREERTOS
- )
- # link tinyusb with freeRTOS kernel
- target_link_libraries(${TARGET}-tinyusb PUBLIC freertos_kernel)
- target_link_libraries(${TARGET} PUBLIC freertos_kernel)
+#----------------------------------
+# Example Target Configure (Default rule)
+# These function can be redefined in FAMILY/family.cmake
+#----------------------------------
+
+function(family_configure_example TARGET RTOS)
+ # empty function, should be redefined in FAMILY/family.cmake
+endfunction()
+
+# Configure device example with RTOS
+function(family_configure_device_example TARGET RTOS)
+ family_configure_example(${TARGET} ${RTOS})
endfunction()
+# Configure host example with RTOS
+function(family_configure_host_example TARGET RTOS)
+ family_configure_example(${TARGET} ${RTOS})
+endfunction()
+
+
+# Configure host + device example with RTOS
+function(family_configure_dual_usb_example TARGET RTOS)
+ family_configure_example(${TARGET} ${RTOS})
+endfunction()
+
+#----------------------------------
+# RPI specific: refactor later
+#----------------------------------
function(family_add_default_example_warnings TARGET)
target_compile_options(${TARGET} PUBLIC
-Wall
@@ -294,16 +320,6 @@ function(family_add_default_example_warnings TARGET)
endif()
endfunction()
-
-# Add bin/hex output
-function(family_add_bin_hex TARGET)
- add_custom_command(TARGET ${TARGET} POST_BUILD
- COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin
- COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex
- VERBATIM)
-endfunction()
-
-
#----------------------------------
# Flashing target
#----------------------------------
@@ -374,6 +390,10 @@ function(family_flash_nxplink TARGET)
endfunction()
+#----------------------------------
+# Family specific
+#----------------------------------
+
# family specific: can override above functions
include(${CMAKE_CURRENT_LIST_DIR}/${FAMILY}/family.cmake)
diff --git a/hw/bsp/imxrt/family.cmake b/hw/bsp/imxrt/family.cmake
index 4a9842cf9..aaedfc9d6 100644
--- a/hw/bsp/imxrt/family.cmake
+++ b/hw/bsp/imxrt/family.cmake
@@ -94,8 +94,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -115,7 +115,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_MIMXRT1XXX)
+ family_add_tinyusb(${TARGET} OPT_MCU_MIMXRT1XXX ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c
@@ -130,16 +130,3 @@ function(family_configure_example TARGET)
family_flash_jlink(${TARGET})
#family_flash_nxplink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/kinetis_kl/family.cmake b/hw/bsp/kinetis_kl/family.cmake
index 5d4165185..4df3d1ed1 100644
--- a/hw/bsp/kinetis_kl/family.cmake
+++ b/hw/bsp/kinetis_kl/family.cmake
@@ -78,8 +78,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -99,7 +99,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_KINETIS_KL)
+ family_add_tinyusb(${TARGET} OPT_MCU_KINETIS_KL ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/chipidea/ci_fs/dcd_ci_fs.c
${TOP}/src/portable/nxp/khci/hcd_khci.c
@@ -113,16 +113,3 @@ function(family_configure_example TARGET)
family_flash_jlink(${TARGET})
#family_flash_nxplink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/lpc18/family.cmake b/hw/bsp/lpc18/family.cmake
index 4e6e2b56d..da71a0e5d 100644
--- a/hw/bsp/lpc18/family.cmake
+++ b/hw/bsp/lpc18/family.cmake
@@ -70,8 +70,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -91,7 +91,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_LPC18XX)
+ family_add_tinyusb(${TARGET} OPT_MCU_LPC18XX ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c
@@ -106,16 +106,3 @@ function(family_configure_example TARGET)
family_flash_jlink(${TARGET})
#family_flash_nxplink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/lpc55/family.cmake b/hw/bsp/lpc55/family.cmake
index e443f47d3..dfd08a732 100644
--- a/hw/bsp/lpc55/family.cmake
+++ b/hw/bsp/lpc55/family.cmake
@@ -87,8 +87,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -117,7 +117,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_LPC55XX)
+ family_add_tinyusb(${TARGET} OPT_MCU_LPC55XX ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
)
@@ -131,16 +131,3 @@ function(family_configure_example TARGET)
#family_flash_nxplink(${TARGET})
#family_flash_pyocd(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/mcx/family.cmake b/hw/bsp/mcx/family.cmake
index 83f44222b..f548ac4f3 100644
--- a/hw/bsp/mcx/family.cmake
+++ b/hw/bsp/mcx/family.cmake
@@ -79,8 +79,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -100,7 +100,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_MCXN9)
+ family_add_tinyusb(${TARGET} OPT_MCU_MCXN9 ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
# TinyUSB: Port0 is chipidea FS, Port1 is chipidea HS
${TOP}/src/portable/chipidea/$<IF:${PORT},ci_hs/dcd_ci_hs.c,ci_fs/dcd_ci_fs.c>
@@ -115,16 +115,3 @@ function(family_configure_example TARGET)
#family_flash_nxplink(${TARGET})
#family_flash_pyocd(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/nrf/family.cmake b/hw/bsp/nrf/family.cmake
index 825380d0b..30fd41d7b 100644
--- a/hw/bsp/nrf/family.cmake
+++ b/hw/bsp/nrf/family.cmake
@@ -97,8 +97,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -118,7 +118,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_NRF5X)
+ family_add_tinyusb(${TARGET} OPT_MCU_NRF5X ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/nordic/nrf5x/dcd_nrf5x.c
)
@@ -132,16 +132,3 @@ function(family_configure_example TARGET)
# Flashing
family_flash_jlink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/rp2040/family.cmake b/hw/bsp/rp2040/family.cmake
index 2d37f8be9..b986b3ebb 100644
--- a/hw/bsp/rp2040/family.cmake
+++ b/hw/bsp/rp2040/family.cmake
@@ -11,6 +11,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/pico_sdk_import.cmake)
# include basic family CMake functionality
set(FAMILY_MCUS RP2040)
+set(JLINK_DEVICE rp2040_m0_0)
include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)
@@ -143,12 +144,23 @@ endif()
# Functions
#------------------------------------
-function(family_configure_target TARGET)
+function(family_configure_target TARGET RTOS)
+ if (RTOS STREQUAL noos OR RTOS STREQUAL "")
+ set(RTOS_SUFFIX "")
+ else()
+ set(RTOS_SUFFIX _${RTOS})
+ endif()
+ # export RTOS_SUFFIX to parent scope
+ set(RTOS_SUFFIX ${RTOS_SUFFIX} PARENT_SCOPE)
+
pico_add_extra_outputs(${TARGET})
pico_enable_stdio_uart(${TARGET} 1)
- target_link_libraries(${TARGET} PUBLIC pico_stdlib pico_bootsel_via_double_reset tinyusb_board tinyusb_additions)
+ target_link_libraries(${TARGET} PUBLIC pico_stdlib pico_bootsel_via_double_reset tinyusb_board${RTOS_SUFFIX} tinyusb_additions)
+
+ family_flash_jlink(${TARGET})
endfunction()
+
function(rp2040_family_configure_example_warnings TARGET)
if (NOT PICO_TINYUSB_NO_EXAMPLE_WARNINGS)
family_add_default_example_warnings(${TARGET})
@@ -159,19 +171,22 @@ function(rp2040_family_configure_example_warnings TARGET)
suppress_tinyusb_warnings()
endfunction()
-function(family_configure_device_example TARGET)
- family_configure_target(${TARGET})
- target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_device)
+
+function(family_configure_device_example TARGET RTOS)
+ family_configure_target(${TARGET} ${RTOS})
+ target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_device${RTOS_SUFFIX})
rp2040_family_configure_example_warnings(${TARGET})
endfunction()
+
function(family_add_pico_pio_usb TARGET)
target_link_libraries(${TARGET} PUBLIC tinyusb_pico_pio_usb)
endfunction()
-function(family_configure_host_example TARGET)
- family_configure_target(${TARGET})
- target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_host)
+
+function(family_configure_host_example TARGET RTOS)
+ family_configure_target(${TARGET} ${RTOS})
+ target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_host${RTOS_SUFFIX})
rp2040_family_configure_example_warnings(${TARGET})
# For rp2040 enable pico-pio-usb
@@ -183,13 +198,15 @@ function(family_configure_host_example TARGET)
endif()
endfunction()
-function(family_configure_dual_usb_example TARGET)
- family_configure_target(${TARGET})
+
+function(family_configure_dual_usb_example TARGET RTOS)
+ family_configure_target(${TARGET} ${RTOS})
# require tinyusb_pico_pio_usb
target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_device tinyusb_host tinyusb_pico_pio_usb )
rp2040_family_configure_example_warnings(${TARGET})
endfunction()
+
function(check_and_add_pico_pio_usb_support)
# check for pico_generate_pio_header (as depending on environment we may be called before SDK is
# initialized in which case it isn't available yet), and only do the initialization once
@@ -243,6 +260,7 @@ endfunction()
# when included by the SDK itself)
check_and_add_pico_pio_usb_support()
+
function(family_initialize_project PROJECT DIR)
# call the original version of this function from family_common.cmake
_family_initialize_project(${PROJECT} ${DIR})
@@ -253,6 +271,7 @@ function(family_initialize_project PROJECT DIR)
check_and_add_pico_pio_usb_support()
endfunction()
+
# This method must be called from the project scope to suppress known warnings in TinyUSB source files
function(suppress_tinyusb_warnings)
# some of these are pretty silly warnings only occurring in some older GCC versions 9 or prior
@@ -327,7 +346,3 @@ function(suppress_tinyusb_warnings)
COMPILE_FLAGS "-Wno-cast-qual")
endif()
endfunction()
-
-# rp2040 does not support freeRTOS example yet
-function(family_add_freertos TARGET)
-endfunction()
diff --git a/hw/bsp/stm32f0/family.cmake b/hw/bsp/stm32f0/family.cmake
index ecf6a8424..73f43de82 100644
--- a/hw/bsp/stm32f0/family.cmake
+++ b/hw/bsp/stm32f0/family.cmake
@@ -84,8 +84,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -105,7 +105,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_STM32F0)
+ family_add_tinyusb(${TARGET} OPT_MCU_STM32F0 ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
)
@@ -118,16 +118,3 @@ function(family_configure_example TARGET)
family_flash_stlink(${TARGET})
#family_flash_jlink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/stm32f1/family.cmake b/hw/bsp/stm32f1/family.cmake
index ab46c9872..efe41bc1b 100644
--- a/hw/bsp/stm32f1/family.cmake
+++ b/hw/bsp/stm32f1/family.cmake
@@ -81,8 +81,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -102,7 +102,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_STM32F1)
+ family_add_tinyusb(${TARGET} OPT_MCU_STM32F1 ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
)
@@ -115,16 +115,3 @@ function(family_configure_example TARGET)
family_flash_stlink(${TARGET})
#family_flash_jlink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/stm32f7/family.cmake b/hw/bsp/stm32f7/family.cmake
index 3b6ba1a15..30bde9b0d 100644
--- a/hw/bsp/stm32f7/family.cmake
+++ b/hw/bsp/stm32f7/family.cmake
@@ -86,8 +86,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -107,7 +107,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_STM32F7)
+ family_add_tinyusb(${TARGET} OPT_MCU_STM32F7 ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c
)
@@ -120,16 +120,3 @@ function(family_configure_example TARGET)
family_flash_stlink(${TARGET})
family_flash_jlink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/stm32g0/family.cmake b/hw/bsp/stm32g0/family.cmake
index fa93566bf..f7b665090 100644
--- a/hw/bsp/stm32g0/family.cmake
+++ b/hw/bsp/stm32g0/family.cmake
@@ -84,8 +84,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -105,7 +105,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_STM32G0)
+ family_add_tinyusb(${TARGET} OPT_MCU_STM32G0 ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
${TOP}/src/portable/st/typec/typec_stm32.c
@@ -119,16 +119,3 @@ function(family_configure_example TARGET)
family_flash_stlink(${TARGET})
#family_flash_jlink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/stm32g4/family.cmake b/hw/bsp/stm32g4/family.cmake
index c89993f6d..3c7633d64 100644
--- a/hw/bsp/stm32g4/family.cmake
+++ b/hw/bsp/stm32g4/family.cmake
@@ -84,8 +84,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -105,7 +105,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_STM32G4)
+ family_add_tinyusb(${TARGET} OPT_MCU_STM32G4 ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
${TOP}/src/portable/st/typec/typec_stm32.c
@@ -119,16 +119,3 @@ function(family_configure_example TARGET)
family_flash_stlink(${TARGET})
family_flash_jlink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/stm32h7/family.cmake b/hw/bsp/stm32h7/family.cmake
index f3705edb4..1a8c4354c 100644
--- a/hw/bsp/stm32h7/family.cmake
+++ b/hw/bsp/stm32h7/family.cmake
@@ -89,8 +89,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -110,7 +110,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_STM32H7)
+ family_add_tinyusb(${TARGET} OPT_MCU_STM32H7 ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c
)
@@ -123,16 +123,3 @@ function(family_configure_example TARGET)
family_flash_stlink(${TARGET})
family_flash_jlink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/hw/bsp/stm32l4/family.cmake b/hw/bsp/stm32l4/family.cmake
index 83c51c9bf..da017cdde 100644
--- a/hw/bsp/stm32l4/family.cmake
+++ b/hw/bsp/stm32l4/family.cmake
@@ -86,8 +86,8 @@ endfunction()
#------------------------------------
# Functions
#------------------------------------
-function(family_configure_example TARGET)
- family_configure_common(${TARGET})
+function(family_configure_example TARGET RTOS)
+ family_configure_common(${TARGET} ${RTOS})
# Board target
add_board_target(board_${BOARD})
@@ -107,7 +107,7 @@ function(family_configure_example TARGET)
)
# Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_${FAMILY_MCUS})
+ family_add_tinyusb(${TARGET} OPT_MCU_${FAMILY_MCUS} ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c
${TOP}/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
@@ -121,16 +121,3 @@ function(family_configure_example TARGET)
family_flash_stlink(${TARGET})
family_flash_jlink(${TARGET})
endfunction()
-
-
-function(family_configure_device_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_host_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
-
-function(family_configure_dual_usb_example TARGET)
- family_configure_example(${TARGET})
-endfunction()
diff --git a/src/common/tusb_compiler.h b/src/common/tusb_compiler.h
index 5ab56e145..6f07bdd53 100644
--- a/src/common/tusb_compiler.h
+++ b/src/common/tusb_compiler.h
@@ -128,7 +128,9 @@
#define TU_ATTR_SECTION(sec_name) __attribute__ ((section(#sec_name)))
#define TU_ATTR_PACKED __attribute__ ((packed))
#define TU_ATTR_WEAK __attribute__ ((weak))
- #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
+ #ifndef TU_ATTR_ALWAYS_INLINE // allow to override for debug
+ #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
+ #endif
#define TU_ATTR_DEPRECATED(mess) __attribute__ ((deprecated(mess))) // warn if function with this attribute is used
#define TU_ATTR_UNUSED __attribute__ ((unused)) // Function/Variable is meant to be possibly unused
#define TU_ATTR_USED __attribute__ ((used)) // Function/Variable is meant to be used
@@ -205,7 +207,9 @@
#define TU_ATTR_SECTION(sec_name) __attribute__ ((section(#sec_name)))
#define TU_ATTR_PACKED __attribute__ ((packed))
#define TU_ATTR_WEAK __attribute__ ((weak))
- #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
+ #ifndef TU_ATTR_ALWAYS_INLINE // allow to override for debug
+ #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
+ #endif
#define TU_ATTR_DEPRECATED(mess) __attribute__ ((deprecated(mess))) // warn if function with this attribute is used
#define TU_ATTR_UNUSED __attribute__ ((unused)) // Function/Variable is meant to be possibly unused
#define TU_ATTR_USED __attribute__ ((used)) // Function/Variable is meant to be used
diff --git a/test/fuzz/device/cdc/CMakeLists.txt b/test/fuzz/device/cdc/CMakeLists.txt
index 8e4db9d29..c60f292b9 100644
--- a/test/fuzz/device/cdc/CMakeLists.txt
+++ b/test/fuzz/device/cdc/CMakeLists.txt
@@ -14,16 +14,16 @@ add_executable(${PROJECT})
# Example source
target_sources(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
- )
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
+ )
# Example include
target_include_directories(${PROJECT} PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- )
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ )
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/test/fuzz/device/msc/CMakeLists.txt b/test/fuzz/device/msc/CMakeLists.txt
index 8e4db9d29..8bff217cb 100644
--- a/test/fuzz/device/msc/CMakeLists.txt
+++ b/test/fuzz/device/msc/CMakeLists.txt
@@ -24,6 +24,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)
diff --git a/test/fuzz/device/net/CMakeLists.txt b/test/fuzz/device/net/CMakeLists.txt
index 8e4db9d29..8bff217cb 100644
--- a/test/fuzz/device/net/CMakeLists.txt
+++ b/test/fuzz/device/net/CMakeLists.txt
@@ -24,6 +24,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${PROJECT} noos)