Hello.
I try to use NUCLEO-F303RE(STLink is intact) with Robotdyn RS-232 module and/or DFRobot RS-232 shield. These boards are 100% working with Arduino boards. TX, RX of these boards(one in time) are connected to (PA2, PA3). The code is simple:
#include “mbed.h”
#include “BufferedSerial.h”
// Create a BufferedSerial object with a default baud rate.
BufferedSerial pc(PA_9, PA_10);
int main() {
// Set desired properties
pc.set_baud(9600);
pc.set_format(
/* bits / 8,
/ parity / BufferedSerial::None,
/ stop bit */ 1
);
// Hex string to be sent
uint8_t hex_string[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x82, 0x11, 0x50, 0x43, 0x2A, 0x89};
while (1) {
// Write the hex string to the serial port
pc.write(hex_string, sizeof(hex_string));
// Wait for 10 seconds
ThisThread::sleep_for(10s);
}
}
Nothing happens on a serial port. No data is sent. But if I change to USBTX/RX, I see the data sent to a PC console.
Tried to use (PA9, PA10) instead of (PA2, PA3). Nothing happens.
What`s wrong with it?