canhack icon indicating copy to clipboard operation
canhack copied to clipboard

Issue with build a firmware.uf2 on a Pi 4

Open DanielR92 opened this issue 2 years ago • 12 comments

Hello all,

I have trouble to build a firmware.uf2.
In the readme on the step 4 to make the build in the path "ports/rp2"

It says to me: /home/canhack/micropython/ports/rp2 (da4b38e75*) # make
[ -d build-PICO ] || cmake -S . -B build-PICO -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PICO make -s -C build-PICO make[1]: *** Es wurden keine Ziele angegeben und keine „make“-Steuerdatei gefunden. Schluss. make[1]: *** No targets were specified and no make control file was found. Ending. make: *** [Makefile:19: all] Fehler 2

Can somebody help me, or upload a firmware.uf2 for me?

Thanks :)

DanielR92 avatar Jun 30 '22 05:06 DanielR92

Firstly, I've not tried to build MicroPython on a Raspberry Pi before. In theory it should be fine but I've not done it.

The first step is to build the upstream MicroPython source before you apply the firmware patches. If that fails then the problem is with your build environment. What does that result in?

kentindell avatar Jun 30 '22 13:06 kentindell

Sorry but I am new in python. And have no Idea how to compile on the pico.

But I think the problem is my environment what do you say.

DanielR92 avatar Jun 30 '22 16:06 DanielR92

The MicroPython firmware is now pretty large and complex. So the first step is to build a clean MicroPython firmware build.

Try following the instructions in the README here:

https://github.com/kentindell/canhack/blob/master/pico/micropython/README.txt

Get the MicroPython repo cloned, and use the v1.18 release. If you can get steps 1-4 in the README done then you can build the MicroPython firmware.

kentindell avatar Jun 30 '22 16:06 kentindell

I already did this steps. See first post. But thanks for help. :)

DanielR92 avatar Jun 30 '22 16:06 DanielR92

So that's a 'stock' MicroPython build that failed? It works on Ubuntu and even macOS (subject to compiler tools) so I'm a bit surprised it fails on the RPi.

Are all the normal build-essential tools installed on the RPi?

kentindell avatar Jun 30 '22 16:06 kentindell

Hmm, someone else seems have problems with this but fixed it by changing Rapsbian's language to English:

https://github.com/micropython/micropython/issues/4755

And also problems if the path lengths are too long:

https://forum.micropython.org/viewtopic.php?p=63991#p63991

Some people seem to get along fine on the RPi4, and others don't..

kentindell avatar Jun 30 '22 16:06 kentindell

I will check that, thanks for the hint! :)

DanielR92 avatar Jun 30 '22 18:06 DanielR92

Ok I have a big issue with that. Have somebody a already running compiled of firmware.uf2 for me? Thanks :)

DanielR92 avatar Jul 04 '22 14:07 DanielR92

Does firmware-220511.uf2 not work for you?

kentindell avatar Jul 04 '22 15:07 kentindell

I think not, because when I put in the Pico it restart and in the console it show me: MicroPython v1.19.1 on 2022-06-18; Raspberry Pi Pico with RP2040 Type "help()" for more information.

from rp2 import * c = CAN() Traceback (most recent call last): File "", line 1, in NameError: name 'CAN' isn't defined

DanielR92 avatar Jul 05 '22 16:07 DanielR92

That's not the firmware in the repo: that looks like you've got the stock firmware on it.

kentindell avatar Jul 05 '22 16:07 kentindell

I have a fresh pico unpacked it and take the "firmware-20220511.uf2" in the "BOOTSEL" drive. After that it restart and I have a stock firmware on it. After that I put the python src/can2/ into the Pico.

But its not running. A simple question, exist a Howto how to run it easy? :)

thanks for help

DanielR92 avatar Jul 05 '22 18:07 DanielR92