First you need to install the risc-v toolchain:
$ cd /tmp
$ wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14.tar.gz
$ 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 https://github.com/protobits/incubator-nuttx nuttx $ git clone https://github.com/protobits/incubator-nuttx-apps apps Configure the board:
$ cd nuttx $ ./tools/configure.sh esp32c3-devkit:nsh
Compile:
$ make
Convert the NuttX ELF file:
$ esptool.py --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 esptool.py --chip esp32-c3 --port /dev/ttyUSB0 --baud 921600 write_flash 0x10000 nuttx.bin