Make Upload Error

General topics and discussions about the VESC and its development.
bigginsking
Posts: 4
Joined: 27 Feb 2018, 05:15
Location: San Diego

Make Upload Error

Postby bigginsking » 24 Apr 2018, 03:56

Hi,
I'm on Ubuntu 16.04... with a new discovery board.

I'm just getting started and having trouble getting the firmware to upload to the V-ESC. I understand that you can copy the .bin over to the discovery board but I don't see the discovery board as an additional drive.

I was not able to navigate around the "sudo reload udev" command failing because of the change from upstart to systemd but I think that running the make upload command as super user (sudo make upload) would get around that issue.

Here is the error:

Code: Select all

bill@bill-Aspire-5740:~/BLDC/bldc-firmware$ sudo make upload
[sudo] password for bill:
openocd -f board/stm32f4discovery.cfg -c "reset_config trst_only combined" -c "program build/BLDC_4_ChibiOS.elf verify reset exit" # For openocd 0.9
Open On-Chip Debugger 0.9.0 (2018-01-24-01:05)
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
trst_only combined trst_push_pull
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
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.877745
Error: init mode failed (unable to connect to the target)
in procedure 'program'
in procedure 'init' called at file "embedded:startup.tcl", line 473
in procedure 'ocd_bouncer'
** OpenOCD init failed **
shutdown command invoked

Makefile:271: recipe for target 'upload' failed
make: *** [upload] Error 1
bill@bill-Aspire-5740:~/BLDC/bldc-firmware$


The STLink comes up under the dmesg | tail command:

Code: Select all

bill@bill-Aspire-5740:~/BLDC/bldc-firmware$ dmesg | tail
[21483.090778] usb 2-1.3: Product: STM32 STLink
[21483.090781] usb 2-1.3: Manufacturer: STMicroelectronics
[21483.090784] usb 2-1.3: SerialNumber: Hÿt\xffffffc2\xffffff82\xffffffc2\xffffff80QIEP\xffffffc2\xffffff81
[22150.444053] usb 2-1.3: USB disconnect, device number 10
[22178.741046] usb 2-1.3: new full-speed USB device number 11 using ehci-pci
[22178.851958] usb 2-1.3: New USB device found, idVendor=0483, idProduct=3748
[22178.851963] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[22178.851966] usb 2-1.3: Product: STM32 STLink
[22178.851969] usb 2-1.3: Manufacturer: STMicroelectronics
[22178.851972] usb 2-1.3: SerialNumber: Hÿt\xffffffc2\xffffff82\xffffffc2\xffffff80QIEP\xffffffc2\xffffff81
bill@bill-Aspire-5740:~/BLDC/bldc-firmware$


Thanks for any and all help.

arvidb
Posts: 228
Joined: 26 Dec 2015, 14:38
Location: Sweden, Stockholm

Re: Make Upload Error

Postby arvidb » 24 Apr 2018, 17:20

How are you powering the VESC? The target voltage seems strange.

bigginsking
Posts: 4
Joined: 27 Feb 2018, 05:15
Location: San Diego

Re: Make Upload Error

Postby bigginsking » 25 Apr 2018, 22:45

yeah, I was expecting something more like 3.3 V.

I've tried both with the the V-ESC powered with 36V and no power to the V-ESC, just the USB power to the discovery board.

I've got some connectors coming tonight that will let me try a shorter programming cable(I'm currently using a sensor wire and adapater that is around 15 cm long).

I'll report back if that cures the issue.

I'm still bothered by the flash drive not coming up, seems like that would be an easy work around.

bigginsking
Posts: 4
Joined: 27 Feb 2018, 05:15
Location: San Diego

Re: Make Upload Error

Postby bigginsking » 26 Apr 2018, 00:52

I tried again with a programming wire that is about 6 cm long, no difference.

Any ideas?

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

Re: Make Upload Error

Postby rew » 30 Apr 2018, 06:45

That "target voltage" line is always weird.

The official programmers always have this as an input on the programmer, if it would be a power-to-the-target, you cannot know how much power the target will need and you could get into trouble.

On my programmers the software always reports something like: Target voltage: 6.32322 V. i.e. way too much. But I always connect a power output on the programmer side and my boards never use more than say 50mA on the 3.3V.

If you are using the official programmer on a discovery board with the two jumpers removed... IIRC my discovery boards run at 3.0V for VCC.

Anyway... you could try downloading with st-flash for instance:

Code: Select all

 st-flash --reset write build/BLDC_4_ChibiOS.bin 0x08000000

bigginsking
Posts: 4
Joined: 27 Feb 2018, 05:15
Location: San Diego

Re: Make Upload Error

Postby bigginsking » 03 May 2018, 03:34

OK, per Rew's advice I've got the st-flash bit working, that puts the firmware on the discovery board, how then does one get the firmware from the discover board on to the V-ESC target?

To get the firmware on to the discovery board I did have to install the jumpers(they were removed for the initial try at moving the firmware).

With the jumpers installed I get this very satisfying exchange with my silicon based companion:

Code: Select all

bill@bill-Aspire-5740:~/stlink/stlink/build/Release$ st-flash --reset write BLDC_4_ChibiOS.bin 0x08000000
st-flash 1.4.0-35-gb1b2a2f
2018-05-02T20:28:51 INFO usb.c: -- exit_dfu_mode
2018-05-02T20:28:51 INFO common.c: Loading device parameters....
2018-05-02T20:28:51 INFO common.c: Device connected is: F4 device (low power) - stm32f411re, id 0x10006431
2018-05-02T20:28:51 INFO common.c: SRAM size: 0x20000 bytes (128 KiB), Flash: 0x80000 bytes (512 KiB) in pages of 16384 bytes
2018-05-02T20:28:51 INFO common.c: Ignoring 4 bytes of 0xff at end of file
2018-05-02T20:28:51 INFO common.c: Attempting to write 206796 (0x327cc) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08020000 erasedEraseFlash - Sector:0x5 Size:0x20000
2018-05-02T20:28:55 INFO common.c: Finished erasing 6 pages of 131072 (0x20000) bytes
2018-05-02T20:28:55 INFO common.c: Starting Flash write for F2/F4/L4
2018-05-02T20:28:55 INFO flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 10188
2018-05-02T20:29:01 INFO common.c: Starting verification of write complete
2018-05-02T20:29:05 INFO common.c: Flash written and verified! jolly good!
bill@bill-Aspire-5740:~/stlink/stlink/build/Release$


And while satisfying to see something working right I don't know how to get the firmware from there to the V-ESC. I tried removing the jumpers, attaching the V-ESC per the hook up instructions and then running the command again but no success.

So, what's next after moving the firmware to the discovery board?

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

Re: Make Upload Error

Postby rew » 03 May 2018, 06:35

Flashing the binary into the F411 on the discovery board is an "exercise" to see if you have the software and commands set up correctly.

The next step is to remove the jumpers hook up the cable to the target VESC and program the VESC. If that does not work, it would seem your connections are not correct or your VESC is broken. The error messages you get in THAT case are more important than showing you succesfully programmed the '411 on your discovery board.


Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests