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

Initial Zephyr support #2962

Merged
merged 15 commits into from
Jan 25, 2025
Merged

Initial Zephyr support #2962

merged 15 commits into from
Jan 25, 2025

Conversation

hathach
Copy link
Owner

@hathach hathach commented Jan 25, 2025

Add initial support for Zephyr

  • Add osal_zephyr.h and OPT_OS_ZEPHYR
  • update dcd_nrf5x.c to compile with zephyr
  • Rework cmake build system to work with zephyr package and west: supported examples are board_test, cdc_msc, msc_dual_lun. -DRTOS=zephyr need to passed to cmake/west to tell example cmake to use zephyr package
  • make won't be supported, since zephyr based entirely on cmake and rather complicated
  • only support/test with pca10056(nrf52840)
  • examples code does not make use of zephyr API just yet, therefore led may not blink correctly, cdc is not tested, however with both cdc_msc and msc_dual_lun, thumbdrive is showed up as proof of concept.
  • other ports such as samd may need some twweak and API/include usage to compatible with asf/sdk used by zephyr, but this is totally possible.

to build zephyr, first install west and zephyr sdk then cd to tinyusb repo then init workspace using examples/west.yml and fetch zephyr-os with

west init -l examples # init zephyr project 
west update

Then build with west, don't forget to have -- -DRTOS=zephyr for tinyusb example's CMakeLists.txt to fetch zephyr package

west build -b pca10056 -d examples/device/cdc_msc/build examples/device/cdc_msc -- -DRTOS=zephyr
west build -b pca10056 -d examples/device/msc_dual_lun/build examples/device/msc_dual_lun -- -DRTOS=zephyr

@tannewt @ladyada

@hathach hathach changed the title Zephyr support Initial Zephyr support Jan 25, 2025
@hathach hathach force-pushed the zephyr-support branch 2 times, most recently from 252b56b to 7529dd8 Compare January 25, 2025 10:51
@hathach hathach merged commit 0d4f945 into master Jan 25, 2025
180 checks passed
@hathach hathach deleted the zephyr-support branch January 25, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant