You are here

How to erase whole flash with OpenOCD?

2 posts / 0 new
Last post
Frazatto
Frazatto's picture
Offline
Last seen: 1 year 6 days ago
Joined: 2018-06-27 15:33
Posts: 18
How to erase whole flash with OpenOCD?

I successfully brought back from the dead a VESC with wrong firmware, now I'm facing a last problem that I can't find a precise answer, maybe you can help.

The problem now is that I have power on the VESC, blue led turns on and STlink is working, but I still get no connection with USB on VESCtool.
It seams very much like the issue described on this thread: https://vesc-project.com/node/545
But I don't understand how to erase the whole flash in OpenOCD.

Yes yes, I searched the documentation and found this:

Command: flash erase_address [pad] [unlock] address length

    Erase sectors starting at address for length bytes. Unless pad is specified, address must begin a flash sector, and address + length - 1 must end a sector. Specifying pad erases extra data at the beginning and/or end of the specified region, as needed to erase only full sectors. The flash bank to use is inferred from the address, and the specified length must stay within that bank. As a special case, when length is zero and address is the start of the bank, the whole flash is erased. If unlock is specified, then the flash is unprotected before erase starts. 

Sure, but where do I place the "flash erase_address" command and which is the start of the memory bank in the VESC???

Frazatto
Frazatto's picture
Offline
Last seen: 1 year 6 days ago
Joined: 2018-06-27 15:33
Posts: 18

Well....I took the twisted road to solve the problem.
Tried to use STlink Utility with Wine on Linux since it has the feature to erase the whole flash, but it can't find the usb ports.
So I continued on to installing VirtualBox, made a Windows XP virtual machine and installed STlink Utility.

It worked great but still no connection with the VESCTool over USB alone.
So yea, most likely there is something burned in there.