From 369d3797200ba27cbb93929d05bb2368e913d8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 16 Jun 2024 21:08:34 +0200 Subject: [PATCH 01/14] CI is creating the uf2 file during build --- variants/rak2560/platformio.ini | 3 --- 1 file changed, 3 deletions(-) diff --git a/variants/rak2560/platformio.ini b/variants/rak2560/platformio.ini index ff667aadf..96c1bfa92 100644 --- a/variants/rak2560/platformio.ini +++ b/variants/rak2560/platformio.ini @@ -19,6 +19,3 @@ lib_deps = debug_tool = jlink ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) ;upload_protocol = jlink -extra_scripts = - ${env.extra_scripts} - ./variants/rak2560/create_uf2.py \ No newline at end of file From 7aea056ac0bdaf0e101202549796a749f6589273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 16 Jun 2024 22:43:16 +0200 Subject: [PATCH 02/14] exclude debs from release zip --- .github/workflows/main_matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 89b71acb8..25a0fbad2 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -254,7 +254,7 @@ jobs: chmod +x ./output/device-update.sh - name: Zip firmware - run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output + run: zip -j -9 -r ./firmware-${{ steps.version.outputs.version }}.zip ./output -x *.deb - uses: actions/download-artifact@v4 with: From ea69b999f9b602c7baba6508d63c27985872e18d Mon Sep 17 00:00:00 2001 From: geeksville Date: Sun, 16 Jun 2024 13:59:38 -0700 Subject: [PATCH 03/14] Add rak4631_dap variant for debugging with NanoDAP debug probe device. --- variants/rak4631/platformio.ini | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index 4870d4b68..b9bf42655 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -18,5 +18,33 @@ lib_deps = rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2 https://github.com/meshtastic/RAK12034-BMX160.git#4821355fb10390ba8557dc43ca29a023bcfbb9d9 debug_tool = jlink + ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) -;upload_protocol = jlink \ No newline at end of file +; Note: as of 6/2013 the serial/bootloader based programming takes approximately 30 seconds +;upload_protocol = jlink + +; Allows programming and debug via the RAK NanoDAP as the default debugger tool for the RAK4631 (it is only $10!) +; programming time is about the same as the bootloader version. +; For information on this see the meshtastic developers documentation for "Development on the NRF52" +[env:rak4631_dap] +extends = env:rak4631 +; pyocd pack --i nrf52840 +; eventually use platformio/tool-pyocd@^2.3600.0 instad +upload_protocol = custom +upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE + +; Only reprogram the board if the code has changed +debug_load_mode = modified +;debug_load_mode = manual +debug_tool = custom +; We manually pass in the elf file so that pyocd can reverse engineer FreeRTOS data (running threads, etc...) +debug_server = + pyocd + gdbserver + -t + nrf52840 + --elf + ${platformio.build_dir}/${this.__env__}/firmware.elf +; The following is not needed because it automatically tries do this +;debug_server_ready_pattern = -.*GDB server started on port \d+.* +;debug_port = localhost:3333 \ No newline at end of file From 163a732ddc5f904685091fd571328ee54a6f74b0 Mon Sep 17 00:00:00 2001 From: geeksville Date: Sun, 16 Jun 2024 17:17:19 -0700 Subject: [PATCH 04/14] Turn off vscode cmake prompt - we don't use cmake on meshtastic (#4122) --- .vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e86d31c7d..07e198f0a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,6 @@ "editor.defaultFormatter": "trunk.io", "trunk.enableWindows": true, "files.insertFinalNewline": false, - "files.trimFinalNewlines": false + "files.trimFinalNewlines": false, + "cmake.configureOnOpen": false } From 7afa8107ae5f8f5c8d9a9fba5173d1450c54b8b1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 16 Jun 2024 19:22:51 -0500 Subject: [PATCH 05/14] [create-pull-request] automated change (#4121) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index a26da1996..268987418 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 3 -build = 13 +build = 14 From 15250a566a3bce90a3449481f5a1d0ff513441de Mon Sep 17 00:00:00 2001 From: geeksville Date: Sun, 16 Jun 2024 17:17:19 -0700 Subject: [PATCH 06/14] Turn off vscode cmake prompt - we don't use cmake on meshtastic (#4122) --- .vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e86d31c7d..07e198f0a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,6 @@ "editor.defaultFormatter": "trunk.io", "trunk.enableWindows": true, "files.insertFinalNewline": false, - "files.trimFinalNewlines": false + "files.trimFinalNewlines": false, + "cmake.configureOnOpen": false } From c593e7ce56a804b4526f4778e8c7c400c5511235 Mon Sep 17 00:00:00 2001 From: geeksville Date: Sun, 16 Jun 2024 13:59:38 -0700 Subject: [PATCH 07/14] Add rak4631_dap variant for debugging with NanoDAP debug probe device. use board_level = extra --- variants/rak4631/platformio.ini | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini index 4870d4b68..58a8eb5e4 100644 --- a/variants/rak4631/platformio.ini +++ b/variants/rak4631/platformio.ini @@ -18,5 +18,34 @@ lib_deps = rakwireless/RAKwireless NCP5623 RGB LED library@^1.0.2 https://github.com/meshtastic/RAK12034-BMX160.git#4821355fb10390ba8557dc43ca29a023bcfbb9d9 debug_tool = jlink + ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) -;upload_protocol = jlink \ No newline at end of file +; Note: as of 6/2013 the serial/bootloader based programming takes approximately 30 seconds +;upload_protocol = jlink + +; Allows programming and debug via the RAK NanoDAP as the default debugger tool for the RAK4631 (it is only $10!) +; programming time is about the same as the bootloader version. +; For information on this see the meshtastic developers documentation for "Development on the NRF52" +[env:rak4631_dap] +extends = env:rak4631 +board_level = extra +; pyocd pack --i nrf52840 +; eventually use platformio/tool-pyocd@^2.3600.0 instad +upload_protocol = custom +upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE + +; Only reprogram the board if the code has changed +debug_load_mode = modified +;debug_load_mode = manual +debug_tool = custom +; We manually pass in the elf file so that pyocd can reverse engineer FreeRTOS data (running threads, etc...) +debug_server = + pyocd + gdbserver + -t + nrf52840 + --elf + ${platformio.build_dir}/${this.__env__}/firmware.elf +; The following is not needed because it automatically tries do this +;debug_server_ready_pattern = -.*GDB server started on port \d+.* +;debug_port = localhost:3333 \ No newline at end of file From 12b8dc1918592baaaf72111d57cb98558eb24f3f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 17 Jun 2024 06:09:50 -0500 Subject: [PATCH 08/14] Revert "[create-pull-request] automated change (#4121)" (#4124) This reverts commit 7afa8107ae5f8f5c8d9a9fba5173d1450c54b8b1. --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 268987418..a26da1996 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 3 -build = 14 +build = 13 From 83f5ba0161725a597591c530ff509f2a5da27461 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Mon, 17 Jun 2024 23:14:20 +1200 Subject: [PATCH 09/14] Update OLED ref (#4125) Upstream changes to the library temporarily reverted to restore debug info frame --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index a1beb8e7c..83c4924c4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -80,7 +80,7 @@ monitor_speed = 115200 lib_deps = jgromes/RadioLib@~6.6.0 - https://github.com/meshtastic/esp8266-oled-ssd1306.git#69ba98fa30e67b12d4577b121f210f3eb7049d6b ; ESP8266_SSD1306 + https://github.com/meshtastic/esp8266-oled-ssd1306.git#dcacac5d2c7942376bc17f7079cced6a73cb659f ; ESP8266_SSD1306 mathertel/OneButton@^2.5.0 ; OneButton library for non-blocking button debounce https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159 https://github.com/meshtastic/TinyGPSPlus.git#71a82db35f3b973440044c476d4bcdc673b104f4 From 5d2f7d1962de15b811c34f34909e50f571b030da Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 07:17:36 -0500 Subject: [PATCH 10/14] [create-pull-request] automated change (#4127) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index a26da1996..268987418 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 3 -build = 13 +build = 14 From 9d8a5221a97f13b64c5f3fe585eb8284c3224fef Mon Sep 17 00:00:00 2001 From: mverch67 Date: Mon, 17 Jun 2024 20:17:56 +0200 Subject: [PATCH 11/14] fix for MESHTASTIC_EXCLUDE_INPUTBROKER --- src/input/InputBroker.cpp | 2 +- src/input/cardKbI2cImpl.cpp | 1 + src/input/cardKbI2cImpl.h | 1 - src/modules/Modules.cpp | 1 + src/modules/Telemetry/Sensor/OPT3001Sensor.cpp | 13 +++++++++---- src/modules/Telemetry/Sensor/OPT3001Sensor.h | 9 ++++++++- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/input/InputBroker.cpp b/src/input/InputBroker.cpp index b06c7400f..cb73e32ba 100644 --- a/src/input/InputBroker.cpp +++ b/src/input/InputBroker.cpp @@ -1,7 +1,7 @@ #include "InputBroker.h" #include "PowerFSM.h" // needed for event trigger -InputBroker *inputBroker; +InputBroker *inputBroker = nullptr; InputBroker::InputBroker(){}; diff --git a/src/input/cardKbI2cImpl.cpp b/src/input/cardKbI2cImpl.cpp index e000f36eb..3cc70fa15 100644 --- a/src/input/cardKbI2cImpl.cpp +++ b/src/input/cardKbI2cImpl.cpp @@ -1,5 +1,6 @@ #include "cardKbI2cImpl.h" #include "InputBroker.h" +#include "main.h" CardKbI2cImpl *cardKbI2cImpl; diff --git a/src/input/cardKbI2cImpl.h b/src/input/cardKbI2cImpl.h index 1e6e87dfd..811a0558c 100644 --- a/src/input/cardKbI2cImpl.h +++ b/src/input/cardKbI2cImpl.h @@ -1,6 +1,5 @@ #pragma once #include "kbI2cBase.h" -#include "main.h" /** * @brief The idea behind this class to have static methods for the event handlers. diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index 1b4bbc3b4..ba1f5c11e 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -42,6 +42,7 @@ #include "modules/Telemetry/DeviceTelemetry.h" #endif #if HAS_SENSOR && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR +#include "main.h" #include "modules/Telemetry/AirQualityTelemetry.h" #include "modules/Telemetry/EnvironmentTelemetry.h" #endif diff --git a/src/modules/Telemetry/Sensor/OPT3001Sensor.cpp b/src/modules/Telemetry/Sensor/OPT3001Sensor.cpp index 0d76e2897..d0e38bf88 100644 --- a/src/modules/Telemetry/Sensor/OPT3001Sensor.cpp +++ b/src/modules/Telemetry/Sensor/OPT3001Sensor.cpp @@ -1,7 +1,10 @@ -#include "OPT3001Sensor.h" -#include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "TelemetrySensor.h" #include "configuration.h" + +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR + +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "OPT3001Sensor.h" +#include "TelemetrySensor.h" #include OPT3001Sensor::OPT3001Sensor() : TelemetrySensor(meshtastic_TelemetrySensorType_OPT3001, "OPT3001") {} @@ -41,4 +44,6 @@ bool OPT3001Sensor::getMetrics(meshtastic_Telemetry *measurement) LOG_INFO("Lux: %f\n", measurement->variant.environment_metrics.lux); return true; -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/OPT3001Sensor.h b/src/modules/Telemetry/Sensor/OPT3001Sensor.h index 4a8deef21..2ac149319 100644 --- a/src/modules/Telemetry/Sensor/OPT3001Sensor.h +++ b/src/modules/Telemetry/Sensor/OPT3001Sensor.h @@ -1,3 +1,8 @@ +#pragma once +#include "configuration.h" + +#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR + #include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include @@ -14,4 +19,6 @@ class OPT3001Sensor : public TelemetrySensor OPT3001Sensor(); virtual int32_t runOnce() override; virtual bool getMetrics(meshtastic_Telemetry *measurement) override; -}; \ No newline at end of file +}; + +#endif \ No newline at end of file From cd60ee80bdd0f6ab73f3ce9b26ce251819c8b9a4 Mon Sep 17 00:00:00 2001 From: mverch67 Date: Mon, 17 Jun 2024 21:17:25 +0200 Subject: [PATCH 12/14] fix wrong include file exclusion --- src/main.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 6797c8375..57009ae46 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,13 +41,14 @@ #endif #if !MESHTASTIC_EXCLUDE_BLUETOOTH #include "nimble/NimbleBluetooth.h" -NimbleBluetooth *nimbleBluetooth; +NimbleBluetooth *nimbleBluetooth = nullptr; #endif #endif #ifdef ARCH_NRF52 #include "NRF52Bluetooth.h" -NRF52Bluetooth *nrf52Bluetooth; +NRF52Bluetooth *nrf52Bluetooth = nullptr; +; #endif #if HAS_WIFI @@ -94,23 +95,26 @@ NRF52Bluetooth *nrf52Bluetooth; #include "ButtonThread.h" #endif +#include "AmbientLightingThread.h" #include "PowerFSMThread.h" #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR #include "AccelerometerThread.h" -#include "AmbientLightingThread.h" -AccelerometerThread *accelerometerThread; +AccelerometerThread *accelerometerThread = nullptr; +; #endif #ifdef HAS_I2S #include "AudioThread.h" -AudioThread *audioThread; +AudioThread *audioThread = nullptr; +; #endif using namespace concurrency; // We always create a screen object, but we only init it if we find the hardware -graphics::Screen *screen; +graphics::Screen *screen = nullptr; +; // Global power status meshtastic::PowerStatus *powerStatus = new meshtastic::PowerStatus(); From 5e92136ed043cd7b647523ff593a982ce52f033c Mon Sep 17 00:00:00 2001 From: mverch67 Date: Mon, 17 Jun 2024 21:19:36 +0200 Subject: [PATCH 13/14] semi colon --- src/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 57009ae46..5ee895c9c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -101,7 +101,6 @@ NRF52Bluetooth *nrf52Bluetooth = nullptr; #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR #include "AccelerometerThread.h" AccelerometerThread *accelerometerThread = nullptr; -; #endif #ifdef HAS_I2S From e822525ce5d2252b8a9fa2eb562044be4fb1a948 Mon Sep 17 00:00:00 2001 From: mverch67 Date: Mon, 17 Jun 2024 21:23:07 +0200 Subject: [PATCH 14/14] more semi colons >_< --- src/main.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5ee895c9c..a81f9206c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -106,14 +106,12 @@ AccelerometerThread *accelerometerThread = nullptr; #ifdef HAS_I2S #include "AudioThread.h" AudioThread *audioThread = nullptr; -; #endif using namespace concurrency; // We always create a screen object, but we only init it if we find the hardware graphics::Screen *screen = nullptr; -; // Global power status meshtastic::PowerStatus *powerStatus = new meshtastic::PowerStatus();