Welcome to the ESP32-S3 project! This repository contains code and configuration for building applications on the ESP32-S3 using the ESP-IDF framework.
Before you begin, make sure you have the following installed:
- ESP-IDF Framework 🛠️
- CMake 💻
- Git 🔄
First, clone this repository to your local machine:
git clone https://github.com/bilalaniq/esp32-proj.git
cd esp32s3-projectSet up the ESP-IDF environment:
git clone --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
./install.sh # For Linux/macOS
install.bat # For Windows
source export.sh # For Linux/macOS
export.bat # For WindowsTo configure your project you need to use ESP-IDF TERMINAL
because powershel is unable to do
before configuring you also need to set the target by default it is esp32 so do accordingly but for me it is esp32s3
idf.py set-target esp32s3confirm the target again because mostlly it is not set properly
echo $env:IDF_TARGETif the target is still esp32
$env:IDF_TARGET = "esp32s3"Use menuconfig to configure your project settings:
idf.py menuconfigMake sure to configure the appropriate options for your ESP32-S3 or any other ESP.
Once you're ready, build the project:
idf.py buildConnect your ESP32-S3 to your PC via USB and flash the firmware:
idf.py -p COMx flash # Replace with your COM portTo monitor the output of the ESP32-S3:
idf.py -p COMx monitorHere’s an overview of the project structure:
/project
/main # Contains the main application code
CMakeLists.txt
main.c # Main application file
inc
main.h # Header file for the main application
/components # Custom components (if any)
CMakeLists.txt # CMake configuration for the project
sdkconfig #file created after configrasion
README.md # This file
if you are working in windows add the esp-idf path in the envoirement variable and name it as IDF_PATH
To work in vscode you also need to edit the .vscode
{
"configurations": [
{
"name": "ESP-IDF",
"compilerPath": "${config:idf.toolsPathWin}\\tools\\xtensa-esp-elf\\esp-14.2.0_20241119\\xtensa-esp-elf\\bin\\xtensa-esp32-elf-gcc.exe",
"compileCommands": "${config:idf.buildPath}/compile_commands.json",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
],
"version": 4
}
{
"version": "0.2.0",
"configurations": [
{
"type": "gdbtarget",
"request": "attach",
"name": "Eclipse CDT GDB Adapter"
},
{
"type": "espidf",
"name": "Launch",
"request": "launch"
}
]
}{
"C_Cpp.intelliSenseEngine": "default",
"idf.espIdfPathWin": "c:\\esp\\esp-idf\\v5.4\\esp-idf", //path to your esp-idf
"idf.openOcdConfigs": [
"board/esp32-wrover-kit-3.3v.cfg"
],
"idf.portWin": "COM3",
"idf.toolsPathWin": "c:\\esp\\esp-tools" //path to you esp tools
}- This is the primary CMake configuration file for your project. It includes general project configuration, such as setting the project name, specifying the build options, and including additional CMake modules or libraries if necessary.
- This file is responsible for managing the overall build process and can also contain settings for the ESP-IDF framework itself
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
#Including project.cmake essentially sets up your project to follow the ESP-IDF's build system conventions.
project(project_name)
- Each component of the ESP-IDF (like libraries or application-specific code) has its own CMake file. These files are used to define how individual components should be compiled and linked together.
- If you're adding custom components or working with a library, each component will have its own CMakeLists.txt to specify how that component should be built and linked.
idf_component_register(SRCS "main.c"
INCLUDE_DIRS "inc"
REQUIRES freertos esp_common)
#The build system will ensure that the required components (freertos and esp_common) are correctly included and linked when building this component.
#If your component requires any other components (e.g., for hardware-specific functionality), you can list them here as well.
- ESP32-S3 support: Leverage the powerful features of the ESP32-S3, including advanced peripherals and increased processing power.
- FreeRTOS: The project is built using FreeRTOS for multitasking and real-time application support.
- ESP-IDF framework: Using the robust ESP-IDF environment for reliable and scalable firmware development.
You can easily customize this project to fit your needs by:
- Modifying the configuration in
menuconfig - Adding your own components to the
/componentsdirectory - Editing the
main.candmain.hfiles to implement your custom application logic
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to adjust the repository name, add any relevant links, and modify project features to match your specific project. Let me know if you'd like any more additions!