cancel
Showing results for 
Search instead for 
Did you mean: 

Why it is fail to program using st-link-v2 with stm32cubeprogrammer MCU family STM32F09x/F030xc using SWD port

CCai.1
Associate

17:23:22 : Address : 0x00000224 

17:23:22 : Erasing memory corresponding to segment 0:

17:23:22 : Erasing memory corresponding to segment 1:

17:23:22 : Erasing internal memory sector 0

17:23:22 : Erasing memory corresponding to segment 2:

17:23:22 : Erasing internal memory sectors [0 10]

17:23:22 : Erasing memory corresponding to segment 3:

17:23:22 : Erasing internal memory sector 32

17:23:22 : Erasing memory corresponding to segment 4:

17:23:22 : Erasing internal memory sectors [32 57]

17:23:23 : Download in Progress:

17:23:23 : Error: failed to download Segment[0]

17:23:23 : Error: failed to download the File

3 REPLIES 3

Hi @CCai.1​ 

Could you please share your .bin file to check with.

Best regards,

Nesrine

CCai.1
Associate

Hi Nesrine,

As attachment FYI. Thank you.

Best Regards

Caton

Hi @CCai.1​ 

Tested the same scenario by using my own .bin i had no issue.

14:59:35:602 : Download in Progress:

  14:59:35:603 :  Size         : 262144 Bytes

  14:59:35:603 :  Address      : 0x08000000

  14:59:35:603 : Buffer program...

  14:59:35:607 : halt ap 0

  14:59:35:608 : w ap 0 reg 15 PC  (0x20000000)

  14:59:35:609 : w ap 0 reg 17 MSP (0x20000500)

  14:59:35:610 : w ap 0 reg 16 xPSR (0x01000000)

  14:59:35:612 : w ap 0 @0x20000860 0x00000200 bytes Data 0x00000000

  14:59:35:612 : w ap 0 @0x20000000 0x00000004 bytes Data 0x0000BE00

  14:59:35:614 : w ap 0 @0x20000004 0x00000430 bytes Data 0xF000B580

  14:59:35:615 : Loader write range...

  14:59:35:697 : w ap 0 @0x20000860 0x00003A00 bytes Data 0x20200408

  14:59:35:697 : W B1 in RAM @0x20000860 size 0x00003A00 : 0098ms

  14:59:35:697 : Init flashloader...

But when i test with your .bin i get an error when downloading:

5:01:05:303 : Download in Progress:

  15:01:05:303 :  Size         : 8 Bytes

  15:01:05:303 :  Address      : 0x00000224

  15:01:05:303 : Buffer program...

  15:01:05:303 : w ap 0 @0x00000224 0x00000008 bytes Data 0x000051F1

I think the problem is with your code, so please try to check the linker ( address w segments)

Best regards,

Nesrine