I created a new library to communicate with other device via UART, with the Arduino IDE and the ESP32 WROOM32
it's works very nice and a can write and read from UART without Problems, crc sum are ok etc.
I ordered many arduino nano ble because it has a better power consuption then the ESP32.
I copied the sketch and changed the Serial2 to Serial1, it compiles, but the other Device doesn't receive nothing or maximum 2 Bytes, the cable between the two devices are vey short, i tried many things without positive results.
On the Board is printed TX1 and RX0 on many boards the numbers are the same RX0 / TX0.
Can it be that the port mapping is wrong in the mbed arduino library?
Thank you for the reply, the GND and VIN is connected to the VESC board and get current from there.
VESC rx to tx and vesc tx to rx. I will try to programm the nano ble via swd headers without arduino ecosystem and look if it's works then.
you don't expect a gap between bytes at receiving, but the MCU is much faster then UART. you read -1 if the RX buffer is empty because the bytes didn't arrive yet.
I use readBytes and readBytesUntil. This functions waits for the next byte until timeout. The default timeout is 1000 milliseconds. it can be set with setTimeout.
It is better to use Stream base class for references to Serial. Stream is the base class of all kind of Arduino input/output classes.
Good:
I created with the NRF52 SDK the code without arduino ide etc. to send the command via uart, i flashed the code via SWD and now it's works, i receive data on the other side.
Bad:
The error is in the Arduino library, where can i create a ticket for fixing them?