Skip to main content Skip to local navigation

Exploring RISC-V: Espressif IDE on macOS & ESP32-C3

While we expect our students to use the Espressif IDE software in the Lassonde labs, on computers provided by the School, they should also feel enabled to install the software on their own machines. The following is a description of what I did to get it to work on my macOS machine.

Note that once you have the Espressif IDE working you can make C + Assembler projects, as I have described here:

Getting Espressif IDE to work on my Mac.

I downloaded the Espressif IDE from https://docs.espressif.com/projects/espressif-ide/en/latest/downloads.html.

After the download I was asked to replace an existing installation that I had on my machine, to which I agreed. Then, the installer asked me to install "Espressif IDF" (an "F" rather than an "E"). Not clear what that is, but it failed.

Why? Because I was missing pre-reqs. That required me to run a terminal command using the HomeBrew installer:

brew install dfu-util

homebrew install from terminal
homebrew install from terminal

No problem, as I already use HomeBrew.

Then The IDF installation manager asked me to continue... so I let it... and now it's taking a long time...

Espressif IDF installer... taking its time...
Espressif IDF installer… taking its time…

Ten minutes later on my M3 Pro, and it's just about done. This is so long that I've started this blog post...

Once that's done it prompted me to "Go to Dashboard", which I clicked on.

Installer is ready to go to the dashboard.
"Next Steps:

Open a new IDF terminal using the icon on version manager screen or by sourcing activation script in any open terminal.
The activation script can be found in `~/.espressif/tools/` folder
Run 'source ~/.espressif/tools/activate_idf_v5.5.3.sh' to activate the IDF environment
Run 'idf.py build' to build your project""
Installer is ready to go to the dashboard.

Now it says that the IDF is located at


/Users/USERNAME/.espressif/v5.5.3/esp-idf

Okay.

Now, when I open the IDE, I get this message about the IDF:

to which I said yes.

Sanity Check

I don't find the Espressif IDE easy to use, compared to other IDEs. It's finnicky and requires some TLC to get going. So when trying to determine if there is a problem with my board (or if it's the IDE), I keep a copy of the Arduino IDE with ESP32 tools installed handy. You can follow the instructions for installation of the ESP32 Tools for Arduino.

When things go wrong, I drop into the Arduino IDE and do a quick test. Run the "BlinkRGB" demo program:

Here it flashes the main LED. So, yes, I know that my computer can connect and program the board.

flashing LED on the board
flashing LED on the ESP32-C3 board

So, again, this is not for creating lab code, but just for making sure that you have a working board and drivers are working on your computer. (That said, you _can_ create C++ and Assembler programs in the Arduino IDE)

Start a project

Select your build tools

If you don't select your build tools, nothing else will work. So, click

Select the Espressif -> IDF Manager
Select the Espressif -> IDF Manager. Then choose one of the compiler tool sets.

Create a project

So, in my previous post I said that I started a new simple project. How does that work here?

  1. File -> New Espressif IDF Project
Name your project, then select esp32c3 as the project target, then "create a project using one of the templates" then "hello_world"
Name your project, then select esp32c3 as the project target, then "create a project using one of the templates" then "hello_world".

The first time I did it, I got an error:

Problem screen.
Problem screen.

So I closed the IDE and started it again. After it reopened, I hit the Hammer icon and it built:

I then tried to Run the code but it couldn't find the serial port:

So I clicked okay and was presented with this window:

which shows me that it's actually connected via a CP2102 USB chip. (If you don't have a driver yet, go get it here using the instructions found on the blog page)

I then hit the green "run" triangle icon and it compiled again and downloaded:

and once it was done downloading I get a "hello world" screen that did this over and over:

Animation of a "hello world" program in the espressif IDE.
Animation of a "hello world" program in the espressif IDE.

Conclusion

We can use the Espressif IDE to download code on to the ESP32-C3 board. This can be done using the lab computers or it can be done using your own personal computer.