Compiling NuttX to ESP32-C3

First you need to install the risc-v toolchain:

$ cd /tmp
$ wget
$ tar xvf riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14.tar.gz
$ cd riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14
$ sudo cp -a * /usr/local/

Clone the nuttx and apps repositories:

$ mkdir ~/nuttxspace
$ cd ~/nuttxspace
$ git clone nuttx
$ git clone apps

Configure the board:
$ cd nuttx
$ ./tools/ esp32c3-devkit:nsh


$ make

Convert the NuttX ELF file:

$ --chip esp32-c3 elf2image --flash_mode dio --flash_size 2MB -o ./nuttx.bin nuttx

Put the board in bootloader mode (press and hold Boot button and click on RST button, release Boot button)
Flash it:

$ sudo --chip esp32-c3 --port /dev/ttyUSB0 --baud 921600 write_flash 0x10000 nuttx.bin

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s