Closed iliis closed 3 years ago
@iliis Aha! You have found a bug in the uart driver. Try this patch to Sming/Arch/Esp8266/Components/driver/uart.cpp
:
diff --git a/Sming/Arch/Esp8266/Components/driver/uart.cpp b/Sming/Arch/Esp8266/Components/driver/uart.cpp
index e6c50b94f..22114d381 100644
--- a/Sming/Arch/Esp8266/Components/driver/uart.cpp
+++ b/Sming/Arch/Esp8266/Components/driver/uart.cpp
@@ -910,9 +910,9 @@ void smg_uart_swap(smg_uart_t* uart, int tx_pin)
bool smg_uart_set_tx(smg_uart_t* uart, int tx_pin)
{
if(uart != nullptr && uart->uart_nr == UART0 && smg_uart_tx_enabled(uart)) {
- uart1_pin_restore(uart->tx_pin);
+ uart0_pin_restore(uart->tx_pin);
uart->tx_pin = (tx_pin == 2) ? 2 : 1;
- uart1_pin_select(uart->tx_pin);
+ uart0_pin_select(uart->tx_pin);
return true;
}
That was quick! And yes, it works :)
I'm using a H801 LED driver board, which uses GPIO2 to transmit UART0 data. The following works:
While this does not:
In both cases I receive the bootloader output (at 74480 baud), but only the first version produces anything when calling
Serial.write()
.I've tried both with the current develop (bdf1d31db839385a8e1075f901b9cd95d6fb538d) and master (4.2.0, 7bc3603e22ca91c36d0b6b1bcfa96b5801afa325) branches. Toolchain is https://github.com/SmingHub/SmingTools/releases/download/1.0/x86_64-linux-gnu.xtensa-lx106-elf-e6a192b.201211.tar.gz