2

I've searched and not found an answer.. I'm proficient in C and Micro-python and developing and running programs is easy enough.

However I can't figure out how I install a program I've written to the Pico so that when I supply it purely power it runs?

With ESP32 devices I would normally flash the program to NVMe ram and configure uboot to run it.

7

Using Thonny save your MicroPython file to the pico as a file called main.py

Next time you power on the Pico your program should autostart.

See section 4.1.1:

https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-python-sdk.pdf

2

Or, if you don't want to use Thonny (I prefer to choose my own development environment), you can use ampy, a command-line tool for micropython boards.

Example usage:

ampy -p /dev/ttyACM0 put main.py

Note that to auto-run, your Python file needs to be called main.py.

4
  • Thanks I use C normally.. Buy I've been playing with micro python on the nano so its nice to know how to auto start it. – Simon Banks Mar 1 at 19:07
  • 1
    @SimonBanks For C, I think you just build a UF2 binary, and drag that onto the Pico after booting it in programming mode? I haven't tried C on the Pico yet myself, but I think that's the method. – marcelm Mar 1 at 20:48
  • Many Thanks that makes sense.. – Simon Banks Mar 2 at 14:39
  • @SimonBanks By the way, the Pico also has a single-wire debugging interface (the 3 pads on the short side). I think you can also program it over that interface, but I really haven't researched that yet :) – marcelm Mar 2 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.