https://toitlang.org/ logo
💥 ESP32-C3 mini crashes when using 2 uarts
# help
k
In a test application, two UARTs are used for a LD2450 and a Pixelstrip. As soon as the second UART is opened, the system crashes. https://cdn.discordapp.com/attachments/1432771183681474620/1432771184369336430/message.txt?ex=6902ec65&is=69019ae5&hm=3b0840206fdd37db6f963a728887f9dcada39cf2ff951161f3b8d0dacea7464c&
f
Note that the C3 has only 2 uarts. If one of them is used for the console, then only one other is free. Most C3 boards I know don't use the UART for logging, though.
k
Thank you for the notice. (Would access to a non-existent resource need to be blocked?)
f
Toit definitely has a bug here. It might be that it is confused and thinks that UART0 is always reserved for console. Even on boards that use USB instead.
z
The C6 also has 2 UARTs. Can we make a software UART or do we need to depend on the UART peripheral from the ESP32? e.g. if we want 3 total UARTs - UART0 for the serial console; and 2 peripherals that talk to each other through serial
f
Depends. I think one can use the RMT for serial simulation, but more common is to have one uart that switches between different pins depending on who to talk to. If the devices are poll based that works fine. If they are emitting data on their own then you probably want to try the RMT.