Skip to content

Initial Zephyr support#2962

Merged
hathach merged 15 commits intomasterfrom
zephyr-support
Jan 25, 2025
Merged

Initial Zephyr support#2962
hathach merged 15 commits intomasterfrom
zephyr-support

Conversation

@hathach
Copy link
Copy Markdown
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
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.

2 participants