From e7618a3cd882d24565045ea108e6526602f69589 Mon Sep 17 00:00:00 2001 From: Lubos Petrovic Date: Fri, 4 Dec 2020 13:59:38 +0100 Subject: [PATCH] update --- BoardM5stackCore.cpp | 4 +--- BoardM5stackCore.h | 7 +------ CarKiaEniro.cpp | 2 +- CarRenaultZoe.cpp | 2 +- INSTALLATION.md | 15 +++++++++++---- LiveData.h | 2 +- build.bat | 6 +++++- flash_linux.sh | 25 +++++++++++++++++++++++++ 8 files changed, 46 insertions(+), 17 deletions(-) create mode 100644 flash_linux.sh diff --git a/BoardM5stackCore.cpp b/BoardM5stackCore.cpp index 3119b00..d2f496a 100644 --- a/BoardM5stackCore.cpp +++ b/BoardM5stackCore.cpp @@ -26,9 +26,7 @@ void BoardM5stackCore::mainLoop() { Board320_240::mainLoop(); -/*#define TFCARD_CS_PIN 4 - - if (!SD.begin(TFCARD_CS_PIN, SPI, 40000000)) { +/* if (!SD.begin(TFCARD_CS_PIN, SPI, 27000000)) { Serial.println("Card Mount Failed"); return; } diff --git a/BoardM5stackCore.h b/BoardM5stackCore.h index 71e5b2f..7d4302d 100644 --- a/BoardM5stackCore.h +++ b/BoardM5stackCore.h @@ -5,7 +5,6 @@ #define USER_SETUP_LOADED 1 #define SPI_FREQUENCY 27000000 #define SPI_TOUCH_FREQUENCY 2500000 - #define USER_SETUP_LOADED 1 #define ILI9341_DRIVER #define M5STACK @@ -19,16 +18,12 @@ #define SPI_FREQUENCY 27000000 #define SPI_READ_FREQUENCY 5000000 #define SPEAKER_PIN 25 +#define TFCARD_CS_PIN 4 #define BUTTON_LEFT 37 #define BUTTON_MIDDLE 38 #define BUTTON_RIGHT 39 -#define SD_CS 4 -#define SD_MOSI 23 -#define SD_MISO 19 -#define SD_SCLK 18 - // #include "BoardInterface.h" #include "Board320_240.h" diff --git a/CarKiaEniro.cpp b/CarKiaEniro.cpp index feb59ba..91abc7c 100644 --- a/CarKiaEniro.cpp +++ b/CarKiaEniro.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include "LiveData.h" #include "CarKiaEniro.h" diff --git a/CarRenaultZoe.cpp b/CarRenaultZoe.cpp index e190091..3ed202c 100644 --- a/CarRenaultZoe.cpp +++ b/CarRenaultZoe.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include "LiveData.h" #include "CarRenaultZoe.h" diff --git a/INSTALLATION.md b/INSTALLATION.md index c58a6ee..4287989 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -12,16 +12,23 @@ https://docs.google.com/document/d/1nEezrtXY-8X6mQ1hiZVWDjBVse1sXQg1SlnizaRmJwU/ ## Installation from sources - install arduino IDE + ESP32 support -- https://github.com/Bodmer/TFT_eSPI - display library -- Configure TFT eSPI - W:\Documents\Arduino\libraries\TFT_eSP\User_Setup_Select.h + +Required libraries + +- ArduinoJson +- TFT_eSPI +- ESP32_AnalogWrite +- esp32-micro-sdcard + +Configure TFT eSPI + +W:\Documents\Arduino\libraries\TFT_eSP\User_Setup_Select.h ``` // Comment //#include // Default setup is root library folder // And uncomment #include // Setup file for ESP32 and TTGO T4 version 1.3 ``` - My configuration - Board ESP32 Dev module - Upload speed 921600 diff --git a/LiveData.h b/LiveData.h index 5bb8691..89e0c6c 100644 --- a/LiveData.h +++ b/LiveData.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include "config.h" diff --git a/build.bat b/build.bat index 79b683a..4196fa7 100644 --- a/build.bat +++ b/build.bat @@ -1,7 +1,7 @@ rem slow GUI performance via arduino-cli yet -arduino-cli compile -v -b esp32:esp32:esp32wrover --build-properties build.extra_flags=-BOARD_TTGO_T4=1 -v evDash.ino +rem arduino-cli compile -v -b esp32:esp32:esp32wrover --build-properties build.extra_flags=-BOARD_TTGO_T4=1 -v evDash.ino rem arduino-cli compile -v -b esp32:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app,CPUFreq=80 --build-properties build.extra_flags=-BOARD_TTGO_T4=1 -v evDash.ino rem rduino-cli upload -b esp32:esp32:esp32 -v -p COM6 @@ -11,4 +11,8 @@ rem arduino-cli upload -v -b esp32:esp32:m5stack-core-esp32 -p COM9 rem arduino-cli compile -v -b esp32:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app,CPUFreq=80 --build-properties build.extra_flags=-BOARD_M5STACK=1 -v evDash.ino rem arduino-cli upload -b esp32:esp32:esp32 -v -p COM9 +arduino-cli compile -v -b esp32:esp32:esp32wrover -v evDash.ino +arduino-cli upload -b esp32:esp32:esp32wrover -v -p COM8 + + pause \ No newline at end of file diff --git a/flash_linux.sh b/flash_linux.sh new file mode 100644 index 0000000..3ad5052 --- /dev/null +++ b/flash_linux.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Setup +# 1. Ensure you have Python 2.7 or 3.4+ installed +# 2. `pip install esptool` +# 3. `sudo usermod -a -G dialout ` // log out and log in is required + +# Select distribution: +# TTGO T4 +DIST=./dist/ttgo_t4_v13 + +# or m5stack +DIST=./dist/m5stack_core1 + +# Set USB port +PORT=/dev/ttyUSB0 + +esptool.py -p $PORT -b 921600 write_flash \ + --flash_mode dio \ + --flash_size detect \ + --flash_freq 80m \ + 0xe000 $DIST/boot_app0.bin \ + 0x1000 $DIST/bootloader_qio_80m.bin \ + 0x10000 $DIST/evDash.ino.bin \ + 0x8000 $DIST/evDash.ino.partitions.bin