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
ivankravets commentedon Sep 5, 2026
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#L158It means you can use
PySerialand do whatever you need with the board.Does it sound difficult?
jcw commentedon Sep 5, 2026
Thanks for those starting points. Looks good, I'll need to dive into this.