You are here

Custom hardware flash problems

5 posts / 0 new
Last post
Last seen: 2 weeks 8 hours ago
Joined: 2018-09-27 11:10
Posts: 4
Custom hardware flash problems


I developed my own hardware for a project because I needed better cooling and wanted to avoid SMD transistors.
As reference, I nearly copied the VESC6.4 schematic and only changed the 3.3V regulator, the shunts from 0.5mOhms to 1mOhm and the INA240A (gain 50) instead of the ADs (gain 20).
For building the firmware I set up a VM with Ubuntu 20.10 and cloned all reps. For the custom configuration I copied the hardware config file hw_60.h/.c, renamed it and changed the values accordingly.
After I build the firmware I did not know how to proceed, so I flashed the default 60_MK4 firmware and hoped to be able to flash my firmware inside the vesc tool.
But now I have the problem, that I always get an erase timeout when I try to update the firmware.
What could be the reason for this?

Most of the assembly was done by my PCB manufacturer.
The DRV8301 produces nice 5.1V and the 3.3V are clean as well, hence the USB communication works fine.
Power draw during idle at 12V is around 40mA.

Best regards

Last seen: 2 weeks 8 hours ago
Joined: 2018-09-27 11:10
Posts: 4

I managed to flash the default 60_MK4 firmware and loaded the bootloader via vesc tool.
Now I have the problem that I can't get a motor to run.
In the motor configuration the VESC manages to measure all the parameters even tho no more current is drawn from my power supply or the motor is moving.
I also observed that the STM32 is not communicating with the DRV on startup. Is this supposed to be like this? I thought that the DRV needs to be configured before use.

Last seen: 2 months 3 weeks ago
VESC FreeVESC Original
Joined: 2017-09-11 11:46
Posts: 222

It'd probably help to have a schematic and screenshots of any errors.

Last seen: 2 days 10 min ago
Joined: 2018-08-17 07:26
Posts: 431

If you can't write the FW, the CPU may be not connected correctly. The first thing I would check is make sure CPU is getting stable power and BOOT0/RST are pulled down and up correspondingly. 



NextGen FOC High voltage 144v/34s, 30kw (

Last seen: 2 weeks 8 hours ago
Joined: 2018-09-27 11:10
Posts: 4

Thank you for your answers.
Attached you can find my schematic as well as the layout of the DRV.
I had a bit of fun with my oscilloscope and found the following things:
- At startup the STM32 sends data over SPI, but both MOSI and MISO are always low. Don't know if this is supposed to be. CS is pulled low five times and SCLK is toggling. None of the pins is shorted to GND or +3.3V.
- FAULT and EN_GATE are high, so no problems there, also not shorted.
- When connected to the VESC Tool it reacts to keyboard controls. All six PWM outputs of the STM32 show signals.
- The DRV creates proper bootstrap voltage on the capacitors, all the capacitors on DVDD, REF, CP1/2, DTC etc. show volages.
- Only the PWM signals from the STM32 are not passed through by the DRV

Sometimes I also get the following fault logs:


Also a big source of potential errors: I am using 1 mOhm shunts instead of 0.5 mOhm ones and my amplifiers have a gain of 50 instead of 20. This results in 5 times higher interpreted currents. 
NRF and MPU are also not implemented in my design and left open.
Because I am not sure if my custom firmware build is free of faults, could someone please build one for me? My reference schematic was VESC 6.4.

EDIT: here is also my layout around the DRV