BSP

ESP32-C3 BSP Released

Created at 2022-09-23 05:26:12

A BSP for ESP32-C3 is released.(link: https://github.com/RT-Thread/rt-thread/tree/master/bsp/ESP32_C3) The BSP is based on the master branch of ESP-IDF and currently supports GPIO and UART. The steps to install and compile the BSP is detailed below. These steps have only been validated on MacOS. The exact same steps should work on Linux. It's not tested on Windows yet.

  • Open a terminal and enter bsp/ESP32_C3 directory. Use Env tool to download ESP-IDF package.
pkgs --updage
  • Enter the directory ESP-IDF package and execute the install.sh script.(Exceute install.bat on Windows instead). The script installs ESP-IDF toolchain and should only be run once when the package is downloaded for the first time
cd packages/ESP-IDF-latest
./install.sh
# ./install.bat in Windows
  • Under the ESP-IDf package directory. Run the following command to set IDF_PATH and export environment variables for IDF tools. This command needs to be run every time the BSP is built in a new terminal.
cd packages/ESP-IDF-latest
. ./export.sh
#. ./export.bat in Windows

After running install.sh every time, the command for exporting environment variables will also be shown at the end of the prompt.

All done! You can now run:

  . ./export.sh
  • Return to the BSP directory and configure RT-Thread using scons --menuconfig. Every time after running scons --menuconfig, new CMakeLists.txt for IDF projects needs to be generated with scons --target=esp-idf. The new CMakeLists.txt is under bsp/ESP32_C3/main directory. None of the other SCons commands are usable.
  • Compile and flash
idf.py build
idf.py flash

After flashing the program you can see the LED blinking and can connect to the UART pins to use the msh shell.

The steps starting from installing ESP-IDF tools are the same as those in Espressif's official get started guide, which can be found at https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32c3/get-started/index.html

You are welcome to try out the BSP and feedback is appreciated. Feedback on these two questions is especially helpful.

  • Can the installation procedures succeed on Windows
  • If we support applying a patch to an existing local installation of ESP-IDF and building the BSP without installing ESP-IDF package with Env, is this better than the existing approach? You can install ESP-IDF with any method convenient for you. There will be a configuration option of whether to use RT-Thread OS. If the option is turned off, normal FreeRTOS IDF projects can be built as usual.
0 Answer

Create
Post