Skip to content

Commit

Permalink
Merge branch 'master' into tft-gui-work
Browse files Browse the repository at this point in the history
  • Loading branch information
mverch67 authored Aug 2, 2024
2 parents b7475a4 + 48c0635 commit efea1a9
Show file tree
Hide file tree
Showing 124 changed files with 1,495 additions and 1,645 deletions.
19 changes: 10 additions & 9 deletions .github/actions/setup-base/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Install dependencies
- name: Install dependencies
shell: bash
run: |
sudo apt-get -y update --fix-missing
Expand All @@ -22,19 +22,20 @@ runs:
with:
python-version: 3.x

- name: Cache python libs
uses: actions/cache@v4
id: cache-pip # needed in if test
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
# - name: Cache python libs
# uses: actions/cache@v4
# id: cache-pip # needed in if test
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip

- name: Upgrade python tools
shell: bash
run: |
python -m pip install --upgrade pip
pip install -U platformio adafruit-nrfutil
pip install -U meshtastic --pre
pip install -U --no-build-isolation --no-cache-dir "setuptools<72"
pip install -U platformio adafruit-nrfutil --no-build-isolation
pip install -U meshtastic --pre --no-build-isolation
- name: Upgrade platformio
shell: bash
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/build_stm32.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build STM32

on:
workflow_call:
inputs:
board:
required: true
type: string

jobs:
build-stm32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build base
id: base
uses: ./.github/actions/setup-base

- name: Build STM32
run: bin/build-stm32.sh ${{ inputs.board }}

- name: Get release version string
run: echo "version=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
id: version

- name: Store binaries as an artifact
uses: actions/upload-artifact@v4
with:
name: firmware-${{ inputs.board }}-${{ steps.version.outputs.version }}.zip
overwrite: true
path: |
release/*.hex
release/*.bin
13 changes: 12 additions & 1 deletion .github/workflows/main_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [esp32, esp32s3, esp32c3, nrf52840, rp2040, check]
arch: [esp32, esp32s3, esp32c3, nrf52840, rp2040, stm32, check]
runs-on: ubuntu-latest
steps:
- id: checkout
Expand All @@ -41,6 +41,7 @@ jobs:
esp32c3: ${{ steps.jsonStep.outputs.esp32c3 }}
nrf52840: ${{ steps.jsonStep.outputs.nrf52840 }}
rp2040: ${{ steps.jsonStep.outputs.rp2040 }}
stm32: ${{ steps.jsonStep.outputs.stm32 }}
check: ${{ steps.jsonStep.outputs.check }}

check:
Expand Down Expand Up @@ -103,6 +104,15 @@ jobs:
with:
board: ${{ matrix.board }}

build-stm32:
needs: setup
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.stm32) }}
uses: ./.github/workflows/build_stm32.yml
with:
board: ${{ matrix.board }}

package-raspbian:
uses: ./.github/workflows/package_raspbian.yml

Expand Down Expand Up @@ -134,6 +144,7 @@ jobs:
build-esp32-c3,
build-nrf52,
build-rpi2040,
build-stm32,
package-raspbian,
package-raspbian-armv7l,
package-native,
Expand Down
36 changes: 36 additions & 0 deletions arch/stm32/stm32.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[stm32_base]
extends = arduino_base
platform = ststm32
platform_packages = platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32.git#361a7fdb67e2a7104e99b4f42a802469eef8b129

build_type = release

;board_build.flash_offset = 0x08000000

build_flags =
${arduino_base.build_flags}
-flto
-Isrc/platform/stm32wl -g
-DMESHTASTIC_MINIMIZE_BUILD
-DDEBUG_MUTE
; -DVECT_TAB_OFFSET=0x08000000
-DconfigUSE_CMSIS_RTOS_V2=1
; -DSPI_MODE_0=SPI_MODE0
-fmerge-all-constants
-ffunction-sections
-fdata-sections

build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<input> -<buzz> -<modules/Telemetry> -<platform/nrf52> -<platform/portduino> -<platform/rp2040> -<mesh/raspihttp>

board_upload.offset_address = 0x08000000
upload_protocol = stlink

lib_deps =
${env.lib_deps}
charlesbaynham/OSFS@^1.2.3
https://github.com/caveman99/Crypto.git#f61ae26a53f7a2d0ba5511625b8bf8eff3a35d5e

lib_ignore =
mathertel/OneButton
Wire
28 changes: 0 additions & 28 deletions arch/stm32/stm32wl5e.ini

This file was deleted.

2 changes: 1 addition & 1 deletion bin/build-esp32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware*
rm -r $OUTDIR/* || true

# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio pkg update
platformio pkg update -e $1

echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$1/firmware.*
Expand Down
2 changes: 1 addition & 1 deletion bin/build-nrf52.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware*
rm -r $OUTDIR/* || true

# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio pkg update
platformio pkg update -e $1

echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$1/firmware.*
Expand Down
2 changes: 1 addition & 1 deletion bin/build-rpi2040.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rm -f $OUTDIR/firmware*
rm -r $OUTDIR/* || true

# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio pkg update
platformio pkg update -e $1

echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$1/firmware.*
Expand Down
29 changes: 29 additions & 0 deletions bin/build-stm32.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

set -e

VERSION=$(bin/buildinfo.py long)
SHORT_VERSION=$(bin/buildinfo.py short)

OUTDIR=release/

rm -f $OUTDIR/firmware*
rm -r $OUTDIR/* || true

# Important to pull latest version of libs into all device flavors, otherwise some devices might be stale
platformio pkg update -e $1

echo "Building for $1 with $PLATFORMIO_BUILD_FLAGS"
rm -f .pio/build/$1/firmware.*

# The shell vars the build tool expects to find
export APP_VERSION=$VERSION

basename=firmware-$1-$VERSION

pio run --environment $1 # -v
SRCELF=.pio/build/$1/firmware.elf
cp $SRCELF $OUTDIR/$basename.elf

SRCBIN=.pio/build/$1/firmware.bin
cp $SRCBIN $OUTDIR/$basename.bin
13 changes: 12 additions & 1 deletion bin/config-dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Lora:

# ch341_quirk: true # Uncomment this to use the chunked SPI transfer that seems to fix the ch341

# spiSpeed: 2000000

### Set gpio chip to use in /dev/. Defaults to 0.
### Notably the Raspberry Pi 5 puts the GPIO header on gpiochip4
# gpiochip: 4
Expand Down Expand Up @@ -134,6 +136,9 @@ Display:
# OffsetRotate: 1
# Invert: true

### You can also specify the spi device for the display to use
# spidev: spidev0.0

Touchscreen:
### Note, at least for now, the touchscreen must have a CS pin defined, even if you let Linux manage the CS switching.

Expand All @@ -149,19 +154,25 @@ Touchscreen:
# CS: 7
# IRQ: 17

### Configure device for direct keyboard input
### You can also specify the spi device for the touchscreen to use
# spidev: spidev0.0


Input:
### Configure device for direct keyboard input

# KeyboardDevice: /dev/input/by-id/usb-_Raspberry_Pi_Internal_Keyboard-event-kbd

###

Logging:
LogLevel: info # debug, info, warn, error
# TraceFile: /var/log/meshtasticd.json

Webserver:
# Port: 443 # Port for Webserver & Webservices
# RootPath: /usr/share/doc/meshtasticd/web # Root Dir of WebServer

General:
MaxNodes: 200
MaxMessageQueue: 100
9 changes: 9 additions & 0 deletions bin/platformio-custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,12 @@ def esp32_create_combined_bin(source, target, env):
"-DAPP_VERSION_SHORT=" + verObj["short"],
]
)

# Add a custom p.io project task to run the UF2 conversion script.
env.AddCustomTarget(
name="Convert Hex to UF2",
dependencies=None,
actions=["PYTHON .\\bin\\uf2conv.py $BUILD_DIR\$env\\firmware.hex -c -f 0xADA52840 -o $BUILD_DIR\$env\\firmware.uf2"],
title="Convert hex to uf2",
description="Runs the python script to convert an already-built .hex file into .uf2 for copying to a device"
)
42 changes: 42 additions & 0 deletions boards/heltec_vision_master_e290.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default_8MB.csv"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
["0x303A", "0x1001"],
["0x303A", "0x0002"]
],
"mcu": "esp32s3",
"variant": "heltec_vision_master_e290"
},
"connectivity": ["wifi", "bluetooth", "lora"],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "Heltec Vision Master E290",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 921600
},
"url": "https://heltec.org/project/vision-master-e290/",
"vendor": "Heltec"
}
3 changes: 3 additions & 0 deletions boards/generic_wl5e.json → boards/wiscore_rak3172.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"build": {
"arduino": {
"variant_h": "variant_RAK3172_MODULE.h"
},
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32WLxx -DSTM32WLE5xx -DARDUINO_GENERIC_WLE5CCUX",
Expand Down
2 changes: 1 addition & 1 deletion protobufs
4 changes: 2 additions & 2 deletions src/ButtonThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ int32_t ButtonThread::runOnce()

case BUTTON_EVENT_DOUBLE_PRESSED: {
LOG_BUTTON("Double press!\n");
service.refreshLocalMeshNode();
auto sentPosition = service.trySendPosition(NODENUM_BROADCAST, true);
service->refreshLocalMeshNode();
auto sentPosition = service->trySendPosition(NODENUM_BROADCAST, true);
if (screen) {
if (sentPosition)
screen->print("Sent ad-hoc position\n");
Expand Down
2 changes: 1 addition & 1 deletion src/ButtonThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#endif

#ifndef BUTTON_TOUCH_MS
#define BUTTON_TOCH_MS 400
#define BUTTON_TOUCH_MS 400
#endif

class ButtonThread : public concurrency::OSThread
Expand Down
Loading

0 comments on commit efea1a9

Please sign in to comment.