Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zigembeddedgroup/synth-workshop
https://github.com/zigembeddedgroup/synth-workshop
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zigembeddedgroup/synth-workshop
- Owner: ZigEmbeddedGroup
- Created: 2023-04-16T19:53:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-21T05:47:00.000Z (over 1 year ago)
- Last Synced: 2024-04-28T04:53:50.917Z (8 months ago)
- Language: Zig
- Size: 17.1 MB
- Stars: 12
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= SYCL 2023 Embedded Zig Workshop
:toc:== 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
[cols="1,1,1"]
|===
| 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
* https://git-scm.com/downloads[Git]
* https://developer.arm.com/downloads/-/gnu-rm[Arm GNU Toolchain (for GDB)]
** NOTE: for the windows installer, select the "add to path" option
* Some sort of programming environment. If you are unsure, refer to <>=== Installing Zig
Your laptop will fit under one of these platform strings:
* x86_64-linux
* x86_64-macos
* x86_64-windows
* aarch64-linux
* aarch64-macosOpen a command prompt/terminal run the command `./tools/zigup//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 https://ziglang.org/download/[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 https://github.com/raspberrypi/openocd[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`:
[source]
----
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:
* https://marketplace.visualstudio.com/items?itemName=ziglang.vscode-zig[Zig]
** When you open up a zig file, this extension will ask if you'd like to enable ZLS, I suggest you do.
* https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-serial-monitor[Serial Monitor]== Cloning
[source]
----
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:
a. `arm-none-eabi-gdb `
b. `> load`
c. `> run` and confirmCTRL-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`