Skip to content

Commit cb43f9e

Browse files
Initial commit for V2.0.0
1 parent 583d6b6 commit cb43f9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+11790
-4289
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.pio
22
.vscode
3+
src/compile_time.h

boards/custom_esp-wrover-kit.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"_comment": "This is a custom board configuration for an ESP32 with 8MB Flash. - Jan 8, 2025.",
3+
"build": {
4+
"arduino":{
5+
"ldscript": "esp32_out.ld"
6+
},
7+
"core": "esp32",
8+
"extra_flags": "-DARDUINO_ESP32_DEV",
9+
"f_cpu": "240000000L",
10+
"f_flash": "40000000L",
11+
"flash_mode": "dio",
12+
"hwids": [
13+
[
14+
"0x0403",
15+
"0x6010"
16+
]
17+
],
18+
"mcu": "esp32",
19+
"variant": "esp32"
20+
},
21+
"connectivity": [
22+
"wifi",
23+
"bluetooth",
24+
"ethernet",
25+
"can"
26+
],
27+
"debug": {
28+
"default_tool": "ftdi",
29+
"onboard_tools": [
30+
"ftdi"
31+
],
32+
"openocd_board": "esp32-wrover.cfg"
33+
},
34+
"frameworks": [
35+
"arduino",
36+
"espidf"
37+
],
38+
"name": "Espressif ESP-WROVER-KIT",
39+
"upload": {
40+
"flash_size": "8MB",
41+
"maximum_ram_size": 327680,
42+
"maximum_size": 8388608,
43+
"protocols": [
44+
"esptool",
45+
"espota",
46+
"ftdi"
47+
],
48+
"require_upload_port": true,
49+
"speed": 460800
50+
},
51+
"url": "https://espressif.com/en/products/hardware/esp-wrover-kit/overview",
52+
"vendor": "Espressif"
53+
}
54+

data/DefaultCoverArt.jpg

14.2 KB
Loading

documentation/SCDesign-v2-20250511.drawio

Lines changed: 311 additions & 0 deletions
Large diffs are not rendered by default.

documentation/SCDesign.jpg

154 KB
Loading

generate_compile_time.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import datetime
2+
"""
3+
========================================================================
4+
File: generate_compile_time.py
5+
6+
Description:
7+
This script generates a compile-time timestamp and writes it to a
8+
header file (`compile_time.h`). The timestamp is formatted in
9+
12-hour time with an AM/PM indicator.
10+
11+
Usage in PlatformIO:
12+
- This script is executed as a pre-build step in PlatformIO.
13+
- It is referenced in the `platformio.ini` file under `extra_scripts`:
14+
```
15+
extra_scripts = pre:generate_compile_time.py
16+
```
17+
- This ensures that every build updates the compile timestamp.
18+
19+
Generated Output:
20+
- The script writes a `#define` statement to `src/compile_time.h`:
21+
```
22+
#define SC_COMPILE_TIME "MM-DD-YYYY HH:MM:SS AM/PM"
23+
```
24+
- Example output:
25+
```
26+
#define SC_COMPILE_TIME "03-02-2025 12:15:00 AM"
27+
```
28+
29+
How to Use in Code:
30+
- Include the generated `compile_time.h` in your source files:
31+
```c
32+
#include "compile_time.h"
33+
```
34+
- Print or log the compile time:
35+
```c
36+
Serial.println(SC_COMPILE_TIME);
37+
```
38+
39+
Notes:
40+
- The timestamp is dynamically updated at each build.
41+
- The script must be located in the root project directory for
42+
PlatformIO to execute it correctly.
43+
========================================================================
44+
"""
45+
46+
# Generate the current timestamp
47+
compile_time = datetime.datetime.now().strftime("%m-%d-%Y %I:%M:%S %p")
48+
49+
# Write it to a header file with a warning comment
50+
with open("src/compile_time.h", "w") as f:
51+
f.write("""/*
52+
* DO NOT EDIT THIS FILE MANUALLY.
53+
* This file is automatically generated by generate_compile_time.py
54+
* and will be overwritten during each build.
55+
*
56+
* SPDX-FileCopyrightText: 2025 ThingPulse Ltd., https://thingpulse.com
57+
* SPDX-License-Identifier: MIT
58+
*/
59+
60+
""")
61+
f.write(f'#define SC_COMPILE_TIME "{compile_time}"\n')

partitions/custom_no_ota.csv

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This is a custom partition table for this ESP32 project.
2+
# The custom partition is used to get access to all 8 MB
3+
# of the available flash memory.
4+
# Created 1/8/2025
5+
#
6+
# Name, Type, SubType, Offset, Size, Flags
7+
# Name, Type, SubType, Offset, Size, Flags
8+
# Non-volatile storage
9+
nvs, data, nvs, 0x9000, 0x5000,
10+
# OTA metadata (not used in no_ota)
11+
otadata, data, ota, 0xe000, 0x2000,
12+
# Application (4MB)
13+
app0, app, factory, 0x10000, 0x400000,
14+
# Filesystem (3.8125MB)
15+
spiffs, data, spiffs, 0x410000,0x3D0000,
16+
# Core dump (128KB)
17+
coredump, data, coredump,0x7E0000,0x20000,

platformio.ini

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,56 @@
1-
; PlatformIO Project Configuration File for ThingPulse Color Kit Grande
1+
; PlatformIO Project Configuration File
22
;
3-
; Documentation: https://docs.thingpulse.com/guides/esp32-color-kit-grande/
3+
; Build options: build flags, source filter
4+
; Upload options: custom upload port, speed and extra flags
5+
; Library options: dependencies, extra library storages
6+
; Advanced options: extra scripting
47
;
5-
; Additional PlatformIO options and examples: https://docs.platformio.org/page/projectconf.html
8+
; Please visit documentation for the other options and examples
9+
; https://docs.platformio.org/page/projectconf.html
610

711
[env:thingpulse-color-kit-grande]
8-
platform = espressif32@~6.4.0
9-
board = esp-wrover-kit
12+
platform = espressif32
13+
;board = esp-wrover-kit
14+
board = custom_esp-wrover-kit
1015
framework = arduino
11-
; Adjust port and speed to your system and its capabilities e.g. "upload_port = COM3" on Windows.
12-
; To list all availble ports you may also run 'pio device list' in the Visual Studio Code terminal window.
13-
; In most cases you should be able to leave this commented out and thus rely on the auto-detect mode.
14-
; upload_port = /dev/tty.wchusbserial54790238451
15-
; monitor_port = /dev/tty.wchusbserial54790238451
1616
monitor_speed = 115200
17-
; For your OS & driver combination you might have to lower this to 921600 or even 460800.
1817
upload_speed = 1500000
19-
monitor_filters = esp32_exception_decoder, time
20-
build_flags =
21-
; core flags
22-
-DCORE_DEBUG_LEVEL=5
23-
-DBOARD_HAS_PSRAM
24-
-mfix-esp32-psram-cache-issue
25-
; TFT_eSPI flags
26-
; Below we replicate the flags from TFT_eSPI/User_Setups/Setup21_ILI9488.h.
27-
; You can't mix'n match from their .h and -D here.
28-
-D USER_SETUP_LOADED=1 # 1 => will not load User_Setup.h from TFT_eSPI but rely on the flags defined here
29-
-D ILI9488_DRIVER=1
30-
-D TFT_MISO=19
31-
-D TFT_MOSI=18
32-
-D TFT_SCLK=05
33-
-D TFT_CS=15
34-
-D TFT_DC=2
35-
-D TFT_RST=4
36-
-D TFT_BL=32
37-
; As we're using OpenFontRender we don't need any of the TFT_eSPI built-in fonts.
38-
; Font descriptions at TFT_eSPI/User_Setups/Setup21_ILI9488.h
39-
-D LOAD_GLCD=0
40-
-D LOAD_FONT2=0
41-
-D LOAD_FONT4=0
42-
-D LOAD_FONT6=0
43-
-D LOAD_FONT7=0
44-
-D LOAD_FONT8=0
45-
-D LOAD_GFXFF=0
46-
-D SMOOTH_FONT=1
47-
-D SPI_FREQUENCY=27000000
48-
; required if you include OpenFontRender and build on macOS
49-
-I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/**
50-
board_build.partitions = no_ota.csv
18+
monitor_filters =
19+
esp32_exception_decoder
20+
time
21+
build_unflags = -std=gnu++11 ; Enable C++ 14 added 1/25/2025
22+
build_flags =
23+
-std=gnu++14 ; Enable C++ 14 to pick up std::make_unique added 1/25/2025
24+
-DCORE_DEBUG_LEVEL=3 ; was 5 1/2/2025
25+
-DBOARD_HAS_PSRAM
26+
-mfix-esp32-psram-cache-issue
27+
-D USER_SETUP_LOADED=1
28+
-D ILI9488_DRIVER=1
29+
-D TFT_MISO=19
30+
-D TFT_MOSI=18
31+
-D TFT_SCLK=05
32+
-D TFT_CS=15
33+
-D TFT_DC=2
34+
-D TFT_RST=4
35+
-D TFT_BL=32
36+
-D LOAD_GLCD=0
37+
-D LOAD_FONT2=0
38+
-D LOAD_FONT4=0
39+
-D LOAD_FONT6=0
40+
-D LOAD_FONT7=0
41+
-D LOAD_FONT8=0
42+
-D LOAD_GFXFF=0
43+
-D SMOOTH_FONT=1
44+
-D SPI_FREQUENCY=27000000
45+
-I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/**
46+
extra_scripts = pre:generate_compile_time.py
47+
;board_build.partitions = no_ota.csv
48+
board_build.partitions = partitions/custom_no_ota.csv
5149
board_build.filesystem = littlefs
52-
lib_deps =
53-
arkhipenko/TaskScheduler@~3.7.0
54-
bodmer/TFT_eSPI@~2.5.30
55-
bodmer/TJpg_Decoder@~1.0.8
56-
https://github.com/Bodmer/OpenFontRender#f163cc6 ; no tags or releases to reference :( -> pin to Git revision
57-
bblanchon/ArduinoJson@~6.21.3
58-
https://github.com/witnessmenow/spotify-api-arduino#899502c ; https://github.com/witnessmenow/spotify-api-arduino/issues/61
50+
lib_deps =
51+
arkhipenko/TaskScheduler @ ^3.8.5
52+
bodmer/TFT_eSPI @ ^2.5.43
53+
bodmer/TJpg_Decoder @ ^1.1.0
54+
bblanchon/ArduinoJson @ ^7.2.1
55+
https://github.com/Bodmer/OpenFontRender#5e0ec22eef4bc93f963360438a9eb8e5407ef1c4
56+
https://github.com/witnessmenow/spotify-api-arduino#62612780f40521e9833353eeefcaa0c5d16a97a5

0 commit comments

Comments
 (0)