Introduction: HiFive1 Arduino Board With ESP-01 WiFi Module Tutorial

The HiFive1 is the first Arduino-compatible RISC-V based board built with FE310 CPU from SiFive. The board is about 20 times faster than Arduino UNO yet like the UNO board, it lacks any wireless connectivity.

Fortunately, there are several inexpensive modules on the market to mitigate this limitation. This tutorial explains how to enable WiFi connectivity for the HiFive1 using an ESP-01.

For HiFive1 with ESP32 or ESP8266 modules see the WEB and MQTT tutorials.

For Hifive1 Bluetooth example, see this tutorial.

Materials needed for this project:

  • HiFive1 (Can be purchased here)
  • ESP-01
  • 2 * 10k resistors
  • 1k resistor
  • Breadboard
  • 9 jumper cables

Step 1: Setup the Environment

  1. Install the Arduino IDE if it is not installed on your computer.
  2. Follow the instructions in https://github.com/westerndigitalcorporation/CincoWinPkg to add HiFive1 support to Arduino IDE.

No need to install the ESP-01 board package in Arduino IDE since the ESP-01 comes preprogrammed with outdated (see the screenshot) but capable to respond to AT commands via a serial connection firmware.

Step 2: Connect ESP-01 Module to HiFive1 Board

Connect the ESP-01 module to the HiFive1 board as shown in the Fritzing Schematics and Breadboard views.

Make sure that IOREF jumper is set to 3.3V as shown in the picture by the red circle.

Step 3: Talking to ESP-01 Module Via Serial Monitor

After connecting everything together we can try to talk to the ESP-01 via Arduino Serial Monitor. For this, we need to program a simple sketch attached below. It's listening to the AT commands coming from the Monitor via HW Serial channel and forwards them to the ESP-01 via SoftwareSerial32 channel. It is listening to the ESP-01 replies from SoftwareSerial32 channel and is forwarding them to the Monitor via HW Serial channel.

  1. Before programming make sure that the "Tools->Board" is set to HiFive1 board, the "Tools->CPU Clock Frequency" to "256MHz PLL" and the "Tools->Programmer" to "SiFive OpenOCD".
  2. Upload the sketch into HiFive1.
  3. Make sure you selected correct Serial port in "Tools->Port".
  4. Open "Tools->Serial Monitor" and select 115200 baud rate and "Both NL & CR".
  5. Type AT in the Monitor. You should get OK from the ESP-01.
  6. Now you can try various AT commands from this link.

Step 4: Talk to ESP Module From Sketch

Now let's issue the AT commands to ESP-01 from within the HiFive1 sketch.

The attached sketch is continuously running the CWLAP+AT command which returns the available WiFi Access Points, their signal strength and their MAC Addresses. The loop is printing the results until either the ESP-01 returns OK as AT command terminator or a certain amount of time has passed since the last character was printed (The default is 2 seconds).

  1. Make sure that the "Tools->Board" is set to HiFive1 board, the "Tools->CPU Clock Frequency" to "256MHz PLL" and the "Tools->Programmer" to "SiFive OpenOCD".
  2. Upload the sketch into HiFive1.
  3. Make sure you selected correct Serial port in "Tools->Port".
  4. Open "Tools->Serial Monitor" and select 115200 baud rate and "Both NL & CR".

The CWLAP+AT command can be changed in the sketch to any AT Command. More commands can be found here.

Step 5: Final Result

If you correctly wired the circuit and uploaded the provided sketch you should get a printed list of the available Access Points in your area such as the one in the attached picture.