Make uf2reset available across nRF52 CLI roles

This commit is contained in:
mikecarper committed 2026-09-04 02:01:40 -07:00
1 parent e36b092aa3
commit 65a53285d9
14 files changed
+154 -34

No files matched your search

+10
View File
@@ -7214,6 +7214,9 @@ void MyMesh::handleTerminalCommand(char* command) {
#endif
terminalOutput().print(" reboot\r\n");
terminalOutput().print(" ver\r\n");
#if defined(NRF52_PLATFORM)
terminalOutput().println(" uf2reset");
#endif
if (_terminal_mode) {
terminalOutput().print(" +++MESHCORE-TERM-STOP\r\n");
} else {
@@ -7281,6 +7284,13 @@ bool MyMesh::handleCommand(const char* command, uint32_t sender_timestamp,
}
#endif
if (sender_timestamp == 0 && mesh::cli::isUf2ResetCommand(command)) {
if (!board.rebootToUf2Bootloader()) {
snprintf(reply, reply_capacity, "ERR: unsupported");
}
return true;
}
if (handleLocalControlCommand(command, reply, reply_capacity)) return true;
if (strncmp(command, "set tx ", 7) == 0) {
+8
View File
@@ -13,6 +13,7 @@
#endif
#include <helpers/ArduinoHelpers.h>
#include <helpers/CLICommandUtils.h>
#include <helpers/IdentityGeneration.h>
#include <helpers/StaticPoolPacketManager.h>
#include <helpers/SimpleMeshTables.h>
@@ -595,6 +596,10 @@ public:
} else {
Serial.printf(" ERROR: unknown config: %s\n", config);
}
} else if (mesh::cli::isUf2ResetCommand(command)) {
if (!board.rebootToUf2Bootloader()) {
Serial.println(" ERROR: UF2 bootloader is unavailable");
}
} else if (memcmp(command, "ver", 3) == 0) {
Serial.println(FIRMWARE_VER_TEXT);
} else if (memcmp(command, "help", 4) == 0) {
@@ -617,6 +622,9 @@ public:
Serial.println(" advert");
Serial.println(" reset path");
Serial.println(" public <text>");
#if defined(NRF52_PLATFORM)
Serial.println(" uf2reset");
#endif
} else {
Serial.print(" ERROR: unknown command: "); Serial.println(command);
}