cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot flash STM32F103C8T6

MHof
Associate II

Hello together, I am beginner with STM32-controllers and I have started reading the tutorial book "Beginning STM32" from Warren Gay.

I ordered three STM32F103C8T6 platines and I have also three ST-Link V2 program/debug adapter, but only with one adapter I can at least communicate with any of the three STM32F103C8T6.

I am using Debian Linux as operating system on my laptop and I have connected like described the STM32xx with my computer over USB and the ST-Link V2 - adapter.

But if I execute the command "st-info --probe" I do not get all details of the controller:

root@MH1977:~# st-info --probe

Found 1 stlink programmers

serial:

openocd: ""

 flash: 2 (pagesize: 7)

  sram: 134273

 chipid: 0x0410

 descr: F1 Medium-density device

root@MH1977:~#

As you can see at serial and at openocd nothing is being outputted though the command has detected the controller. The other strange thing is that the flash memory size is only being noticed by 2!

By the way, I could read flash memory by executing st-flash read ./saved.img 0x8000000 0x1000. But after execution, the blinking yellow LED stopped blinking and only the red power source LED is lighting. I hope, I do not have damaged anything with that command?

Trying to write memory leads to following error:

root@MH1977:/home/marco/stm32f103c8t6# st-flash write generic_boot20_pc13.bin 0x8000000

st-flash 1.5.1-45-g393e942

2019-10-17T00:37:16 INFO common.c: Loading device parameters....

2019-10-17T00:37:16 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410

2019-10-17T00:37:16 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes

open(generic_boot20_pc13.bin) == -1

2019-10-17T00:37:16 ERROR common.c: map_file() == -1

stlink_fwrite_flash() == -1

root@MH1977:/home/marco/stm32f103c8t6#

Trying to flash leads to following error:

root@MH1977:/home/marco/stm32f103c8t6/miniblink# make flash

/usr/local/bin/st-flash write miniblink.bin 0x8000000

st-flash 1.5.1-45-g393e942

2019-10-17T00:39:23 INFO common.c: Loading device parameters....

2019-10-17T00:39:23 INFO common.c: Device connected is: F1 Medium-density device, id 0x20036410

2019-10-17T00:39:23 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes

2019-10-17T00:39:23 INFO common.c: Attempting to write 700 (0x2bc) bytes to stm32 address: 134217728 (0x8000000)

Flash page at addr: 0x08000000 erased

2019-10-17T00:39:23 INFO common.c: Finished erasing 1 pages of 1024 (0x400) bytes

2019-10-17T00:39:23 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id

2019-10-17T00:39:23 ERROR flash_loader.c: unknown coreid, not sure what flash loader to use, aborting! coreid: 2ba01477, chipid: 410

2019-10-17T00:39:23 WARN flash_loader.c: Failed to write flash loader to sram!

2019-10-17T00:39:23 ERROR common.c: stlink_flash_loader_init() == -1

stlink_fwrite_flash() == -1

make: *** [../Makefile.incl:134: flash] Fehler 255

root@MH1977:/home/marco/stm32f103c8t6/miniblink#

I have the newest firmware at my used ST-LINK-V2 adapter (done by STM32CubeProgrammer) and I have executed the commands as root user.

I have checked the wirings of the adapter to the controller and verified several times.

Does anyone have an idea what the reason for these errors can be?

Especially as STM32-beginner I am looking forward for any help or advice.

Sincerely,

Marco

0 REPLIES 0