cancel
Showing results for 
Search instead for 
Did you mean: 

Check that the device is erased before programming

lihongzhai
Associate
Posted on July 03, 2014 at 06:06

I  program the chip with STVP_CmdLine.exe, and found

strange

thing:

The log says that ''Erasing PROGRAM MEMORY succeeds'' and then failed with message ''Check that the device is erased before programming'', it seems that the STLink

did not really erasing the memory when it log the message.

The strange things are:

I run successed yesterday with same script, but could not pass today. (ON Winxp)

stvp can program the chip successfully.

Any clue are very welcome. 

Below is the log:

 

----------------------------------------------------------

new log session

date:    07/03/14

time:    10:29:08

----------------------------------------------------------

STVP_CmdLine version 1.6

Verbose ON

Log activity ON

Display Progress OFF

Message box warning if protect option byte OFF

Loop mode OFF

Erase device ON

Blank check device OFF

Verify device ON

Configuration:

BoardName=ST-LINK ST-LINK_ID=0 Device=STM32F030x8 Port=USB ProgMode=SWD

>>> Filling PROGRAM MEMORY image in computer with Blank Value

<<< Filling PROGRAM MEMORY image in computer succeeds

>>> Loading file C:\Documents and Settings\Administrator\桌�?�\0703测试hex\�?�相表SL500Swarm_R.hex in PROGRAM MEMORY image in computer

<<< Loading file succeeds

>>> Loading file D:\Program Files\Neoway\FactoryAssistant\STLink\\opt_protect.hex in OPTION BYTE image in computer

<<< Loading file succeeds

>>> Erasing PROGRAM MEMORY

Warning: Old ST-Link firmware version detected.

You can update the ST-Link firmware with ST-LinkUpgrade.exe utility and reboot the ST-Link with USB cable.

  Mass Erasing device...

  Blank Checking device...

<<< Erasing PROGRAM MEMORY succeeds

>>> Programming PROGRAM MEMORY

Programming failed. Check that the device is erased before programming

<<< Programming PROGRAM MEMORY fails

2 REPLIES 2
LaurentL
ST Employee
Posted on July 03, 2014 at 10:09

Hello,

I don't think the device erasing process failed, the blank check succeeds.

The message is just a warning when programming fails.

As you said it programs well with STVP gui, i suspect the different directories is the problem.

Try to copy the appli files (Program and Option bytes hex files) in the same directory as the cmdline tool exe.

I see they are not in the same drive.

Rgds,

Laurent

os_kopernika
Associate II
Posted on July 04, 2014 at 10:55

Try other st-link drivers to verify what fails.

Use OpenOCD or Texane/Stlink for example.