STM32 Nucleo Board and MATLAB serial communication.

9 visualizaciones (últimos 30 días)
mcan06
mcan06 el 30 de Mayo de 2022
Respondida: Abhinav Aravindan el 12 de Nov. de 2024
When I'm reading data from serial port on STM32 Nucleo Board in MATLAB, I got the following warning and I couldn't read data.
Code:
s = serialport('COM6', 460800)
flush(s);
data = readline(s);
Warning: The specified amount of data was not returned within the Timeout period for 'readline'. 'serialport' unable to read any data.

Respuestas (1)

Abhinav Aravindan
Abhinav Aravindan el 12 de Nov. de 2024
Hi @mcan06,
The Warning you are facing may be due to one of following reasons:
  1. An invalid command was sent to the device, so there is a problem reading the response to the command.
  2. Your device is connected to an incorrect serial port.
  3. An incorrect write terminator was sent to the instrument before attempting to read data, so there is no data to read.
  4. Your device is not configured to send data on the serial port.
You may refer to the following documentation for the troubleshooting steps:
A similar query related to using the STM32 Nucleo Board with “serialport has been answered here for your reference:

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by