STM32F4 Discovery "make upload" error

General topics and discussions about the VESC and its development.
michael_wintergarden
Posts: 85
Joined: 10 Aug 2016, 16:14

STM32F4 Discovery "make upload" error

Postby michael_wintergarden » 22 Sep 2016, 13:55

Hi,

I want to connect my STM32F407G-DISC1 with the VESC via UART.
I followed these steps: http://vedder.se/2015/10/communicating- ... sing-uart/

I have Ubuntu and run the following commands:

Code: Select all

sudo apt-get remove binutils-arm-none-eabi gcc-arm-none-eabi
sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi=4.9.3.2015q3-1trusty1
sudo apt-get install build-essential qt-sdk openocd git libudev-dev libqt5serialport5-dev
sudo adduser $USER dialout
sudo apt-get remove modemmanager
wget vedder.se/Temp/49-stlinkv2.rules
sudo mv 49-stlinkv2.rules /etc/udev/rules.d/
sudo reload udev

----connect STM32F4 discovery----
mkdir BLDC
cd BLDC
git clone https://github.com/vedderb/bldc_uart_comm_stm32f4_discovery
cd bldc_uart_comm_stm32f4_discovery
make upload


but I get this error:

Code: Select all

test@test-laptop:~/BLDC_test/STMDiscovery/BLDC/bldc_uart_comm_stm32f4_discovery$ make upload
openocd -f interface/stlink-v2.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f4x_stlink.cfg -c "program build/bldc_uart_test.elf verify reset"
Open On-Chip Debugger 0.7.0 (2013-10-22-08:31)
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.sourceforge.net/doc/doxygen/bugs.html
0x2000
Info : This adapter doesn't support configurable speed
Error: open failed
in procedure 'transport'
** OpenOCD init Failed **
shutdown command invoked
#openocd -f board/stm32f4discovery.cfg -c "reset_config trst_only combined" -c "program build/bldc_uart_test.elf verify reset" # For openocd 0.9
test@test-laptop:~/BLDC_test/STMDiscovery/BLDC/bldc_uart_comm_stm32f4_discovery$


Does anybody know what I did wrong?

Thank you very much.

silviasol
Posts: 10
Joined: 11 Apr 2016, 00:55
Location: United States

Re: STM32F4 Discovery "make upload" error

Postby silviasol » 22 Sep 2016, 16:10


michael_wintergarden
Posts: 85
Joined: 10 Aug 2016, 16:14

Re: STM32F4 Discovery "make upload" error

Postby michael_wintergarden » 22 Sep 2016, 16:33

Hello,

I changed the makefile to this:

Code: Select all

   #openocd -f interface/stlink-v2.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f4x_stlink.cfg -c "program build/$(PROJECT).elf verify reset"
   openocd -f board/stm32f4discovery.cfg -c "reset_config trst_only combined" -c "program build/$(PROJECT).elf verify reset" # For openocd 0.9


But now I get this error:

Code: Select all

test@test-laptop:~/BLDC_test/STMDiscovery/BLDC/bldc_uart_comm_stm32f4_discovery$ make upload
#openocd -f interface/stlink-v2.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f4x_stlink.cfg -c "program build/bldc_uart_test.elf verify reset"
openocd -f board/stm32f4discovery.cfg -c "reset_config trst_only combined" -c "program build/bldc_uart_test.elf verify reset" # For openocd 0.9
Open On-Chip Debugger 0.7.0 (2013-10-22-08:31)
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.sourceforge.net/doc/doxygen/bugs.html
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
trst_only combined trst_push_pull
Info : This adapter doesn't support configurable speed
Error: open failed
in procedure 'transport'
** OpenOCD init Failed **
shutdown command invoked

lizardmech
Posts: 171
Joined: 19 Jan 2016, 10:54
Location: Australia

Re: STM32F4 Discovery "make upload" error

Postby lizardmech » 23 Sep 2016, 04:44

I can't get it to upload on any of my recent discovery boards or MCUs either. I have to build the firmware then flash it using the official ST-link program in windows.

michael_wintergarden
Posts: 85
Joined: 10 Aug 2016, 16:14

Re: STM32F4 Discovery "make upload" error

Postby michael_wintergarden » 23 Sep 2016, 07:07

Hi,

lizardmech wrote:I can't get it to upload on any of my recent discovery boards or MCUs either. I have to build the firmware then flash it using the official ST-link program in windows.


What kind of ST-link program do you use?


Too bad that it doesn't just work with "make upload" anymore....

Instead, I tried something else:
In order to run the BLDC-firmware on my STM32F4 discovery, I connected the board via USB (mini USB) and copied the "BLDC_4_ChibiOS.bin" - file on the flash of my STM32F4 discovery (I guess the newer boards act like a USB-drive as soon as you connect them on the mini usb):
Flashdrive STM32F4.png
Flashdrive STM32F4.png (35.79 KiB) Viewed 3168 times

Then it takes a few seconds and the LD1 of the board switches from red to green.

Then I connected the micro-usb to the board and opened the BLDC-tool..... the connection works!!!!

In order to work with UART, I copied bldc_uart_test.bin to the STM32F4 discovery - flash-drive.


Does anybody know how to create a new .bin file after changing something on the code?

michael_zh
Posts: 8
Joined: 10 May 2017, 03:10

Re: STM32F4 Discovery "make upload" error

Postby michael_zh » 31 Jul 2017, 02:56

hi, michael_wintergarden

sorry to bother you , I met the same problem as you, as you mentioned ,what do you do to make the STM32F4 Discovery act like a USB-drive as soon as you connect them on the mini usb。looks like in this way you could upload the firmware as the photo

rew
Posts: 939
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: STM32F4 Discovery "make upload" error

Postby rew » 31 Jul 2017, 14:42

The latest STLINK included on the discovery boards, are STLINK V2.1 or something like that. Those emulate an USB drive and will flash a binary file copied to that drive to the target processor.

If yours does not do that (like mine) then you've got an older version that doesn't have this firmware. Also I THINK the new firmware is too big for the processor on your STLINK.


Return to “General”

Who is online

Users browsing this forum: No registered users and 3 guests