Skip to content

Flashing Arduino OPTA bricks serial port. #845

@lufixSch

Description

@lufixSch

When flashing the Arduino OPTA with my PlatformIO project the first time, everything works fine. On the second try I get the following error:

Processing opta (platform: https://github.com/platformio/platform-ststm32.git; board: opta; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/opta.html
PLATFORM: ST STM32 (19.1.0+sha.d32bbfa) > Arduino Opta
HARDWARE: STM32H747XIH6 480MHz, 511.35KB RAM, 768KB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, jlink, stlink)
PACKAGES: 
 - framework-arduino-mbed @ 4.2.4 
 - tool-dfuutil-arduino @ 1.11.0 
 - tool-openocd @ 3.1200.0 (12.0) 
 - tool-stm32flash @ 0.7.0 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 42 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/opta/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  10.9% (used 57088 bytes from 523624 bytes)
Flash: [=         ]  14.2% (used 111544 bytes from 786432 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, dfu, jlink, mbed, stlink
CURRENT: upload_protocol = dfu
Looking for upload port...
Auto-detected: /dev/ttyS0
Forcing reset using 1200bps open/close on port /dev/ttyS0
Waiting for the new upload port...
Uploading .pio/build/opta/firmware.bin
dfu-util 0.11-arduino4

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: No DFU capable USB device available
*** [upload] Error 74
================================================================= [FAILED] Took 10.31 seconds ==

In this state flashing is not possible neither with PlatformIO nor with the Arduino IDE.

To flash the OPTA again, the reset button has to be pressed twice, bringing it into bootloader mode. Unfortunately flashing in this state is not possible with PlatformIO:

Processing opta (platform: https://github.com/platformio/platform-ststm32.git; board: opta; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/opta.html
PLATFORM: ST STM32 (19.1.0+sha.d32bbfa) > Arduino Opta
HARDWARE: STM32H747XIH6 480MHz, 511.35KB RAM, 768KB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, jlink, stlink)
PACKAGES: 
 - framework-arduino-mbed @ 4.2.4 
 - tool-dfuutil-arduino @ 1.11.0 
 - tool-openocd @ 3.1200.0 (12.0) 
 - tool-stm32flash @ 0.7.0 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 42 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/opta/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  10.9% (used 57088 bytes from 523624 bytes)
Flash: [=         ]  14.2% (used 111544 bytes from 786432 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, dfu, jlink, mbed, stlink
CURRENT: upload_protocol = dfu
Looking for upload port...
Auto-detected: /dev/ttyACM0
*** [upload] Broken pipe
================================================================= [FAILED] Took 0.35 seconds =================================================================

Using the Arduino IDE the OPTA can be flashed without any issues. Afterward it can be flashed without pressing the reset button. Until it is flashed again with PlatformIO.

I also observed, that any use of the Serial interface is not possible (when compiling and flashing with PlatformIO). Which could be related to the flashing issue and/or #835 and/or #763

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions