2018-05-03 01:39 AM
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 ...
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 #stm32f42018-05-03 02:01 PM
Trying to run before learning to crawl?
Start with a blinky (blinking LED with loop delay).
JW
2018-05-03 02:35 PM
Does it make a difference if I change from U5V to E5V after uploading my firmware?
No.
Do the '
Unable to match requested speed' lines mess up the function?
No.
Is this 'libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED' important for it to work?
No. (I guess here, but as programming and verification apparently worked, it shouldn't be of significance).
If you are still uncertain whether programming went OK, you can also try to use the STLink Utility (or the new javoid which I don't favour so I don't even remember its name) as a tool for programming.
I am not going to find out the details of your (or someone else's) application, sorry.
JW
2018-05-03 04:06 PM
I actually started out with a blinky, which worked just fine. I am also aware of the fact, that this is not as easy as Arduino.
I am just a bit short in time right now (got a presentation soon and an additional prototype would be nice), so I was hoping for an easy solution to my problem - or for a hint about what I am doing wrong here. On the long run, I am surely willing to learn how to run.
2018-05-03 05:21 PM
Thanks for the reply! I never intended to have anyone look into the details. This is only about the general way of uploading code to a STM32. Links were only provided to give a hint about the topic I am working on.
I'll check out STLink Utility! Still a help to know that the errors I am getting aren't the actual problem. (Even tho I was kind of hoping they were so I could investigate).
Have a nice evening, sir!
2018-05-03 07:55 PM
It's hard to gather my head around your entire project but something sounds like the input power which generates the E5V voltage is not working. On most of the motor control shields I have used you must add external 12V-24V to them which then gets regulated down to the E5V pins...do you have this?