Uploading code / PWR Jumper - What am I doing wrong?
I am quite new to STM32 and never worked with a Nucleo before.
I am trying to control two motors (from a hoverboard) with a Nucleo F446RE. I found a perfect example with libraries and example code on GitHub, but somehow ... it doesn't work.
I am working after these wiring instructions...
https://hackaday.io/project/13347/instructions
Wiring is definitely done correctly.
Using this as code...
https://github.com/majinstudios/OpenChair/tree/master/Software
The problem is, that I am literally not getting any reaction from the motors, and I feel like it's neither a hardware, nor a software problem. More like ... I am doing something wrong about uploading / setting it up.
On the Hack-A-Day instructions, the PWR jumper is supposed to be set to E5V. While it's on E5V, I can't program the board without an external power supply. I tried both. Uploading with an external power supply attached and E5V, and uploading when jumpered to U5V. Uploading works, but I am getting some errors.
[05/03/18 10:08:38] Processing nucleo_f446re (platform: ststm32; board: nucleo_f446re; framework: mbed)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` optionPLATFORM: ST STM32 > ST Nucleo F446RESYSTEM: STM32F446RET6 180MHz 128KB RAM (512KB Flash)DEBUG: CURRENT(stlink) ON-BOARD(stlink) EXTERNAL(blackmagic, jlink)Library Dependency Finder ->
https://community.st.com/bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(light)Collected 16 compatible librariesScanning dependencies...Dependency Graph|-- <OpenChair>Configuring upload protocol...AVAILABLE: blackmagic, jlink, mbed, stlinkCURRENT: upload_protocol = stlinkUploading .pioenvs\nucleo_f446re\firmware.elfGNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00392-gbe9ef0b0 (2018-01-12-15:03)Licensed under GNU GPL v2For bug reports, readhttps://community.st.com/openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWDadapter speed: 2000 kHzadapter_nsrst_delay: 100none separatesrst_only separate srst_nogate srst_open_drain connect_deassert_srstInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : clock speed 1800 kHzError: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTEDInfo : STLINK v2 JTAG v30 API v2 SWIM v20 VID 0x0483 PID 0x374BInfo : using stlink api v2Info : Target voltage: 3.262549Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpointsInfo : Listening on port 3333 for gdb connectionsInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : Unable to match requested speed 2000 kHz, using 1800 kHzadapter speed: 1800 kHztarget halted due to debug-request, current mode: ThreadxPSR: 0x01000000 pc: 0x08001774 msp: 0x20020000Info : Unable to match requested speed 8000 kHz, using 4000 kHzInfo : Unable to match requested speed 8000 kHz, using 4000 kHzadapter speed: 4000 kHz** Programming Started **auto erase enabledInfo : device id = 0x10006421Info : flash size = 512kbytestarget halted due to breakpoint, current mode: ThreadxPSR: 0x61000000 pc: 0x20000046 msp: 0x20020000wrote 49152 bytes from file .pioenvs\nucleo_f446re\firmware.elf in 1.581122s (30.358 KiB/s)** Programming Finished **** Verify Started **target halted due to breakpoint, current mode: ThreadxPSR: 0x61000000 pc: 0x2000002e msp: 0x20020000target halted due to breakpoint, current mode: ThreadxPSR: 0x61000000 pc: 0x2000002e msp: 0x20020000verified 46352 bytes in 0.207147s (218.519 KiB/s)** Verified OK **** Resetting Target **Info : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : Unable to match requested speed 2000 kHz, using 1800 kHzadapter speed: 1800 kHzshutdown command invokedThis is the console output from VSCode / PlatformIO when uploading.
The code seems to run (I can see serial outputs about the analog sticks position), but sice I am trying to communicate with a mainboard ...
- Does it make a difference if I change from U5V to E5V after uploading my firmware?
- Do the '
Unable to match requested speed' lines mess up the function?
Is this 'libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED' important for it to work?
What else could I be doing wrong? My workflow so far is:
Use VSCode with PlatformIO
Open the whole Software folder on Github as a project (it has a platformio.ini) including the library
Select my MCU
BUILD
UPLOAD
What other info could I provide? What else can I try? I am trying to get this done as a part of a prototype for a presentation and basically just need this pre-done code to run on the nucleo.
Any help is greatly appreciated!
#nucleo-f446re #vscode #platformio #stm32f4