Skip to content

Commit 0d4f945

Browse files
authored
Merge pull request #2962 from hathach/zephyr-support
Initial Zephyr support
2 parents 37e6f49 + 882cb14 commit 0d4f945

File tree

141 files changed

+825
-685
lines changed

Some content is hidden

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

141 files changed

+825
-685
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,24 @@ jobs:
137137

138138
- name: Build
139139
run: python3 tools/build.py --one-per-family --toolchain iar $BUILD_ARGS
140+
141+
# ---------------------------------------
142+
# Zephyr
143+
# ---------------------------------------
144+
zephyr:
145+
if: github.event_name == 'push'
146+
runs-on: ubuntu-latest
147+
steps:
148+
- name: Checkout TinyUSB
149+
uses: actions/checkout@v4
150+
151+
- name: Setup Zephyr project
152+
uses: zephyrproject-rtos/action-zephyr-setup@v1
153+
with:
154+
app-path: examples
155+
toolchains: arm-zephyr-eabi
156+
157+
- name: Build
158+
run: |
159+
west build -b pca10056 -d examples/device/cdc_msc/build examples/device/cdc_msc -- -DRTOS=zephyr
160+
west build -b pca10056 -d examples/device/msc_dual_lun/build examples/device/msc_dual_lun -- -DRTOS=zephyr

.idea/cmake.xml

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.17)
1+
cmake_minimum_required(VERSION 3.20)
22

33
#set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
44
include(${CMAKE_CURRENT_SOURCE_DIR}/../hw/bsp/family_support.cmake)

examples/build_system/cmake/toolchain/arm_gcc.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if (RTOS STREQUAL zephyr)
2+
return()
3+
endif ()
4+
15
if (NOT DEFINED CMAKE_C_COMPILER)
26
set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
37
endif ()

examples/build_system/cmake/toolchain/common.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ include(CMakePrintHelpers)
44
# Common
55
# ----------------------------------------------------------------------------
66
set(CMAKE_SYSTEM_NAME Generic)
7+
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_CPU})
78
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
89

910
# Look for includes and libraries only in the target system prefix.
@@ -13,8 +14,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
1314
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
1415

1516
# pass TOOLCHAIN_CPU to
16-
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_SYSTEM_PROCESSOR)
17-
include(${CMAKE_CURRENT_LIST_DIR}/../cpu/${CMAKE_SYSTEM_PROCESSOR}.cmake)
17+
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_SYSTEM_PROCESSOR CMAKE_SYSTEM_CPU)
18+
include(${CMAKE_CURRENT_LIST_DIR}/../cpu/${CMAKE_SYSTEM_CPU}.cmake)
1819

1920
# ----------------------------------------------------------------------------
2021
# Compile flags

examples/device/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.17)
1+
cmake_minimum_required(VERSION 3.20)
22

33
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
44

examples/device/audio_4_channel_mic/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.17)
1+
cmake_minimum_required(VERSION 3.20)
22

33
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
44

examples/device/audio_4_channel_mic_freertos/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.17)
1+
cmake_minimum_required(VERSION 3.20)
22

33
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
44

examples/device/audio_test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.17)
1+
cmake_minimum_required(VERSION 3.20)
22

33
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
44

examples/device/audio_test_freertos/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.17)
1+
cmake_minimum_required(VERSION 3.20)
22

33
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
44

0 commit comments

Comments
 (0)