Skip to content

Commit 0a485c7

Browse files
authored
Initial commit
0 parents  commit 0a485c7

18 files changed

+657
-0
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [mcuw, vanvuongngo] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
on:
2+
push:
3+
tags-ignore:
4+
- "**"
5+
pull_request:
6+
branches: [main]
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v4
14+
- name: Set up python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.x"
18+
architecture: "x64"
19+
- name: Install PlatformIO
20+
run: python3 -m pip install platformio==6.1.13
21+
- name: Build firmwares
22+
run: FIRMWARE_VERSION=main platformio run
23+
- name: Archive
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: firmware
27+
path: .pio/build/*/firmware_*.bin
28+
retention-days: 1

.github/workflows/build_release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
push:
3+
tags:
4+
- "*"
5+
pull_request:
6+
branches: [main]
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v4
14+
- name: Set up python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.x"
18+
architecture: "x64"
19+
- name: Install PlatformIO
20+
run: python3 -m pip install platformio==6.1.13
21+
- name: Build firmwares
22+
run: FIRMWARE_VERSION=${{github.ref_name}} platformio run
23+
- name: Archive
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: firmware
27+
path: .pio/build/*/firmware_*.bin
28+
retention-days: 1
29+
release:
30+
name: Release
31+
# if: startsWith(github.event.ref, 'refs/tags/v')
32+
needs: build
33+
permissions:
34+
contents: write
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout repo for CHANGELOG
38+
uses: actions/checkout@v4
39+
- name: Download artifacts
40+
uses: actions/download-artifact@v4
41+
with:
42+
name: firmware
43+
path: firmware
44+
# - name: Display structure of downloaded files
45+
# run: ls -R
46+
- name: release
47+
uses: ncipollo/release-action@v1
48+
with:
49+
artifacts: "firmware/*/firmware_*.bin"
50+
bodyFile: "CHANGELOG.md"

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.pio
2+
.vscode/.browse.c_cpp.db*
3+
.vscode/c_cpp_properties.json
4+
.vscode/launch.json
5+
.vscode/ipch
6+
.DS_Store

.vscode/extensions.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"platformio.platformio-ide"
6+
],
7+
"unwantedRecommendations": [
8+
"ms-vscode.cpptools-extension-pack"
9+
]
10+
}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CHANGELOG
2+
3+
## v0.0.0
4+
5+
PLEASE WRITE YOUR CHANGES BEFORE YOU CREATE A RELEASE IN THE CHANGELOG.MD FILE!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 mcuw
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# ESP32 project template
2+
3+
## Description
4+
5+
This is a project template to create microcontroller apps with automatized firmware builds for [esp32](https://www.espressif.com/en/products/socs/esp32), [esp32s2](https://www.espressif.com/en/products/socs/esp32-s2) and [esp32s3](https://www.espressif.com/en/products/socs/esp32-s3) microcontroller boards. It uses for that [GitHub Actions](https://github.com/features/actions) and [platformio](https://platformio.org/). Use this repository as a template for your own esp32 projects.
6+
7+
## Requirements
8+
9+
- [GitHub Actions](https://github.com/features/actions)
10+
- [platformio](https://platformio.org/)
11+
- [python](https://www.python.org/)
12+
13+
## GitHub Actions - Workflow
14+
15+
The release build happens in the `build & release` workflow: [build_release.yml](.github/workflows/build_release.yml).
16+
It creates a release, after creation of a new git tag (named it like `v1.0.0`).
17+
18+
If you want to test the build on all merge w/o creating a tag then the `build` workflow is what you looking for: [build.yml](.github/workflows/build.yml)
19+
20+
## PlatformIO
21+
22+
[PlatformIO](https://platformio.org/) is a tool to create microcontroller apps for arduino platforms and compatibles (esp32). You can install the [Visual Studio Code extension](https://platformio.org/install/ide?install=vscode) in the [Visual Studio Code](https://code.visualstudio.com/) IDE.
23+
24+
## Python
25+
26+
There is a tiny python script needed to customize the firmware filenames within platformio, see documentation: https://docs.platformio.org/en/stable/scripting/examples/custom_program_name.html
27+
28+
The [extra_script.py](extra_script.py) script gets the platformio env (e.g. lolin32) and the git-tag for the firmware filename.
29+
This is required to publish several firmware names in the github artifacts of a release.
30+
31+
## Get Started
32+
33+
<img src="doc/create-new-project-with-template.png" />
34+
35+
1. Login to github
36+
37+
2. Click on `Use this template` to create a new git repository
38+
3. Implement your application in the [src/main.cpp](src/main.cpp)
39+
4. Comment your new change in the [CHANGELOG.md](CHANGELOG.md) file
40+
5. Push your changes
41+
42+
```sh
43+
git add .
44+
```
45+
46+
```sh
47+
git commit -am "my app"
48+
```
49+
50+
```sh
51+
git push -u origin main
52+
```
53+
54+
5. Create a new tag to trigger a release, e.g. for v1.0.0
55+
56+
```sh
57+
git tag v1.0.0
58+
```
59+
60+
```sh
61+
git push origin v1.0.0
62+
```
63+
64+
6. You can find your firmwares under `Releases` after the CI build finished
65+
66+
## CHANGELOG
67+
68+
You can write your changes in the [CHANGELOG.md](CHANGELOG.md) before you create a release. It will be shown under the release page.
69+
70+
## Example Release
71+
72+
see [Releases](https://github.com/mcuw/esp-ghbuild-template/releases) on the right sidemenu.
73+
74+
## Customize your project
75+
76+
You can reduce and adapt your required boards in the [platformio.ini](platformio.ini).
77+
78+
Update the [CHANGELOG.md](CHANGELOG.md) file before you are creating a new release. By creating a new git tag you trigger a new release which generate for you the firmwares.
79+
80+
## Supported boards
81+
82+
- ESP32 (buy with affiliate link: [LILYGO T-Beam](https://s.click.aliexpress.com/e/_DBzslDV) with LoRA, lolin32, lolin D32 pro)
83+
- ESP32 S2
84+
- ESP32 S3 (buy with affiliate link: [LILYGO T-Display S3](https://s.click.aliexpress.com/e/_DBmOMkn), [LILYGO T-Display-S3 AMOLED](https://s.click.aliexpress.com/e/_DmboYpZ), [LILYGO T-Display-S3 Touch](https://s.click.aliexpress.com/e/_DCBgPlV), [LILYGO T-Display S3 Long](https://s.click.aliexpress.com/e/_Dl6UVMx))
85+
- ESP32 C6 with WiFi 6 and BT-5 LE (buy with affiliate link: [UICPAL nanoESP32-C6](https://s.click.aliexpress.com/e/_DdZ83IB) with up to 16MB flash, [ESP32-C6](https://s.click.aliexpress.com/e/_DeLjVMb) with 4MB flash and W2812 RGB LED)
86+
87+
## Disclaimer
88+
89+
Contribution and help ... if you find an issue or wants to contribute then please do not hesitate to create a merge request or an issue.
90+
91+
We provide our build template as is, and we make no promises or guarantees about this code.

boards/esp32-c6-n16.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"build": {
3+
"core": "esp32",
4+
"f_cpu": "160000000L",
5+
"f_flash": "80000000L",
6+
"flash_mode": "qio",
7+
"mcu": "esp32c6",
8+
"variant": "esp32c6",
9+
"extra_flags": [
10+
"-DARDUINO_ESP32S3_DEV",
11+
"-DARDUINO_USB_MODE=1",
12+
"-DARDUINO_USB_CDC_ON_BOOT=1"
13+
]
14+
},
15+
"connectivity": [
16+
"wifi",
17+
"bluetooth"
18+
],
19+
"frameworks": [
20+
"arduino",
21+
"espidf"
22+
],
23+
"name": "Espressif ESP32-C6 N16",
24+
"upload": {
25+
"flash_size": "16MB",
26+
"maximum_ram_size": 524288,
27+
"maximum_size": 16777216,
28+
"require_upload_port": true,
29+
"speed": 460800
30+
},
31+
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
32+
"vendor": "Espressif"
33+
}

boards/esp32-c6-n4.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"build": {
3+
"core": "esp32",
4+
"f_cpu": "160000000L",
5+
"f_flash": "80000000L",
6+
"flash_mode": "qio",
7+
"mcu": "esp32c6",
8+
"variant": "esp32c6",
9+
"extra_flags": [
10+
"-DARDUINO_ESP32C6_DEV",
11+
"-DARDUINO_USB_MODE=1",
12+
"-DARDUINO_USB_CDC_ON_BOOT=1"
13+
]
14+
},
15+
"connectivity": [
16+
"wifi",
17+
"bluetooth"
18+
],
19+
"frameworks": [
20+
"arduino",
21+
"espidf"
22+
],
23+
"name": "Espressif ESP32-C6 N4",
24+
"upload": {
25+
"flash_size": "4MB",
26+
"maximum_ram_size": 524288,
27+
"maximum_size": 4194304,
28+
"require_upload_port": true,
29+
"speed": 460800
30+
},
31+
"url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html",
32+
"vendor": "Espressif"
33+
}

0 commit comments

Comments
 (0)