Quantcast
Viewing all articles
Browse latest Browse all 5986

Why am I being told "Failed init device" when I try to upload a file to my stm32 device?

I am trying to use platformio to program an stm32 device with libopencm3 on a laptop running ubuntu. The code compiles but when I try to run it it doesn't work an instead says it "Failed to init device" and "*** [upload] Error 1".

It isn't that it can't see the device because if I try to upload it without anything plugged in it gives a different error. I suspect it might be because my 99-platformio-udev.rules. I tried to follow the instructions on the platformio site. To that end I do have a file named 99-platformio-udev.rules at /etc/udev/rules.d/99-platformio-udev.rules that does match the most updated one on the website and did do sudo service udev restart, however I think I might be doing the next step wrong. It says

Ubuntu/Debian users may need to add own “username” to the “dialout” group if they are not “root”, doing this issuing

sudo usermod -a -G dialout $USERsudo usermod -a -G plugdev $USER

but I'm not sure what it means by that, so I tried to run the commands as is but I'm assuming that is wrong. What should I do? Below I will put the devices connection to the laptop, how I inputed the command, and the full output/error. If there is any other information needed please ask

the connection

my usermod command

Processing genericSTM32F446RE (platform: ststm32; board: genericSTM32F446RE; framework: libopencm3)------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` optionCONFIGURATION: https://docs.platformio.org/page/boards/ststm32/genericSTM32F446RE.htmlPLATFORM: ST STM32 (17.3.0) > STM32F446RE (128k RAM. 512k Flash)HARDWARE: STM32F446RET6 180MHz, 128KB RAM, 512KB FlashDEBUG: Current (blackmagic) External (blackmagic, jlink, stlink)PACKAGES:  - framework-libopencm3 @ 1.10000.200730 (1.0.0)  - tool-dfuutil @ 1.11.0  - tool-dfuutil-arduino @ 1.11.0  - tool-openocd @ 3.1200.0 (12.0)  - tool-stm32duino @ 1.0.1  - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)LDF: Library Dependency Finder -> https://bi{need to seperate the next part to post because its a shortened url but its one line}t.ly/configure-pio-ldfLDF Modes: Finder ~ chain, Compatibility ~ softFound 0 compatible librariesScanning dependencies...No dependenciesBuilding in release modeChecking size .pio/build/genericSTM32F446RE/firmware.elfAdvanced Memory Usage is available via "PlatformIO Home > Project Inspect"RAM:   [          ]   0.0% (used 12 bytes from 131072 bytes)Flash: [          ]   0.3% (used 1692 bytes from 524288 bytes)Configuring upload protocol...AVAILABLE: blackmagic, dfu, jlink, serial, stlinkCURRENT: upload_protocol = serialLooking for upload port...Auto-detected: /dev/ttyACM0Uploading .pio/build/genericSTM32F446RE/firmware.binFailed to init device.stm32flash Arduino_STM32_0.9http://github.com/rogerclarkmelbourne/arduino_stm32Using Parser : Raw BINARYInterface serial_posix: 115200 8E1*** [upload] Error 1================================================================ [FAILED] Took 1.86 seconds ================================================================ *  The terminal process "platformio 'run', '--target', 'upload'" terminated with exit code: 1.  *  Terminal will be reused by tasks, press any key to close it. 

Viewing all articles
Browse latest Browse all 5986

Trending Articles