arduino nano ble 33 rx/tx UART problems

Hello,

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?

Baudrate is 115200.

I had no problems to communicate from Nano 33 BLE to esp8266 AT firmware at 115200 baud. Did you wire ground together? Can you show your code?

Hi,

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.

The Library is here:
https://github.com/gianmarcov/arduino_vesc/tree/develop

Sketch:
#include "vesc.h"

Vesc vesc;

void setup() {
Serial.begin(9600); // console
Serial1.begin(115200, SERIAL_8N1); // vesc comm
vesc.init((HardwareSerial*) &Serial1, &Serial);
}

void loop() {
vesc.setDuty(0.2);
delay(100);
}

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.

Hi,

The problem is writing not reading, reading works.

Hello,

I have good and bad news:

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?

RX -> NRF_GPIO_PIN_MAP(1,10),
TX -> NRF_GPIO_PIN_MAP(1,03),

variant.cpp

P1_3, NULL, NULL, // D0/TX
P1_10, NULL, NULL, // D1/RX

I created the issue and found the problem.

For the nano 33 BLE Serial.write(buffer, len) is not implemented.

gianmarcov:
I created the issue and found the problem.

For the nano 33 BLE Serial.write(buffer, len) is not implemented.

how did I send then data with write(buffer, len) to esp8266 AT firmware?
the implementation is in base class Print