Skip to content

CI: Tidyup and combine MicroPython builds. #737

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

Merged
merged 8 commits into from
Mar 29, 2023
Merged

Conversation

Gadgetoid
Copy link
Member

@Gadgetoid Gadgetoid commented Mar 28, 2023

This might be better left until we've removed Cosmic, Galactic and Inky frame builds to their own repositories.

Most of the fixups can probably be replaced with -DMICROPY_BOARD_DIR, too. As per - https://github.com/pimoroni/badger2040/blob/main/.github/workflows/micropython.yml

@Gadgetoid Gadgetoid force-pushed the patch-cleanup-workflows branch 3 times, most recently from f5582b1 to 0e8dae4 Compare March 28, 2023 19:59
@Gadgetoid Gadgetoid force-pushed the patch-cleanup-workflows branch from 0e8dae4 to d697976 Compare March 28, 2023 20:06
Set the PICO_BOARD_HEADER_DIRS environment variable as per https://github.com/raspberrypi/pico-sdk/blob/master/src/boards/generic_board.cmake

Add our local search path alongside the existing Pico SDK boards dir.
@Gadgetoid Gadgetoid force-pushed the patch-cleanup-workflows branch 2 times, most recently from 3dd98e3 to 1fcde4c Compare March 28, 2023 20:56
Move out of the USER_C_MODULES .cmake file.
@Gadgetoid Gadgetoid force-pushed the patch-cleanup-workflows branch from 1fcde4c to cce02fe Compare March 28, 2023 21:04
@Gadgetoid Gadgetoid force-pushed the patch-cleanup-workflows branch from be27c84 to 3a35013 Compare March 28, 2023 21:24
@Gadgetoid
Copy link
Member Author

Gadgetoid commented Mar 28, 2023

This is getting... somewhere. I couldn't help but come back for another crack at this.

The TLDR is- our build setup wasn't exactly robust and up to date, and this should - with any luck - give us a more rational set of steps that aren't against the grain and hard to debug.

Mostly-

  • Stop copying board dirs into the MicroPython and Pico SDK source trees 😬
  • Use -DMICROPY_BOARD_DIR instead
  • Borrow a trick to make the PIMORONI_TUFTY2040 board let Pico SDK correctly locate pimoroni_tufty2040.h
  • Explicitly denote which boards need hacks and local board dirs in the workflow matrix- this shows up in CI runs, so we can tell at a glance with flavour of build it is
  • rename everything so it's not so darn wordy, no more MicroPython / Build picow_cosmic_unicorn, it's now MicroPython / cosmic_unicorn
  • combine Pico W and Pico style builds into a single workflow so they can share the cached MicroPython fetch

Given my recent tweaks to C++ code to avoid init RAM allocation (and on-init RAM initialisation I guess) I need to re-benchmark the Pico W startup time for Enviro to see if it's still necessary to include a full wakeup GPIO patch, or if we can move to the leaner, overclock-only version we use for Badger 2040.

If it's the latter, the overclock-only patch can just be applied to all builds for the very small, early speedup that it gives prior to proper clock configuration. This hack/patch was originally contrived because MicroPython's gc_heap variable was being zero-init, which took a surprisingly long time (adding milliseconds to the boot). I fixed this with micropython/micropython#9017 but it's subsequently been rendered irrelevant by MicroPython's greedy heap change.

Additionally I learned that C++ init_priority(101) is per compilation unit, so the wakeup GPIO module can be - at least taking into account the quirks of our current compiler, and with the understanding the init order is not guaranteed - moved to earlier in the .cmake file so that it runs earlier on boot. Combined these might be enough to move wakeup GPIO latching from ASM to C++ as per - https://github.com/pimoroni/badger2040/blob/62deec7434a01da330a8a39eb999deb8b013ddb2/firmware/modules/wakeup/wakeup.cpp#L15-L17

@Gadgetoid Gadgetoid force-pushed the patch-cleanup-workflows branch 3 times, most recently from 15c1ab2 to 3a35013 Compare March 29, 2023 09:22
@Gadgetoid Gadgetoid merged commit 40d4774 into main Mar 29, 2023
@Gadgetoid Gadgetoid deleted the patch-cleanup-workflows branch October 31, 2024 10:48
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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy