First, there is an issue in the protocol in your command line, on STM32, you should use JTAG or SWD, not SWIM (only for STM8). I suppose it is a copy paste issue. ;) For your programming issue, there has been a correction in latest version of STVP (ST Visual Programmer). Download the latest ST toolset with latest STVP version (3.2.1), it should work. Another workaround is to recopy the APISample.exe and your 2 hex file in STVP directory. If you still have the issue, your flash is not virgin. If you want to reprogram a device, i suggest you add the ''-erase'' command. I just tried this twice, it is working fine: APISample.exe -BoardName=ST-LINK -Device=STM32F103xB -Port=USB -ProgMode=SWD -no_loop -no_log -FileProg=STM32F103xB_prog.hex -FileOption=STM32F103_option.hex -erase Here is the result: Configuration: BoardName=ST-LINK Device=STM32F103xB Port=USB ProgMode=SWD >>> Loading file STM32F103xB_prog.hex in PROGRAM MEMORY >>> Loading file STM32F103_option.hex in OPTION BYTE >>> Erasing PROGRAM MEMORY (API) WARNING : Mass Erasing device... (API) WARNING : Blank Checking device... <<< Erasing PROGRAM MEMORY succeeds >>> Programming PROGRAM MEMORY <<< Programming PROGRAM MEMORY succeeds >>> Verifying PROGRAM MEMORY <<< Verifying PROGRAM MEMORY succeeds >>> Programming OPTION BYTE <<< Programming OPTION BYTE succeeds >>> Verifying OPTION BYTE <<< Verify OPTION BYTE succeeds Regards, Laurent
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.