Hi, I have an XIAO ESP32 S3 board and Iwould like to enquire how to set the serial port with SERIAL_8E1 in Arduino IDE, it's first seem to me a simple job as I can set it in ESP32CAM as Serial.begin(115200, SERIAL_8E1), but, when I changed the Board type to "XIAO_ESP32S3" in the IDE, this function did not accept two parameters!
Note: I had tried to change the board type in the Arduino IDE like ESP32S3 CAM LCD, but it does not work even the compilation passed.
XIAO ESP32 S3 Serial Setting with Even Parity
-
- Posts: 826
- Joined: Mon Jul 22, 2019 3:20 pm
Re: XIAO ESP32 S3 Serial Setting with Even Parity
Please post code and the compiler error
Re: XIAO ESP32 S3 Serial Setting with Even Parity
Hi, the error can be simply inputted as shown:
Here is the error:
- #include "Arduino.h"
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(115200, SERIAL_8E1);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- }
Here is the error:
C:\Users\send2\AppData\Local\Temp\.arduinoIDE-unsaved2024025-19796-bkeync.38qx\sketch_jan25a\sketch_jan25a.ino: In function 'void setup()':
C:\Users\send2\AppData\Local\Temp\.arduinoIDE-unsaved2024025-19796-bkeync.38qx\sketch_jan25a\sketch_jan25a.ino:6:32: error: no matching function for call to 'HWCDC::begin(int, SerialConfig)'
Serial.begin(115200, SERIAL_8E1);
^
In file included from C:\Users\send2\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\cores\esp32/HardwareSerial.h:53,
from C:\Users\send2\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\cores\esp32/Arduino.h:184,
from C:\Users\send2\AppData\Local\Temp\.arduinoIDE-unsaved2024025-19796-bkeync.38qx\sketch_jan25a\sketch_jan25a.ino:1:
C:\Users\send2\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\cores\esp32/HWCDC.h:55:10: note: candidate: 'void HWCDC::begin(long unsigned int)'
void begin(unsigned long baud=0);
^~~~~
C:\Users\send2\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\cores\esp32/HWCDC.h:55:10: note: candidate expects 1 argument, 2 provided
exit status 1
Compilation error: no matching function for call to 'HWCDC::begin(int, SerialConfig)'
-
- Posts: 826
- Joined: Mon Jul 22, 2019 3:20 pm
Re: XIAO ESP32 S3 Serial Setting with Even Parity
Ok, so that is saying that your Serial object is connected to the USB-CDC. USB doesn't have any concept of parity/stop bits (or even baud, really), so it is not possible to change it in this case.
Re: XIAO ESP32 S3 Serial Setting with Even Parity
Yes, this is my description, and so I asked for alternation of any possible system setup method.
And I really wish the Espressif will consider to extend the overloading of the method Serial.begin( ) as it is a too narrow function for XIAO S3.
And I really wish the Espressif will consider to extend the overloading of the method Serial.begin( ) as it is a too narrow function for XIAO S3.
Re: XIAO ESP32 S3 Serial Setting with Even Parity
Further information of my question, is that I just want the TX port (pin) of the XIAO to be even parity and not its USB Serial emulation.
-
- Posts: 826
- Joined: Mon Jul 22, 2019 3:20 pm
Re: XIAO ESP32 S3 Serial Setting with Even Parity
Serial is an object owned by arduino. When you choose "Enable CDC on Boot", it is attached to the USB-CDC. You cannot set the parity on this.
The data coming across on uart0 is then managed by the esp-idf driver, and is attached to the console (STDOUT). If you want to receive that console data at different settings, you would need to modify the esp-idf settings:
There is no way to change the parity setting until setup runs, so you will miss the initial boot logging if your receiver is fixed on 8E1.
The data coming across on uart0 is then managed by the esp-idf driver, and is attached to the console (STDOUT). If you want to receive that console data at different settings, you would need to modify the esp-idf settings:
Code: Select all
uart_set_parity(UART_NUM_0, UART_PARITY_EVEN);
Re: XIAO ESP32 S3 Serial Setting with Even Parity
Ok, thanks for your advice.
Who is online
Users browsing this forum: No registered users and 62 guests