Skip to content

A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol

Added poor man's drawLogicTrace, added prohibited pins for s3-devkit, move pins in s3-devkit

fdufnews83d4196c5287
diff --git a/platformio.ini b/platformio.ini
index f7b92bef..8424e08d 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -360,6 +360,9 @@ build_flags =
[env:s3-devkit]
+; Generic s3-devkit works also with esp32S3-Nx-R8/R16 that have Octal SPIRAM
+; GPIO35, 36, 37 are tagged as prohibited as they are used by octal SPIRAM
+; using board = esp32-s3-devkitc-1 Flash partition only uses 8MB of the Flash even it is larger
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
@@ -388,19 +391,20 @@ build_flags =
-DDEVICE_S3DEVKIT
- ; -D ENABLE_FASTLED_PROTOCOL_SWITCHES ; Only possible if you build it on linux
+ -D ENABLE_FASTLED_PROTOCOL_SWITCHES ; Only possible if you build it on linux
-Wl,-zmuldefs ; ieee80211_raw_frame_sanity_check override - needed for WiFi deauth
; --- Pin in use ---
- -DPROTECTED_PINS="\"3, 19, 20, 45, 46\""
+; -DPROTECTED_PINS="\"3, 19, 20, 35, 36, 37, 45, 46\""
+ -DPROTECTED_PINS="\"3, 19, 20, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 45, 46\""
; --- Builtin LED ---
-DLED_PIN=48
-DLED_TYPE_RGB=true
; --- OneWire ---
- -DONEWIRE_PIN=35
+ -DONEWIRE_PIN=6
; --- UART ---
-DUART_BAUD=9600
@@ -412,34 +416,34 @@ build_flags =
-DHDUART_PIN=17
; --- I2C ---
- -DI2C_SCL_PIN=8
- -DI2C_SDA_PIN=9
+ -DI2C_SCL_PIN=7
+ -DI2C_SDA_PIN=6
-DI2C_FREQ=100000
; --- SPI ---
- -DSPI_CS_PIN=39
- -DSPI_CLK_PIN=36
- -DSPI_MISO_PIN=37
- -DSPI_MOSI_PIN=35
+ -DSPI_CS_PIN=10
+ -DSPI_CLK_PIN=12
+ -DSPI_MISO_PIN=11
+ -DSPI_MOSI_PIN=13
; --- Infrared ---
- -DIR_TX_PIN=40
- -DIR_RX_PIN=41
+ -DIR_TX_PIN=4
+ -DIR_RX_PIN=5
; --- LED ---
- -DLED_DATA_PIN=35
- -DLED_CLOCK_PIN=36
+ -DLED_DATA_PIN=15
+ -DLED_CLOCK_PIN=16
; --- TwoWire ---
- -DTWOWIRE_CLK_PIN=35
- -DTWOWIRE_IO_PIN=36
- -DTWOWIRE_RST_PIN=37
+ -DTWOWIRE_CLK_PIN=12
+ -DTWOWIRE_IO_PIN=11
+ -DTWOWIRE_RST_PIN=14
; --- ThreeWire ---
- -DTHREEWIRE_CS_PIN=39
- -DTHREEWIRE_SK_PIN=36
- -DTHREEWIRE_DI_PIN=37
- -DTHREEWIRE_DO_PIN=35
+ -DTHREEWIRE_CS_PIN=10
+ -DTHREEWIRE_SK_PIN=12
+ -DTHREEWIRE_DI_PIN=13
+ -DTHREEWIRE_DO_PIN=11
; --- I2S ---
-DI2S_BCLK_PIN=42
@@ -449,28 +453,31 @@ build_flags =
-DI2S_BITS=16
; --- CAN ---
- -DCAN_CS_PIN=39
- -DCAN_SCK_PIN=36
- -DCAN_SI_PIN=37
- -DCAN_SO_PIN=35
+ -DCAN_CS_PIN=10
+ -DCAN_SCK_PIN=12
+ -DCAN_SI_PIN=13
+ -DCAN_SO_PIN=11
-DCAN_KBPS=125
; --- ETHERNET (W5500) ---
- -DETHERNET_CS_PIN=39
- -DETHERNET_CLK_PIN=36
- -DETHERNET_MISO_PIN=37
- -DETHERNET_MOSI_PIN=35
- -DETHERNET_IRQ_PIN=48
+ -DETHERNET_CS_PIN=10
+ -DETHERNET_CLK_PIN=12
+ -DETHERNET_MISO_PIN=11
+ -DETHERNET_MOSI_PIN=13
+ -DETHERNET_IRQ_PIN=14
; --- SUBGHZ ---
- -DSUBGHZ_CS_PIN=39
- -DSUBGHZ_SCK_PIN=36
- -DSUBGHZ_SI_PIN=37
- -DSUBGHZ_SO_PIN=35
- -DSUBGHZ_GDO_PIN=48
+ -DSUBGHZ_CS_PIN=10
+ -DSUBGHZ_SCK_PIN=12
+ -DSUBGHZ_SI_PIN=13
+ -DSUBGHZ_SO_PIN=11
+ -DSUBGHZ_GDO_PIN=14
+
+ ; --- RF24 ---
+ ; use same wiring as SUBGHZ
; --- JTAG ---
- -DJTAG_SCAN_PINS="\"35, 36, 37, 39, 40\""
+ -DJTAG_SCAN_PINS="\"10, 11, 12, 13, 14\""
[env:m5stack-stamps3]
diff --git a/src/Controllers/UtilityController.cpp b/src/Controllers/UtilityController.cpp
index 45834630..ce67c77a 100644
--- a/src/Controllers/UtilityController.cpp
+++ b/src/Controllers/UtilityController.cpp
@@ -238,6 +238,9 @@ void UtilityController::handleLogicAnalyzer(const TerminalCommand& cmd) {
lastCheck = millis();
char c = terminalInput.readChar();
if (c == '\r' || c == '\n') {
+ // fdufnews 2025/10/22 added to manage drawLogicTrace() for NoScreenDevice
+ if (state.getTerminalMode() == TerminalTypeEnum::Serial)
+ terminalView.print("\n\n\n\n\r"); // 4 lines down to place cursor just under the logic trace
terminalView.println("Logic Analyzer: Stopped by user.");
break;
}
@@ -538,4 +541,4 @@ bool UtilityController::isGlobalCommand(const TerminalCommand& cmd) {
return (root == "mode" || root == "m" || root == "l" ||
root == "logic" || root == "P" || root == "p") ||
root == "system";
-}
\ No newline at end of file
+}
diff --git a/src/Views/NoScreenDeviceView.cpp b/src/Views/NoScreenDeviceView.cpp
index 33129766..3887c0f7 100644
--- a/src/Views/NoScreenDeviceView.cpp
+++ b/src/Views/NoScreenDeviceView.cpp
@@ -16,7 +16,21 @@ void NoScreenDeviceView::loading() {}
void NoScreenDeviceView::clear() {}
-void NoScreenDeviceView::drawLogicTrace(uint8_t pin, const std::vector<uint8_t>& buffer) {}
+void NoScreenDeviceView::drawLogicTrace(uint8_t pin, const std::vector<uint8_t>& buffer) {
+ // fdufnews 2025/10/22 added a poor man's drawLogicTrace() for Serial
+ // draw logic trace on 3 consecutive lines in order to be compatible with small 80x25 terminal window
+ Serial.println("Logic trace");
+ uint8_t pos = 0;
+ for(size_t i = 0; i < buffer.size(); i++, pos++){
+ if(pos > 79){
+ pos = 0;
+ Serial.println();
+ }
+ Serial.write(buffer[i]?'-':'_');
+ }
+ uint8_t up3[] = {'\r', 0x1b, '[', '3', 'A'}; // move cursor 3 lines up
+ Serial.write(up3, 5); // to put cursor at the correct place for the next draw
+}
void NoScreenDeviceView::setRotation(uint8_t rotation) {}
diff --git a/src/Views/NoScreenDeviceView.h b/src/Views/NoScreenDeviceView.h
index 61359f2d..f4989880 100644
--- a/src/Views/NoScreenDeviceView.h
+++ b/src/Views/NoScreenDeviceView.h
@@ -1,5 +1,6 @@
#pragma once
+#include <Arduino.h>
#include "Interfaces/IDeviceView.h"
#include <iostream>
#include <SPI.h>