From ea2ac3d6d651ab58aec2fb320f0d015bdd4826d9 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sat, 20 Nov 2021 13:08:59 -0700 Subject: First commit. Very basic, "Hello, World" infrastructure. For the most part, I did not copy this from an existing example, rather, took inspiration from an existing example. I want to avoid cargo-culting as much as possible. --- CMakeLists.txt | 6 ++++++ README.md | 29 +++++++++++++++++++++++++++++ main/CMakeLists.txt | 2 ++ main/main.c | 10 ++++++++++ 4 files changed, 47 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 README.md create mode 100644 main/CMakeLists.txt create mode 100644 main/main.c diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9029fdc --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +# 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.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(ws2812b) diff --git a/README.md b/README.md new file mode 100644 index 0000000..28f9dfc --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# Hacking on an Espressif ESP32. + +The goal of this project is to get some workable Christmas lights using a spool +of ws2812b LED strip lights. I've done this before, bare metal, on an stm32 +(see git.josher.dev:stm32.git). I expect this to be not _too_ difficult +considering I have done it before on bare metal. + +A stretch goal is to make these controllable over the network, and since the +esp32 comes with wireless already on the board, this should not be too +difficult. + +Unfortunately, I am not a huge fan of the Espressif idf infrastructure. It seems +_very_ bloated. Plus it uses CMake, which I don't have anything against, I just +don't know it very well. Hopefully I'll learn it better! + +# Building and Flashing + +To build, first you have to install the esp32-idf (ugh, I know right, bunch of +bloat. Maybe sometime soon I'll start bare-metal hacking on it.) + +Once you've followed the instructions there, it's time to build. + +```bash +idf.py build +``` + +```bash +idf.py -p /dev/ttyUSB0 flash +``` diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt new file mode 100644 index 0000000..cd28b28 --- /dev/null +++ b/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "main.c" + INCLUDE_DIRS "") diff --git a/main/main.c b/main/main.c new file mode 100644 index 0000000..9c53c3f --- /dev/null +++ b/main/main.c @@ -0,0 +1,10 @@ +#include "sdkconfig.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_system.h" +#include "esp_spi_flash.h" + +void app_main(void) +{ + printf("Hello, World!\n"); +} -- cgit