Skip to content

tools: makeboards.py: Allow disabling USB stack #972

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

kholk
Copy link
Contributor

@kholk kholk commented Nov 10, 2022

RP2040 supports USB but it's not granted that everyone wants to actually enable it on "regular" builds: allow building without USB support when unneeded to allow saving a few bytes of RAM.


I'm proposing this change because my project (having 3 round SPI displays, using 3 UARTs and, fun fact, leaves only one single free GPIO on my busy Pi Pico board) really needs every last byte of RAM that I can get and the only reason why I would ever need USB is to flash the board through the bootloader.

P.S.: That project is going to be open source, currently 90% complete, I'll publish the code somewhere when it reaches 100% completion :))

Cheers!

RP2040 supports USB but it's not granted that everyone wants to
actually enable it on "regular" builds: allow building without USB
support when unneeded to allow saving a few bytes of RAM.
Copy link
Owner

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

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

This logic doesn't make sense to me and doesn't do what you way you're looking for.

If you're looking for a way to disable the USB stack there is already a way, add -DNO_USB=1 to your platform_local.txt or your Platform.IO ini file.

@kholk
Copy link
Contributor Author

kholk commented Nov 23, 2022

The rationale behind this change is that while it's easy for a more experienced person to modify the txt manually, or to add a platform_local.txt, then delete the Arduino IDE cache (because sometimes it doesn't work if you don't delete the cache), then finally restart the IDE and enjoy......

... This change will simply allow to select "No USB" from the IDE menu, allowing to switch between enabling or disabling the USB stack on the fly before rebuilding, even to the less experienced (and/or lazy developers).

There are surely other ways, but this one will greatly increase the time savings for such usecase.

@earlephilhower
Copy link
Owner

Ah, I see what you wanted to do here. Isn't the way I'd have done it, but I think it may be OK. But you need to run the change and check in the modified boards.txt to pass CI.

@earlephilhower
Copy link
Owner

Closing as combined w/#1013

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.

2 participants