Hello! if you’re reading this then you’re either taking the zig embedded workshop at SYCL 2023, or you’re just curious. Either way, welcome!
Name |
Vendor |
Part No |
Breadboard |
Digikey |
1528-2143-ND |
Jumpers |
Digikey |
1568-1633-ND |
Raspberry Pi Pico H |
Digikey |
2648-SC0917-ND |
Potentiometer |
Digikey |
987-1714-ND |
Digital Encoder |
Digikey |
PEC11R-4220K-S0024-ND |
Micro USB Cable |
Digikey |
AE11229-ND |
Pico Debugger |
Adafruit |
5699 |
4x4 Keypad |
Adafruit |
3844 |
Speaker |
Adafruit |
1314 |
Amplifier |
Adafruit |
3006 |
Note
|
you will need to solder wires to the speaker. You can use a different speaker if you like, but it must be 3W, 4 ohm. |
-
-
NOTE: for the windows installer, select the "add to path" option
-
-
Some sort of programming environment. If you are unsure, refer to Setting up VS Code for Zig and Embedded Development
Your laptop will fit under one of these platform strings:
-
x86_64-linux
-
x86_64-macos
-
x86_64-windows
-
aarch64-linux
-
aarch64-macos
Open a command prompt/terminal run the command ./tools/zigup/<platform>/zigup master
, on windows it will be zigup.exe
. This will install the zig compiler on your machine.
If this does not work for you for some reason, you can download zig from here. We are using the master build for this workshop.
At the time of writing, I’ve not been able to get the current release of OpenOCD (0.12.0) working correctly on MacOS, this was sourced using brew
. Instead I have found success with Raspberry Pi’s fork of OpenOCD.
If you run windows
or macos
I’ve committed binaries to this repository since they’re easy to package. If you run linux
though you’ll have to build it on your own, and then add it to your PATH
:
git clone https://github.com/raspberrypi/openocd
cd openocd
./bootstrap
./configure --enable-picoprobe --prefix ~/.local # change the prefix/install location as you like
make -j4 install
Extensions to Install:
-
-
When you open up a zig file, this extension will ask if you’d like to enable ZLS, I suggest you do.
-
git clone --recursive https://github.com/ZigEmbeddedGroup/sycl-workshop-2023.git
cd sycl-workshop-2023
-
Compile the demos by running
zig build
in your project root. -
To activate the uf2 bootloader, power must be applied to the pico while the
BOOTSEL
button is held. This is best done by connecting a button fromRUN
to ground, pressing both buttons, and releasing theRUN
button first, thenBOOTSEL
. The other option is to plug/unplug the USB cable which is awkward and gets tiresome. -
Copy the uf2 file into the mounted drive. Execution should take place immediately
-
Run
zig build openocd
in a terminal, it will invoke the correct flags for you. You need to restart this command if you unplug the debugger, otherwise just keep it running in the background. -
In a separate terminal, compile the demos with
zig build
. -
Run:
-
arm-none-eabi-gdb <path to the executable>
-
> load
-
> run
and confirm
-
CTRL-C will interrupt operation if you need to set breakpoints. There is a .gdbinit
file in this project that tells GDB to initially connect to localhost:3333