Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 12 months ago. This question has been closed. Reason: Off Topic
STM32F410RB Nucleo not reading from serial device.
I have a 3DR radio telemetry system setup between my laptop and the nucleo board. When the nucleo board acts as the TX, it works perfectly fine but when it is needed to act as a RX, it just doesn't read the serial port. The pc2.readable() function in the code always returns 0.
STM32F410RB code:
#include "mbed.h" define TX_PIN PB_6 define RX_PIN PA_10 Serial pc(USBTX, USBRX); RawSerial pc2(TX_PIN, RX_PIN); void recvdData(){ pc.printf("RECIEVED DATA!"); } int main() { pc.baud(57600); pc2.baud(57600); pc.printf("STARTING\n"); while(1) { if(pc2.readable())pc.printf("GOT!\n"); } }
Laptop code:
<<code>>
import serial
import time
board = serial.Serial(port = '/dev/tty.usbserial-DN02136Z', baudrate = 57600 , timeout = 3)
time.sleep(3)
while(1): board.write("ssende\n") time.sleep(0) <</code>>