Combining FPGA and ESP32 - Spartan FPGA Edge Acceleration Development Board Review
更新時間: 2021-11-12 10:59:59
The ecology of open source hardware Arduino is getting richer and richer, Arduino development boards based on various microcontrollers can no longer meet the development desire of the majority of open source hardware enthusiasts, Arduino official launched the FPGA-based Arduino development board - Arduino MKR Vidor 4000, some time ago, Seeed Studio also launched the Spartan Edge accelerated Arduino Shield, compared with the official Arduino MKR Vidor 4000, the Spartan Edge gas pedal board has similar performance, while the price is less than half! The Spartan Edge accelerator board uses Xilinx's low-cost and cost-effective Spartan 7 XC7S15 FPGA as the main controller, which can be used both as an Arduino expansion board for hardware acceleration and as a separate FPGA development board. In addition, an ESP32 is integrated on the board, which supports 2.4GHz WiFi and Bluetooth 4.1 protocol.
Such an amazing crossover product, let's explore the following.
The Spartan Edge gas pedal board meets the size specifications of Arduino UNO Shield and is built around the Xilinx Spartan-7 XC7S15 FPGA with 12.8K logic cells, 360Kb Block RAM, running at 100Mhz and flexible IOs that can be configured for PWM, SPI, I2C, UART and other peripherals. UART and other peripherals.
The development board has rich peripherals and interfaces, with powerful playability. For example, 8-bit ADC, 6-axis accelerometer, 2 RGB LEDs, MINI HDMI interface, CSI camera interface, two Grove interfaces, etc. It supports 802.11 b / g / n 2.4GHz WiFi and Bluetooth 4.1 with BLE.
FPGA chip - Spartan-7 XC7S15
Logic Cells - 12,800
Slices - 2,000
CLB registers - 16,000
Maximum distributed RAM (Kb): 150
Block RAM/FIFO w/ ECC (36Kb each): 10
Total blocks of RAM: 360Kb
Clock Management (1MMCM+1PLL): 2
DSP Slices: 20
Wireless Chip - Espressif ESP32-D0WDQ6
WiFi - 802.11 b/g/n 2.4GHz
Bluetooth - Bluetooth 4.1 with BLE
Video: Mini HDMI x1
Camera: CSI/MIPI interface x1 (compatible with Raspberry Pi Camera V1 - OV5640)
SD card: Micro SD/TF card slot x1
FPGA GPIO: 10 pins header (IO9~IO0)
Arduino GPIO: 32 pins header (Arduino form factor)
Connection with Grove peripherals: Grove Connector x2 (I2C/D2)
2 monochrome LEDs
2 x 3-color RGB LEDs
1 FPGA Reset
2 user buttons
1 Power Mode Switch
1 x 5-channel DIP switch
Operating voltage: 5V
IO voltage: 5V
Power supply method
USB Type C 5V
Arduino Micro USB 5V
8-bit ADC1173 15MSPS ADC
Accelerometer and gyroscope: 6-axis LSM6DS3TR
The Spartan Edge accelerator board has two modes of operation, Arduino Shield mode and FPGA standalone mode.
It doesn't matter if the developer knows nothing about FPGA theory, there is a complete official Arduino FPGA API that helps developers use FPGA resources to control the Arduino IDE's FPGA I/O, providing Arduino with once unimaginable features such as edge technology, image recognition, signal sampling and processing, etc.
Arduino Shield Mode
The Spartan Edge accelerator board is used as an expansion board for Arduino in conjunction with the Arduino IDE or Seeeduino V4.2. The FPGA configuration Bitstream is imported from the SD card into the FPGA via the ESP32 on the board.
(1) Install the board support package of ESP32 in Arduino
Select File-Preferences-Additional Boards Manager URLs in ArduinoIDE, add the third-party board download link https://dl.espressif.com/dl/package_esp32_index.json, through the board Manager to add ESP32 platform, after installation, select tool->board->DOIT ESP32 DEVKIT.
(2) Download ESP32 Boot Library
Seeed officially provides the download of ESP32 boot library
01LoadDefaultBitstream, the function of this example is to import the /overlay/default.bit file from the SD card to the FPGA.
02LoadConfigBitstream This example will read an ini format file /board_config.ini from the SD card and write the key value of overlay_on_boot in the bitstream to the FPGA.
(3) Preparing the SD card
Format the SD card to FAT32 format.
Create a new folder named overlay in the SD card.
Put the bitstream file into the overlay folder.
(4) Run the example
If you want to run the first example 01LoadDefaultBitstream, rename the bitstream file in the overlay folder to default.bit.
If you want to run the second example 02LoadConfigBitstream, put the board_config.ini into the root directory of the SD card. Insert the SD card into the Spartan Edge accelerator board
(5) Using the IO example
The official IO example of Spartan Edge accelerator board is provided to control the GPIO/ADC/DAC/RGB-LED on the board.
First you need to download Spartan Edge IO Example Library and install the library into Arduino IDE.
(6) Download and run
Use USB Type-C cable to connect the board and PC, press and hold the 'BOOT' key on the board for more than 1s to enter Bootloader mode, click 'Upload' to download the program to ESP32. make sure DIP switch K5 is ON, press and hold 'RST' to reset the board, then the FPGA is ready to run.
FPGA Standalone Mode
The Spartan Edge accelerator board can be used as a normal FPGA board, which requires the use of Xilinx FPGA development software Vivado.
The tutorial on the use of Vivado will not be overly described here.
The Spartan Edge gas pedal board combines Arduino and FPGA together, providing developers with more interesting ways to play with Arduino, which is simple and easy to get started, but also has the advantages of FPGA flexibility and parallel acceleration.