Skip to content

Conversation

@gleniosp
Copy link

🦟 Bug fix

Fixes #288

Summary

By adding a sleep right after the serial port opening in the MotorDrive::Setup method, it eliminates the response timed out errors when talking to the MCU (in the Arduino board). This way, once the port is opened, the MCU has time to boot up and stabilize after the MCU reset caused by opening the serial port the first time. The sleep is also added before configuring the DTR setting for the port, otherwise it can trigger a 2nd reset while the MCU is still booting up from the first reset, causing timing issues later.

Then, possibly due to these timing issues, having the sleep applied only after calling the MotorDrive::Setup method as it is now in the Motor Demo App didn't properly work as well. Therefore, now that sleep is added right after the serial port is opened in MotorDrive::Setup, we can also remove the sleep from the Motor Demo App as it doesn't seem to be required anymore (no timeout errors were observed).

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@gleniosp gleniosp force-pushed the gleniosp/fix_serial_port_timeout branch from cc2c74d to b3ac98f Compare September 15, 2025 09:11
@francocipollone
Copy link
Collaborator

Thanks for the contribution! Let me try it locally first and I will be glad to merge it :D

@gleniosp
Copy link
Author

Thanks for the contribution! Let me try it locally first and I will be glad to merge it :D

Thanks, @francocipollone! Sounds good 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 Backlog

Development

Successfully merging this pull request may close these issues.

Arduino serial port response time out

2 participants