Skip to content

move to tinyusb 0.9.0 - switch to using their examples directly rather than copied versions #99

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

Closed
wants to merge 1 commit into from

Conversation

kilograham
Copy link
Contributor

replace copied tinyusb examples with use of examples directly from tinyusb repo.

this avoids us having to fix up examples ourselves if the upstream API changes, though for now we still have a hard-coded list of examples, and we are using a GLOB (within an SDK provide add_tinyusb_device/host_example method) to generate build targets for them.

this works currently, though is not ideal. to fix it we need the cmake structure within TinyUSB example to be more friendly towards the use case of including their exmaples' CMakeLists.txts in this way

@kilograham kilograham marked this pull request as draft April 8, 2021 17:37
add_tinyusb_device_example(cdc_msc)
# todo gate with freertos lib
#add_tinyusb_device_example(cdc_msc_freertos)
add_tinyusb_device_example(dfu_runtime)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this relevant, given that we recommend flashing via UF2? 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DFU = Device Firmware Upgrade, typically used to write the flash on a microcontroller (which is what we use UF2 for). But I've just checked https://github.com/hathach/tinyusb/blob/master/examples/device/dfu_runtime/src/main.c and see that it says:

Since this example is minimal, it doesn't actually go into DFU mode but rather change the LED blinking pattern to fast rate as indicator.

So apologies for the irrelevant comment! 😆

@lurch
Copy link
Contributor

lurch commented Apr 9, 2021

I guess the CI tests here won't pass until after raspberrypi/pico-sdk#321 has been merged.

@kilograham
Copy link
Contributor Author

I guess the CI tests here won't pass until after raspberrypi/pico-sdk#321 has been merged.

correct; would be nice if there is a way to handle this sort of dependency case without too much effort

@lurch
Copy link
Contributor

lurch commented Apr 9, 2021

would be nice if there is a way to handle this sort of dependency case without too much effort

I think you might be able to fix that by editing the pico-sdk branch that https://github.com/raspberrypi/pico-examples/blob/master/.github/workflows/cmake.yml points at in this PR, but you'd need to remember to revert that change again before merging this PR. Maybe? 🤷

@lurch
Copy link
Contributor

lurch commented Apr 9, 2021

P.S. Should this PR be targeting the develop branch?

@kilograham kilograham changed the base branch from master to develop April 9, 2021 13:22
@kilograham kilograham changed the base branch from develop to master April 9, 2021 13:23
@kilograham kilograham closed this Jun 1, 2021
@kilograham kilograham deleted the tinyusb-0.9.0 branch June 1, 2021 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants