commit 9b2f64b766b469ea897c5cda695efe8af9b7f715 Author: Philippe LUC Date: Fri Feb 6 15:08:06 2026 +0100 init diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..6444cbe --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +source /home/pluc/esp/v5.5/esp-idf/export.sh +export PORT="/dev/serial/by-id/usb-Espressif_USB_JTAG_serial_*" + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9673e51 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,8 @@ +# 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.22) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +# "Trim" the build. Include the minimal set of components, main, and anything it depends on. +idf_build_set_property(MINIMAL_BUILD ON) +project(hello_world) diff --git a/README.md b/README.md new file mode 100644 index 0000000..62f1f7c --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ + +## Init + + idf.py set-target esp32c2 + +## Build and flash + + idf.py build + idf.py -p /dev/serial/by-id/usb-Espressif* flash \ No newline at end of file diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt new file mode 100644 index 0000000..e1cb586 --- /dev/null +++ b/main/CMakeLists.txt @@ -0,0 +1,3 @@ +idf_component_register(SRCS "hello_world_main.c" + PRIV_REQUIRES spi_flash esp_driver_gpio + INCLUDE_DIRS "") diff --git a/main/hello_world_main.c b/main/hello_world_main.c new file mode 100644 index 0000000..026ac41 --- /dev/null +++ b/main/hello_world_main.c @@ -0,0 +1,34 @@ + +#include +#include +#include "sdkconfig.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_chip_info.h" +#include "esp_flash.h" +#include "esp_system.h" +#include "driver/gpio.h" + +#define LED_GPIO 15 + +void app_main(void) +{ + + gpio_config_t io_conf = { + .pin_bit_mask = LED_GPIO, + .mode = GPIO_MODE_OUTPUT, + .pull_up_en = GPIO_PULLUP_DISABLE, + .pull_down_en = GPIO_PULLDOWN_DISABLE, + .intr_type = GPIO_INTR_DISABLE, // No interrupt for now + }; + + esp_err_t ret = gpio_config(&io_conf); + + while(1) { + printf("hello"); + vTaskDelay(1000 / portTICK_PERIOD_MS); + gpio_set_level(LED_GPIO, 1); + vTaskDelay(1000 / portTICK_PERIOD_MS); + gpio_set_level(LED_GPIO, 0); + } +} diff --git a/sdkconfig.defaults b/sdkconfig.defaults new file mode 100644 index 0000000..1dff619 --- /dev/null +++ b/sdkconfig.defaults @@ -0,0 +1 @@ +CONFIG_ESP_CONSOLE_USB_CDC=y