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

Update pico-sdk submodule commit point #8

Open
caternuson opened this issue Jun 29, 2023 · 5 comments
Open

Update pico-sdk submodule commit point #8

caternuson opened this issue Jun 29, 2023 · 5 comments

Comments

@caternuson
Copy link

The current pico-sdk sudmodule commit point is prior to a fixed added to help with startup timing for the crystal. See here for more information:
raspberrypi/pico-sdk#457

Once updated, this hack should be able to be removed from the CI worflow:

#-- HACK-----------------------------------------------------------
# needed for older pico-sdk, see here for more info:
# https://github.com/raspberrypi/pico-sdk/pull/457
- name: Patch pico-sdk for crystal startup
run: sed -i 's/xosc_hw->startup = startup_delay;/xosc_hw->startup = startup_delay * 64;/' firmware/pico-sdk/src/rp2_common/hardware_xosc/xosc.c
#-- HACK-----------------------------------------------------------

@caternuson
Copy link
Author

This may require more work than just updating the pico-sdk submodule. The pico-sdk in turn has tinyusb as a submodule. There have been some breaking changes to tinyusb that will require additional code changes in the u2if source code.

@freemansoft
Copy link

How do you test a board to know if this timer hack is still required? Upgrading pico-sdk went without a hitch in the PR that we closed. I only tested on two devices.

@caternuson
Copy link
Author

caternuson commented Jan 29, 2025

A board running firmware built without the hack will not enumerate when plugged in or reset. Easiest way to know if this hack is needed is to just look at the file the sed command is altering.

Can also follow the linked pull request for more info and to see what the changes were that fixed it.

@freemansoft
Copy link

freemansoft commented Jan 29, 2025

So if I built my images using the build-all.sh which does not have the hack and with pic-sdk 2.1.0 and my board enumerates then the hack won't be needed any more?

Thanks for replying by the way. I know this isn't the highest priority item.

@caternuson
Copy link
Author

I think you still need to deal with it. But you don't need to modify source code. Can define a value for PICO_XOSC_STARTUP_DELAY_MULTIPLIER on command line, and set it to 64.

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

No branches or pull requests

2 participants