Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Set Up

Now it's time to connect the host computer to the development board.

  1. Plug one end of the USB to the computer's USB port.
  2. Plug the other end to the board's esp32c6-tagged USB port (or you may see a USB tag.)
esp32-c6 usb port connected to usb port in laptop.

Board-Laptop USB-link (white cable).

Note

The extra USB port is UART or ch343-tagged. It is used to communicate with the UART peripheral within the MCU. Both ports can be used for flashing and powering, but only esp32c6 can be used for debugging.

Check connection

To ensure our OS can detect the board, list the devices with one of these approaches:

  • With ls

    ls /dev/tty*usb* # MacOS
    
    ls /dev/ttyACM*  # Linux
    
  • With lsusb

    lsusb | grep JTAG
    # Bus (...) USB JTAG/serial debug unit (...)
    

Install Software

Now that the board is seen by our OS, let's install all needed software.

Rust Tools

  1. Install the Rust toolchain following the steps in https://rustup.rs/

    • The Rust Toolchain is rustup plus many components cargo, rustc, the compiled std component and so on.
  2. Add the compiled std-component for our target processor

    rustup target add riscv32imac-unknown-none-elf
    
  3. Add development components:

    rustup component add rust-analyzer rust-src
    

    rust-src is the std-component's source code, used by rust-analyzer.

Espressif tools

espflash is used for flashing our ELF binary (our program) into the board.

Install espflash with: cargo install espflash

Build dependencies

rustc has compilation backends which do part of the compilation of our code. llvm is one such possible backend (the most common one.)

  • Debian/Ubuntu.

    sudo apt install llvm-dev libclang-dev clang
    
  • MacOS. When using the Homebrew package manager, which we recommend:

    brew install llvm
    

Suggested reading

Additional Software

  • It's recommended to install Rust Analyzer, following their guide.