- on Microcontrollers
Hello World!Now it is time to test the installation by compiling an example program. First copy the example to your home directory so you can modify it without changing the original example:
Note the dot at the end of the second command, there is a space in front of it.
cd ~/esp cp -r $IDF_PATH/examples/get-started/hello_world .
Find the serial portConnect the ESP32-PICO-KIT and lookup the name of its serial port. On Windows this will be something like ‘COMx’ with ‘x’ a number. On Linux this is a name starting with ‘/dev/tty’, on Mac it starts with ‘/dev/cu.’. Here is detailed information for Windows, Linux and Mac.
Configure the projectThe next step is the configuration of the project to make it use the serial port connected to your board:
Select the ‘Serial flasher config’ option to set the default serial port. When done ‘Save’ the configuration and ‘Exit’ the configuration tool.
cd ~/esp/hello_world make menuconfig
Almost thereAll that remains to do is build the example and program it in the MCU:
The first time this will take a while as a lot of libraries have to be compiled first. The number of files required is amazing. If everything goes well, the last line before the prompt will read
Open the serial monitorThe example doesn’t do anything visible, but it does write data to the serial port. It can be visualized in the shell by the monitor, but it must be built first:
If you see this appear (after some compilation time and together with lines in green):
then everything is working fine and you are ready to continue ESP32 application development for the ESP32-PICO-KIT on your own.
Hello world! This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB embedded flash Restarting in 10 seconds...
EclipseWe did our first steps in a bash shell, typing in commands. If you’d like to use the Eclipse IDE instead of running make, check out the Eclipse guide.
ConclusionThe documentation provided by Espressif really is excellent. All the instructions and commands presented work as described. For those who work in less common environments or who want more control, or who simply want more detail, many pages with additional information are available. Hardware documentation is plentiful too.