
zshrc and add:Įxport PICO_SDK_PATH="$HOME/git/pico-sdk" Run git clone -b master -recurse-submodules.In Terminal, go to your projects directory, eg.As an example, I’ll use the directory ~/git as the base installation location and the project name PicoTest, but you can use whatever paths and names you prefer, of course. The Foundation documents this, but different parts of the setup are covered in different places, so here is my combined, tested sequence. Installing the Toolsįirst, though this is how you set up your Pico toolchain on a Mac. This is much better way of debugging development code, but working with SWD on a Mac is not straightforward, so I’ll be covering it separately. More to the point, it is used to enable on-chip debugging so that you can see how your code is operating on the machine and do useful things like set breakpoints so you can pause the program to check the value of variables and such. These SWD pins can be used for transferring code to the Pico without all that tedious plugging and unplugging of USB cables.

The Pico supports a much better alternative: Serial Wire Debug (SWD), accessed through the three pins marked DEBUG on the far edge from the USB connector. This approach is convenient for embedded newbies, but it’s a faff having to re-mount your Pico every time you update your code - not to mention tough on the USB connector.
%2B-%2B12.0.21005%2B(2).png)
When you do, the Pico reboots, installs the compiled code and runs it. uf2 files so that you can just mount the Pico’s internal storage on your computer and drag the binary across, just as you would with MicroPython source.

That’s inevitable: this way you don’t have to worry about the complexities of installing your code into the correct part of the target chip’s memory map and can instead focus on your application code.įor those of us who aren’t experienced embedded developers, the SDK is set up to generate. There is a lot of ancillary code added by the SDK in there too. With the SDK, you’re not totally there: compiling a simple Hello, World program, for example, generates a very small binary but it’s still a little larger than you might expect. Programming in C or C++ brings you so much closer to the bare metal than an interpreted language like Python can.
