Hi,
I am using a custom developed PCB with ESP32-C6-WROOM-1 module. ESP-IDF version 5.4
I am using UART to communicate between two boards.
I have initialized the UART as specified in the ESP-IDF programming reference and using uart_write_bytes() method to send data over UART. I have found that, additional junk bytes are getting transmitted in addition to the number of bytes specified in the uart_write_bytes() method.
Suspecting my code, I ran the sample code "uart_async_rxtxtasks" with following minimal changes
- UART Port and pin number changes
- The data transmitted periodically has been changed to "AAAAA" instead of "Hello_world". This is for easy monitoring the bits on CRO
- Disabled the rxTask.
I am observing the same behaviour in the sample code also. ie I am observing extra bytes are being sent over the TxD line, though the extra bytes count was different. In the sample code I find 30+ additional characters are sent in addition to the 5 characters specified in the code. i.e "AAAAA"
Below is the code.
I am attaching the CRO image capturing the transmitted bytes
At 115200 baud, 5 bytes should take approximately 500 uSec. However I the transfer duration seems to be more than 3 mSec which indicates additional characters are being sent. I have also verified that the 5 bytes transferred as part of uart_write_bytes() occupying the first 5 bytes of the transfer.
Any suggestions to resolve the above issue?
Thanks
ESP32-C6: UART uart_write_bytes() method sends extra junk bytes
-
jawahararumugam
- Posts: 2
- Joined: Wed May 07, 2025 4:04 am
ESP32-C6: UART uart_write_bytes() method sends extra junk bytes
- Attachments
-
- IMG20250507092925.jpg (324.15 KiB) Viewed 81 times
-
jawahararumugam
- Posts: 2
- Joined: Wed May 07, 2025 4:04 am
Re: ESP32-C6: UART uart_write_bytes() method sends extra junk bytes
Hi,
I used UART0 in the code, without realizing that ESP_LOG also uses the same port.
Extra bytes I observed are due to ESP_LOG.
The issue is resolved. Thanks
I used UART0 in the code, without realizing that ESP_LOG also uses the same port.
Extra bytes I observed are due to ESP_LOG.
The issue is resolved. Thanks
-
MicroController
- Posts: 2705
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: ESP32-C6: UART uart_write_bytes() method sends extra junk bytes
Could anything else be using UART0 concurrently? (Secondary) logging output, for example?
Who is online
Users browsing this forum: DuckDuckGo [Bot], Google [Bot] and 1 guest