From a0776e8c4a7865469fb802b01dc158ac92b7c521 Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Sun, 16 Dec 2018 18:12:21 -0800 Subject: [PATCH] Initial commit --- .gitignore | 4 ++++ CMakeLists.txt | 6 ++++++ Dockerfile | 24 ++++++++++++++++++++++++ main/CMakeLists.txt | 4 ++++ main/Kconfig.projbuild | 26 ++++++++++++++++++++++++++ main/ugv_main.c | 40 ++++++++++++++++++++++++++++++++++++++++ uas-ugv.code-workspace | 23 +++++++++++++++++++++++ 7 files changed, 127 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 Dockerfile create mode 100644 main/CMakeLists.txt create mode 100644 main/Kconfig.projbuild create mode 100644 main/ugv_main.c create mode 100644 uas-ugv.code-workspace diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c0b1400 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/.vscode +/sdkconfig +/build +/cmake-build* \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5fee76d --- /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(uas-ugv) \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..53acfc0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM debian:stretch + +RUN apt-get update && apt-get install -yy \ +git \ +wget \ +make \ +libncurses-dev \ +flex \ +bison \ +gperf \ +python \ +python-serial + +RUN mkdir /esp +WORKDIR /esp + +RUN wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz \ +-O xtensa-esp32-elf.tar.gz +RUN tar --extract --verbose --file xtensa-esp32-elf.tar.gz && rm xtensa-esp32-elf.tar.gz + +RUN git clone --branch v3.1.1 --depth 1 --recursive https://github.com/espressif/esp-idf.git + +ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/esp/xtensa-esp32-elf/bin \ +IDF_PATH=/esp/esp-idf diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt new file mode 100644 index 0000000..b79b831 --- /dev/null +++ b/main/CMakeLists.txt @@ -0,0 +1,4 @@ +set(COMPONENT_SRCS "hello_world_main.c") +set(COMPONENT_ADD_INCLUDEDIRS "") + +register_component() \ No newline at end of file diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild new file mode 100644 index 0000000..2a278f4 --- /dev/null +++ b/main/Kconfig.projbuild @@ -0,0 +1,26 @@ +menu "Example Configuration" + +choice LCD_TYPE + prompt "LCD module type" + default LCD_TYPE_AUTO + help + The type of LCD on the evaluation board. + +config LCD_TYPE_AUTO + bool "Auto detect" +config LCD_TYPE_ST7789V + bool "ST7789V (WROVER Kit v2 or v3)" +config LCD_TYPE_ILI9341 + bool "ILI9341 (WROVER Kit v1 or DevKitJ v1)" +endchoice + +config LCD_OVERCLOCK + bool + prompt "Run LCD at higher clock speed than allowed" + default "n" + help + The ILI9341 and ST7789 specify that the maximum clock speed for the SPI interface is 10MHz. However, + in practice the driver chips work fine with a higher clock rate, and using that gives a better framerate. + Select this to try using the out-of-spec clock rate. + +endmenu diff --git a/main/ugv_main.c b/main/ugv_main.c new file mode 100644 index 0000000..c17eb1b --- /dev/null +++ b/main/ugv_main.c @@ -0,0 +1,40 @@ +/* Hello World Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_system.h" +#include "esp_spi_flash.h" + + +void app_main() +{ + printf("Hello world!\n"); + + /* Print chip information */ + esp_chip_info_t chip_info; + esp_chip_info(&chip_info); + printf("This is ESP32 chip with %d CPU cores, WiFi%s%s, ", + chip_info.cores, + (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "", + (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : ""); + + printf("silicon revision %d, ", chip_info.revision); + + printf("%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024), + (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); + + for (int i = 10; i >= 0; i--) { + printf("Restarting in %d seconds...\n", i); + vTaskDelay(1000 / portTICK_PERIOD_MS); + } + printf("Restarting now.\n"); + fflush(stdout); + esp_restart(); +} diff --git a/uas-ugv.code-workspace b/uas-ugv.code-workspace new file mode 100644 index 0000000..dc58952 --- /dev/null +++ b/uas-ugv.code-workspace @@ -0,0 +1,23 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": { + "cmake.preferredGenerators": [ + "Ninja", + "Unix Makefiles" + ], + "cmake.buildDirectory": "${workspaceRoot}/cmake-build", + "cmake.configureOnOpen": true + }, + "extensions": { + "recommendations": [ + "ms-vscode.cpptools", + "twxs.cmake", + "vector-of-bool.cmake-tools", + "peterjausovec.vscode-docker" + ] + } +} \ No newline at end of file