6 years, 5 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:

<<code>>#include "mbed.h"

  1. define TX_PIN PB_6
  2. 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"); } } <</code>>

Laptop 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)