Getting Started¶
This guide shows you how to blink the LEDs connected to the FPGA and MCU on a Shrike board.
You can program the microcontroller on Shrike using three methods:
1. Arduino (C/C++)
2. MicroPython
3. CircuitPython
All are beginner-friendly, and you can switch between them anytime.
Let’s follow the steps and get Shrike up and running!
Shrike with Arduino IDE
If you already know Arduino and love working with the Arduino IDE, you can continue using it with Shrike. You do not have to switch to MicroPython unless you want to.
Download the Arduino IDE. On Ubuntu, you can also install it with:
sudo apt install arduino
Step 1. Adding the board support for Shrike
Install board support for the host microcontroller on your Shrike variant.
Open File → Preferences and add the URL for your board under Additional Boards Manager URLs.
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
If another URL is already listed, separate the URLs with a comma.
For details about the RP2040/RP2350 board package, see Earle Philhower’s Arduino-Pico repository.
After adding the URL go to Tools->Boards->Board Manager in the Arduino IDE.
Search for esp32 and install the package by Espressif Systems.
As we discussed earlier, in Shrike the micro-controller (RP/ESP32) is responsible for configuring the FPGA.
To make this possible, we developed a simple mechanism: we store the FPGA bit-streams in the MCU’s flash memory and retrieve them whenever we need to configure the FPGA. To do this we will need to use a file system called LittleFS.
Step 2. Adding the LittleFS Tool
The LittleFS library in Arduino allows you to store, load, and update the bitstream in the flash memory through the microcontroller.
Download the latest ZIP from the LittleFS uploader releases.
Follow the Arduino IDE 2.x installation guide to install the uploader.
The guide also applies to RP2040 boards.
Restart the Arduino IDE to load the tool.
For more details on the LittleFS tool checkout this repository.
Step 3. Installing the Shrike Library
The Arduino library developed by Vicharak takes care of configuring the FPGA for you. You can install it directly from the Arduino IDE’s Library Manager, just search for “Shrike” and install the Shrike library.
Step 4. Programming the FPGA from Arduino IDE
The first bitstream blinks the FPGA LED.
Open Shrike → shrike_flash from the Arduino IDE examples and save a copy. Inside the new sketch folder, create a subfolder named data (lowercase).
Save the LED blink bitstream in the data subfolder.
To build your own design, follow Generating Your First Bitstream.
Compile the sketch in the Arduino IDE.
For the first Arduino upload, or after programming the board with another tool, hold the boot button while connecting the board to your computer.
Under Tools, select VICHARAK Shrike Lite or VICHARAK Shrike, as appropriate. Set flash size to 4 MB (2 MB sketch, 2 MB filesystem) and CPU speed to 125 MHz.
Under Tools, select Generic ESP32-S3 and set flash size to 8 MB (4 MB sketch, 4 MB filesystem).
Press Ctrl+Shift+P to open the command palette.
Search for Build LittleFS command and run it.
After that in the same menu look for Upload LittleFS command and run that too.
Once both commands finish, upload the sketch.
The blue FPGA LED should blink.
Thanks to Earle Philhower for the RP2040/RP2350 board support and the LittleFS uploader.
Shrike with MicroPython
The custom Shrike MicroPython firmware includes the shrike.py library for configuring the FPGA.
1. Uploading the Shrike firmware
Download the binary corresponding to your board version from Shrike releases
Hold the boot button on the board and connect it to your computer. The board appears as a storage device.
Drag the downloaded UF2 file onto that device.
The device disconnects when the transfer finishes.
This video demonstrates a UF2 upload on a similar board.
Shrike Mass Storage Device
After restarting, the board appears as both a storage device and a serial device. Save bitstreams on the storage device.
The default volume ID is 5221-0000.
To rename the volume in Windows, right-click it and select Rename. On Linux, see Renaming a FAT16 volume.
Download the binary corresponding to your board version from Shrike releases.
Install esptool with
pip install esptool. If needed, create and activate a Python virtual environment first.Erase the flash with
python -m esptool erase_flash.Write the downloaded firmware to the ESP32-S3:
python -m esptool --chip esp32s3 -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 4MB --flash_freq 80m 0x0 firmware.bin
2. Get the LED blink bitstream
Download led_blink.bin for your board revision from the test bitstreams.
3. Install Thonny
This guide uses Thonny. To work from a terminal, follow the Shrike CLI Guide.
Download and install Thonny.
Open Thonny and connect the board without holding the boot button.
Select the board in the bottom right of the Thonny window.
Open the Files view to see the board’s filesystem.
4. Flashing the bitstream
In Thonny’s Files pane, locate led_blink.bin on your computer.
Right-click the file and upload it to the board.
To configure the FPGA, pass the uploaded filename to this function:
shrike.flash("<your_bitstream_name>.bin")
Note
For a custom project, use FPGA_bitstream_MCU.bin from the build’s bitstream folder. You can rename the file after copying it.
In Thonny, create a new Python file with the following contents:
import shrike
shrike.flash("led_blink.bin")
Save the file to your board and run it. To run it automatically at startup, name it main.py.
Shrike with CircuitPython
Adafruit’s CircuitPython is based on MicroPython and runs on microcontroller boards.
Shrike’s custom CircuitPython build includes a library for configuring the FPGA.
1. Uploading the Shrike binary
Download the binary corresponding to your board version from Shrike releases.
Hold the boot button on the board and connect it to your computer. The board appears as a storage device.
Drag the downloaded UF2 file onto that device.
The device disconnects when the transfer finishes.
This video demonstrates a UF2 upload on a similar board.
2. Get the LED blink bitstream
Download led_blink.bin for your board revision from the test bitstreams.
Copy the downloaded bitstream to the board’s storage volume.
3. Install Thonny
Download and install Thonny.
Open Thonny, connect the board without holding the boot button, and select it in the bottom right of the window.
4. Flashing the bitstream
The Shrike library can configure and reset the FPGA.
To configure the FPGA, pass the bitstream filename to this function:
shrike.flash("<your_bitstream_name>.bin")
The test bitstream is named led_blink.bin.
Note
For a custom project, use FPGA_bitstream_MCU.bin from the build’s bitstream folder. You can rename the file after copying it.
In Thonny, create a new Python file with the following contents:
import shrike
shrike.flash("led_blink.bin")
Save the file to your board and run it. To run it automatically at startup, name it main.py.