Micropython for Pico won't build

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
hippy
Posts: 130
Joined: Sat Feb 20, 2021 2:46 pm
Location: UK

Micropython for Pico won't build

Post by hippy » Mon Apr 18, 2022 8:20 pm

Fresh git clone install ...

Code: Select all

GEN /home/pi/pico/micropython/ports/rp2/build/genhdr/mpversion.h
[  4%] Generating genhdr/moduledefs.h
[  5%] Generating genhdr/qstr.i.last
/home/pi/pico/micropython/extmod/moduhashlib.c:35:10: fatal error: mbedtls/version.h: No such file or directory
 #include "mbedtls/version.h"
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
/home/pi/pico/micropython/extmod/moducryptolib.c:64:10: fatal error: mbedtls/aes.h: No such file or directory
 #include <mbedtls/aes.h>
          ^~~~~~~~~~~~~~~
compilation terminated.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Micropython for Pico won't build

Post by pythoncoder » Tue Apr 19, 2022 12:42 pm

Did you do

Code: Select all

make submodules
make BOARD=PICO
Peter Hinch
Index to my micropython libraries.

hippy
Posts: 130
Joined: Sat Feb 20, 2021 2:46 pm
Location: UK

Re: Micropython for Pico won't build

Post by hippy » Fri Apr 22, 2022 9:55 am

pythoncoder wrote:
Tue Apr 19, 2022 12:42 pm
Did you do

Code: Select all

make submodules
make BOARD=PICO
No, I did neither.

The official Raspberry Pi Getting Started documentation doesn't detail the need to do that and I have always used CMake to build MicroPython from source for the Pico and RP2040 rather than 'make'.

The three solutions appear to be -

Code: Select all

cd ~/pico/micropython/ports/rp2
make submodules 

Code: Select all

cd ~/pico/micropython
git submodule update --init -- lib/mbedtls

Code: Select all

cd ~/pico/micropython
git submodule update --init
Last edited by hippy on Thu May 05, 2022 5:19 pm, edited 1 time in total.

Pauldow
Posts: 1
Joined: Wed May 04, 2022 8:58 pm

Re: Micropython for Pico won't build

Post by Pauldow » Wed May 04, 2022 9:03 pm

hippy wrote:
Fri Apr 22, 2022 9:55 am

Code: Select all

cd ~/pico/micropython
git submodule update --init -- lib/mbdedtls
I am just starting with this, but I got a Did not match any files error with that git command.
Should it be?
git submodule update --init -- lib/mbedtls

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Micropython for Pico won't build

Post by Roberthh » Thu May 05, 2022 6:03 am

I use in that case:

git submodule update --init lib/mbdedtls

hippy
Posts: 130
Joined: Sat Feb 20, 2021 2:46 pm
Location: UK

Re: Micropython for Pico won't build

Post by hippy » Thu May 05, 2022 5:25 pm

Pauldow wrote:
Wed May 04, 2022 9:03 pm
Should it be?
git submodule update --init -- lib/mbedtls
Indeed it should. Apologies for that, I should have copy-and-pasted rather than typing in to the post. Thanks for letting me know and I have updated my post.

I have no idea what the '--' is for, what purpose it serves. I just copied someone else's example.

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: Micropython for Pico won't build

Post by scruss » Thu May 05, 2022 8:12 pm

hippy wrote:
Thu May 05, 2022 5:25 pm
I have no idea what the '--' is for, what purpose it serves. I just copied someone else's example.
-- is gnuish (possibly posix, too) for "there are no options after this". Some people consider it polite to put into examples, but the only real use I've found for it is removing files called something like -file

Post Reply