AnsweredAssumed Answered

Uploading code / PWR Jumper - What am I doing wrong?

Question asked by Thomas Weiss on May 3, 2018
Latest reply on May 4, 2018 by redwire

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... Instructions | OpenChair | Hackaday.io 

Wiring is definitely done correctly.

 

Using this as code... OpenChair/Software at master · majinstudios/OpenChair · GitHub 

 

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` option
PLATFORM: ST STM32 > ST Nucleo F446RE
SYSTEM: STM32F446RET6 180MHz 128KB RAM (512KB Flash)
DEBUG: CURRENT(stlink) ON-BOARD(stlink) EXTERNAL(blackmagic, jlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(light)
Collected 16 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <OpenChair>
Configuring upload protocol...
AVAILABLE: blackmagic, jlink, mbed, stlink
CURRENT: upload_protocol = stlink
Uploading .pioenvs\nucleo_f446re\firmware.elf
GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00392-gbe9ef0b0 (2018-01-12-15:03)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : STLINK v2 JTAG v30 API v2 SWIM v20 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.262549
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08001774 msp: 0x20020000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
** Programming Started **
auto erase enabled
Info : device id = 0x10006421
Info : flash size = 512kbytes
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000046 msp: 0x20020000
wrote 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: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20020000
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20020000
verified 46352 bytes in 0.207147s (218.519 KiB/s)
** Verified OK **
** Resetting Target **
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
shutdown command invoked

This 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:  

 

  1. Use VSCode with PlatformIO
  2. Open the whole Software folder on Github as a project (it has a platformio.ini) including the library
  3. Select my MCU
  4. BUILD
  5. 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!

Outcomes