Skip to content

ZigEmbeddedGroup/synth-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SYCL 2023 Embedded Zig Workshop

Introduction

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!

Parts Kit

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.

Prerequisites

Installing Zig

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.

OpenOCD

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

Setting up VS Code for Zig and Embedded Development

Extensions to Install:

  • Zig

    • When you open up a zig file, this extension will ask if you’d like to enable ZLS, I suggest you do.

  • Serial Monitor

Cloning

git clone --recursive https://github.com/ZigEmbeddedGroup/sycl-workshop-2023.git
cd sycl-workshop-2023

Building and running a demo using UF2

  1. Compile the demos by running zig build in your project root.

  2. 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 from RUN to ground, pressing both buttons, and releasing the RUN button first, then BOOTSEL. The other option is to plug/unplug the USB cable which is awkward and gets tiresome.

  3. Copy the uf2 file into the mounted drive. Execution should take place immediately

Building and running a demo using the Pico Probe

  1. 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.

  2. In a separate terminal, compile the demos with zig build.

  3. Run:

    1. arm-none-eabi-gdb <path to the executable>

    2. > load

    3. > 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published