- Make sure you have a
riscv-none-elf-gcc
toolchain installed and added to PATH. - Build the example with CMake:
For other chip, please use the
cd examples/hello_world mkdir build cmake -B build -D target=esp32c3 -G Ninja . cmake --build build
target=chip_name
, wherechip_name
can be any from the supported ones. You should get the following output at the end:The following files will be generated:[2/3] Generating hello_world.bin copy from `hello_world' [elf32-littleriscv] to `hello_world.bin' [binary] [3/3] Running utility command for hello_world-size text data bss dec hex filename 5202 132 196 5530 159a hello_world
hello_world
— ELF output filehello_world.bin
— binary file for flashing into the chiphello_world.map
— linker map file
- Flash the example using esptool:
(Adjust the serial port name as needed.)
esptool.py --port /dev/ttyUSB0 --baud 921600 write_flash 0x0000 build/hello_world.bin
- See the serial output, for example using
miniterm.py
(assumingpyserial
is installed):You should see the following output:pyserial-miniterm /dev/ttyUSB0 115200
The output will keep repeating with reset reasons such asESP-ROM:esp32c3-api1-20210207 Build:Feb 7 2021 rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT) Hello, world!
TG0WDT_SYS_RST
,RTCWDT_RTC_RST
— this is because this example doesn't disable or feed the hardware watchdog timers.
hello_world
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||