Skip to content

Add "break" support to "pio test" ? #5310

Open

Description

@jcw

For STM32 via ST-Link, the RTS and DTR modes to reset an uploaded test app don't work. The documented workaround is to add a 2s startup delay.

To considerably speed things up when running multiple tests, pio test could send a BREAK on the serial port, which does an immediate reset.

Would it be possible to add an option to send a break once connected to the USB serial port?

Activity

  1. ivankravets commented on Sep 5, 2026

    @ivankravets
    Member

    You can set up a Custom Test Runner and override stage_testing. See the base implementation https://github.com/platformio/platformio-core/blob/develop/platformio/test/runners/base.py#L158

    It means you can use PySerial and do whatever you need with the board.

    Does it sound difficult?

  2. jcw commented on Sep 5, 2026

    @jcw
    Author

    Thanks for those starting points. Looks good, I'll need to dive into this.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions