cancel
Showing results for 
Search instead for 
Did you mean: 

Problems programming STM32F103RCT6 with ST LINK V2

Sigi
Associate II
Posted on January 14, 2018 at 21:20

Hi,

flashing of mentioned chip with ST LINK V2 works perfect, but in special case it fails with:

20:56:49 : STLink USB communication error

20:56:49 : Error occured during program operation!

20:56:49 : Programming error @ 0x08007600!

20:56:52 : Programmed memory Checksum: 0x004C4AD8

20:56:53 : Disconnected from device.

Can't find reason.

It happens only at one instance of output .hex file. If I delete some lines of code and rebuild (.text gets smaller), it is fine, but also if I add some lines of code (.text size increases) it is fine also.

I tried with output .bin format, I installed latest ST LINK Utillity, updated firmware, tried CLI tools... nothing helps. Tried STLINK V2 ISOL also, the same result.

WIN7 pro 64bit, GCC (Gnu ARM Eclipse)

This are section sizes:

section             size         addr

.isr_vector        0x30a    0x8000000

.inits              0x28    0x800030c

.data              0x874   0x20000000

.data_CCMRAM         0x0          0x0

.bss              0x1730   0x20000874

.text             0x8a4e    0x8000334

.noinit              0x0   0x20001fa4

._check_stack     0x1000   0x20001fa4

.comment            0x6e          0x0

.ARM.attributes     0x31          0x0

.debug_frame       0x5b4          0x0

Total             0xc377

If I understand correctly, there is enough of FLASH/RAM available (256K/48K), or am I wrong here?

I'm attaching problematic .hex file, in case somebody can check on the same chip.

Thanks for your sugestions in advance!

1 REPLY 1
Sigi
Associate II
Posted on January 15, 2018 at 16:54

I made some additional tests:

-the same file flashes well to STM32F103RB chip, no problems here

-in ST LINK Utility, I manage to manually paste/coppy fw data from the address when error ocured; interestingly, that worked out well, and MCU was running happy after that.

At this moment I don't have another PCB with the same MCU, but as soon as I get one I'll try if problem persists.

But it looks as there is something wrong with MCU's flash, it has been flashed hundreds of times untill now and it may be a bit 'worn out'.

Still, I wouldn't expect 'STLink USB communication error' message because of burnt flash cell.

I'll mark this as 'solved', but would be glad if somebody can share information or experience on that issue.

Thanks!