pimoroni / pimoroni-pico

Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython.
https://shop.pimoroni.com/collections/pico
MIT License
1.23k stars 474 forks source link

Custom firmware - use git actions or compile locally? cant get either to work #949

Closed mwilliams03 closed 1 month ago

mwilliams03 commented 1 month ago

Hi, I would like to test out a 16x16 LED Matrix, which requires custom MicroPython firmware... but i am having issues trying to compile the repo to produce a uf2. I have tried to use git actions, but the pico uf2 is only 749KB, which appears to be wrong. I also tried locally, with the help from these two issues..but i am getting the below errors https://github.com/pimoroni/pimoroni-pico/issues/770 https://github.com/pimoroni/pimoroni-pico/issues/622


/home/pi/temp/pimoroni-pico/micropython/modules/picographics/picographics.c:4:7: error: expected ';' before 'const'
    4 | STATIC MP_DEFINE_CONST_FUN_OBJ_3(ModPicoGraphics_module_RGB_to_RGB332_obj, ModPicoGraphics_module_RGB_to_RGB332);

Can anyone recommend the best way to compile the firmware?

Gadgetoid commented 1 month ago

Just cloning the repository on GitHub and letting actions build your firmware is by far the least painful path.

Why does 749KB seem wrong? Our builds as reported by GitHub Actions are all roughly around that.

The error you're getting is specifically related to the removal of the STATIC macro, mentioned in the latest MicroPython release notes. Our main branch isn't update to accommodate that change yet.

You need to clone the version of MicroPython we're building against, or build a newer version of Pimoroni Pico from one of the "tracking MicroPython edge" pull requests.

The correct version is defined as MICROPYTHON_VERSION in the top of .github/workflows/micropython.yml.

Since previous attempts to answer the DIY build question, I've moved a bunch of stuff into ci/micropython.sh. Though it sounds like you're managing to build it locally anyway.

mwilliams03 commented 1 month ago

Doh! the file that GitHub action creates is zipped! I didn't notice this. The pico uf2 looks normal size (1.8MB) once extracted and the modifications I made work on my Pico..

Thanks for the fast response, closing issue.