telnetspy icon indicating copy to clipboard operation
telnetspy copied to clipboard

Linker error when building for ESP32-C3

Open contactalexliu opened this issue 1 year ago • 0 comments

When building a project in PlatformIO targeting the ESP32-C3, the linker throws the following error:

Linking .pio\build\m5stamp-c3\firmware.elf
c:/users/a/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: .pio\build\m5stamp-c3\libda1\libTelnetSpy.a(TelnetSpy.cpp.o): in function `TelnetSpy::debugWrite(unsigned char)':
G:\Documents\PlatformIO\Projects\Mux Controller/.pio/libdeps/m5stamp-c3/TelnetSpy/TelnetSpy.cpp:346: undefined reference to `ets_write_char_uart'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\m5stamp-c3\firmware.elf] Error 1

Based on this issue in the ESP-IDF repo, it seems ets_write_char_uart() is no longer available for the ESP32-C3. I've managed to bypass this error for now with setDebugOutput(false) and commenting out the debugWrite() and line 520 in TelnetSpy.cpp, but perhaps there is a better solution using the UART driver's uart_tx_chars() instead (I can't seem to find uart_tx_one_char() as suggested in the linked issue in the C3's API reference).

On another note, thank you for all your work on this library!

contactalexliu avatar Jul 20 '22 23:07 contactalexliu