What changed, and why it matters
This commit fixes a bug where the Krux device could not switch which physical pins it uses to talk to a printer. The change forces the hardware to reassign the printer's data pins (TX/RX) even if they were already mapped to something else. This is a functional bug fix rather than a clear security patch, but incorrect pin mapping could in theory cause a printer to misbehave or leak data on the wrong pins.
Treat as a normal bug fix. Review whether forcing pin remapping could interfere with other peripherals sharing the same pins, and verify that the printer configuration UI correctly validates user-selected pin numbers. No urgent security response is indicated by the diff alone.
Security signals we found
Pin/function remapping now forced, preventing stale UART pin assignments
Potential information disclosure or misrouting if old TX/RX pins were observable
No input validation or bounds checking changes visible
Evidence from the diff
In both src/krux/printers/cnc.py and src/krux/printers/thermal.py, the fm.register() calls for UART2_TX and UART2_RX are changed from force=False to force=True. On the MaixPy/K210 platform, fm.register maps a GPIO pin to a function. With force=False, if the pin is already assigned to another function the new mapping is rejected, so changing the configured TX/RX pins would silently fail and the printer would continue using the old pins. force=True reassigns the pin regardless. The commit title says this fixes the printer not changing TX/RX pin. There is no direct evidence in the diff of a security vulnerability; it is a reliability/functional fix.
Changed components
src/krux/printers/cnc.pysrc/krux/printers/thermal.pyGRBL CNC printer driverAdafruit thermal printer driverUART2 TX/RX pin mappingInspect captured patch +4 / −4
diff --git a/src/krux/printers/cnc.py b/src/krux/printers/cnc.py
index 0a089bf..adff693 100644
--- a/src/krux/printers/cnc.py
+++ b/src/krux/printers/cnc.py
@@ -373,12 +373,12 @@ class GRBLPrinter(GCodeGenerator):
fm.register(
Settings().hardware.printer.cnc.grbl.tx_pin,
fm.fpioa.UART2_TX,
- force=False,
+ force=True,
)
fm.register(
Settings().hardware.printer.cnc.grbl.rx_pin,
fm.fpioa.UART2_RX,
- force=False,
+ force=True,
)
self.uart_conn = UART(UART.UART2, Settings().hardware.printer.cnc.grbl.baudrate)
diff --git a/src/krux/printers/thermal.py b/src/krux/printers/thermal.py
index a3c56fd..71c47e7 100644
--- a/src/krux/printers/thermal.py
+++ b/src/krux/printers/thermal.py
@@ -56,12 +56,12 @@ class AdafruitPrinter(Printer):
fm.register(
Settings().hardware.printer.thermal.adafruit.tx_pin,
fm.fpioa.UART2_TX,
- force=False,
+ force=True,
)
fm.register(
Settings().hardware.printer.thermal.adafruit.rx_pin,
fm.fpioa.UART2_RX,
- force=False,
+ force=True,
)
self.uart_conn = UART(
Why this scored 28/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.