Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CS32F103C8T6 blue-pill clone - cannot flash from AC6 SystemWorkbench

I am trying to flash a blue-pill clone with a CS32F103C8T6 chip using the AC6 SystemWorkBench and a ST-LINK v2 device. It is a project built from STM32CubeMX - I am using a MacOS Mojave machine. Here is the output when trying to flash the device.

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 8000 kHz
adapter_nsrst_delay: 100
Info : clock speed 8000 kHz
Info : STLINK v2 JTAG v31 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.162004
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Stlink adapter speed set to 4000 kHz
Warn : UNEXPECTED idcode: 0x2ba01477
Error: expected 1 of 1: 0x1ba01477
in procedure 'program' 
in procedure 'init' called at file "embedded:startup.tcl", line 495
in procedure 'ocd_bouncer'
** OpenOCD init failed **
shutdown command invoked

I have googled and found some similar posts about it, but have no luck solving it.

Does anyone have an idea ?

mvh Ole K Hornnes

like image 793
olekeh Avatar asked Dec 04 '22 17:12

olekeh


2 Answers

In the OpenOCD config file, you need to add:

set CPUTAPID 0x2ba01477

I've never used AC6 SystemWorkbench and I don't now how you configure the board and the debug adapter in it. So I can't really tell where to look for the config file.

OpenOCD comes with an entire directory of board configurations, usually in a directory OpenOCD / scripts / board. It contains a script called stm32f103c8_blue_pill.cfg, which might be used in your case. Start there...

like image 187
Codo Avatar answered Dec 28 '22 09:12

Codo


set CPUTAPID 0x2ba01477 ; Will work for the clone but not for the genuine STM32…

Instead use: set CPUTAPID 0

The zero tells OpenOCD to ignore the id number, so any MCU will then work…

Information Source: OpenOCD TAPs

like image 24
Johan Avatar answered Dec 28 '22 11:12

Johan