Our ESP32 has several memory types (details can be found in this link and with more details in the Technical Reference Manuel (Chapter 1)
Send the modified source code (only the file main.c) to the instructor before the start of next session (just one file per group). You can find which function you could use for the reset in the official ESP-IDF documentation. Modify the Hello World project so that it prints 10 messages, then it waits for 5 seconds and finally restarts the system. Once done, you should see the message *Hello World" in your screen once every second.Ĭongrats! You have uploaded your first ESP32 project! You can select PlatformIO: Monitor from the Project Tasks or click the plug button in the bottom pane:
You can use the PlatformIO: Upload task from Project Tasks or click in the corresponding button of the bottom pane:įinally, you can open a serial connection from your computer to the device to monitor the progress.
Once you are done physically connecting the devices, you can proceed with the uploading. If you are using a virtual machine, you will need to claim the device from the virtual machine, as the host will very likely keep the device by default. Then, connect the microUSB wire to the corresponding ESP-Prog port and plug the USB end of the wire to your computes USB port. Once we have our application built (note that our source code is linked with the whole ESP-IDF environment, including FreeRTOS), we are ready to upload it to our ESP32 device (this operation is commonly known as flash because we will be writing the binary file in flash memory).įirst, plug the ESP32 MeshKit to the ESP-Prog board with the provided connection. If you reach this step, please contact the instructor in the chat to let him/her know. If the building process works ok (it may take a few minutes the first time) you should see a message similar to: You could also press the Build button ( check button in the bottom pane). To do so, you can display the Project Tasks ( View->Command Palette) and execute PlatformIO: Build. Once you have written the source code, you can proceed to build the project. Write the following code in main.c file: #include
We are going to write a very simple Hello World application. The new project will automatically create a src folder, including a default main.c file with the following content: void app_main() If you are not using it, make sure you write the correct port name. Note that the upload_port specified above is the one used by default in the Virtual Machine provided. We are going to include two more below those three:
Project configurationīefore proceeding with the application coding, you should configure the project so the framework knows where to find the device and how to communicate with it.