Hello,
I also have problems by uploading with STLink, like this topic:https://community.platformio.org/t/stm32-vl-discovery-stm32f100rb-st-link-v1-problem-uploading-to-target/1583
In my case, I use V2. But the mesages are similar as posted in the thread as linked above:
Linking .pioenvs\genericSTM32F103CB\firmware.elf Checking program size text data bss dec hex filename 6316 1920 312 8548 2164 .pioenvs\genericSTM32F103CB\firmware.elf Building .pioenvs\genericSTM32F103CB\firmware.bin Looking for upload disk... Auto-detected: COM4 Uploading .pioenvs\genericSTM32F103CB\firmware.bin 2017-04-06T19:00:10 INFO C:\Users\User\Downloads\stlink\src\common.c: Loading device parameters.... 2017-04-06T19:00:10 WARN C:\Users\User\Downloads\stlink\src\common.c: unknown chip id! 0*** [upload] Error -1
The PIO ini files has this info:
[env:genericSTM32F103CB] platform = ststm32 board = genericSTM32F103CB framework = arduino upload_protocol = stlink build_flags = -v
STLink utility recognizes and handles the probe correctly.
Does anyone know any solution?
Did you try it with official St utility??
Can you try it with the st utility and report your findings??
As I already mentioned in my previous post: ST-Link utility recognizes and uses the probe correctly, I am able to flash binary files with it.
I am on win10 x64 machine.
How can I add as parameter the chip ID of the probe? Which file should I edit?
Hmm…
On going through the git repo for the stlink utility several things pop out and scream.
@ivankravets It looks like the texane/stlink being bundled with platformio is 1.1 change… 1.3 change is the latest version. Can this be updated to the 1.3 version??
This post throws some light.
opened 07:13PM - 09 Dec 15 UTC
closed 02:21PM - 25 Mar 21 UTC
os/macOS
os/windows
os/linux
bug/regression
target/stm32f0
target/stm32f1
error/flash-loader
component/st-flash
target/stm32l0
status/resolved
bug/fixed
status/resolved-verified
Hello. I try to load firmare in STM32F103CBT6 using compiled st-flash.exe utilit… y under windows 8.1.
There is used command:
st-flash.exe write ${project_name}.bin 0x08000000
Here is result:
```
Flash page at addr: 0x08000000 erased
Flash page at addr: 0x08000400 erased
Flash page at addr: 0x08000800 erased
Flash page at addr: 0x08000c00 erased
Flash page at addr: 0x08001000 erased
Flash page at addr: 0x08001400 erased
Flash page at addr: 0x08001800 erased
Flash page at addr: 0x08001c00 erased
Flash page at addr: 0x08002000 erased
Flash page at addr: 0x08002400 erased
Flash page at addr: 0x08002800 erased
Flash page at addr: 0x08002c00 erased
Flash page at addr: 0x08003000 erased
Flash page at addr: 0x08003400 erased
Flash page at addr: 0x08003800 erased
Flash page at addr: 0x08003c00 erased
Flash page at addr: 0x08004000 erased
Flash page at addr: 0x08004400 erased
Flash page at addr: 0x08004800 erased
Flash page at addr: 0x08004c00 erased
Flash page at addr: 0x08005000 erased
Flash page at addr: 0x08005400 erased
Flash page at addr: 0x08005800 erased
Flash page at addr: 0x08005c00 erased
Flash page at addr: 0x08006000 erased
Flash page at addr: 0x08006400 erased
Flash page at addr: 0x08006800 erased
Flash page at addr: 0x08006c00 erased
Flash page at addr: 0x08007000 erased
Flash page at addr: 0x08007400 erased
Flash page at addr: 0x08007800 erased
Flash page at addr: 0x08007c00 erased
Flash page at addr: 0x08008000 erased
Flash page at addr: 0x08008400 erased
Flash page at addr: 0x08008800 erased
Flash page at addr: 0x08008c00 erased
Flash page at addr: 0x08009000 erased
Flash page at addr: 0x08009400 erased
Flash page at addr: 0x08009800 erased
Flash page at addr: 0x08009c00 erased
Flash page at addr: 0x0800a000 erased
Flash page at addr: 0x0800a400 erased
stlink_fwrite_flash() == -1
2015-12-09T22:01:57 INFO src/stlink-common.c: Loading device parameters....
2015-12-09T22:01:57 INFO src/stlink-common.c: Device connected is: F1 Medium-density device, id 0x20036410
2015-12-09T22:01:57 INFO src/stlink-common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0xb4a000 bytes (11560 KiB) in pages of 1024 bytes
2015-12-09T22:01:57 INFO src/stlink-common.c: Attempting to write 42368 (0xa580) bytes to stm32 address: 134217728 (0x8000000)
2015-12-09T22:01:57 INFO src/stlink-common.c: Finished erasing 42 pages of 1024 (0x400) bytes
2015-12-09T22:01:57 INFO src/stlink-common.c: Starting Flash write for VL/F0/F3 core id
2015-12-09T22:01:57 INFO src/stlink-common.c: Successfully loaded flash loader in sram
2015-12-09T22:02:18 ERROR src/stlink-common.c: flash loader run error
2015-12-09T22:02:18 ERROR src/stlink-common.c: run_flash_loader(0x8000000) failed! == -1
```
What is the issue? Thank you)
@stevestrong
Can you try two things as outlined in the posts
This post pretty much reflects your problem.
opened 12:26AM - 13 Mar 17 UTC
closed 10:27PM - 24 Mar 21 UTC
os/macOS
error/unknown-chipid
general/documentation
os/linux
target/stm32f1
component/st-util
component/st-flash
programmer/stlinkv2
status/no-bug
- [x] Programmer/board type: Stlink/v2
- [x] Programmer firmware version: e.g S… TSW-LINK007 2.27.15
- [x] Operating system: macOS 10.12.3
- [x] Stlink tools version: v1.3.1
- [x] Stlink commandline tool name: `st-flash` and `st-util`
- [x] Target chip: generic STM32F103C8
I was flashing without problems, suddenly I am getting "unknown chip id".
Output:
```
$ st-flash write main.bin 0x8000000
st-flash 1.3.1
2017-03-13T01:22:48 INFO src/common.c: Loading device parameters....
2017-03-13T01:22:48 WARN src/common.c: unknown chip id! 0xe0042000
```
Did I somehow fry my board? Or what does that mean?
Put your board into serial bootloader mode, erase and then flash the board as given in one of the replies.
Please try and check it works.
opened 07:13PM - 09 Dec 15 UTC
closed 02:21PM - 25 Mar 21 UTC
os/macOS
os/windows
os/linux
bug/regression
target/stm32f0
target/stm32f1
error/flash-loader
component/st-flash
target/stm32l0
status/resolved
bug/fixed
status/resolved-verified
Hello. I try to load firmare in STM32F103CBT6 using compiled st-flash.exe utilit… y under windows 8.1.
There is used command:
st-flash.exe write ${project_name}.bin 0x08000000
Here is result:
```
Flash page at addr: 0x08000000 erased
Flash page at addr: 0x08000400 erased
Flash page at addr: 0x08000800 erased
Flash page at addr: 0x08000c00 erased
Flash page at addr: 0x08001000 erased
Flash page at addr: 0x08001400 erased
Flash page at addr: 0x08001800 erased
Flash page at addr: 0x08001c00 erased
Flash page at addr: 0x08002000 erased
Flash page at addr: 0x08002400 erased
Flash page at addr: 0x08002800 erased
Flash page at addr: 0x08002c00 erased
Flash page at addr: 0x08003000 erased
Flash page at addr: 0x08003400 erased
Flash page at addr: 0x08003800 erased
Flash page at addr: 0x08003c00 erased
Flash page at addr: 0x08004000 erased
Flash page at addr: 0x08004400 erased
Flash page at addr: 0x08004800 erased
Flash page at addr: 0x08004c00 erased
Flash page at addr: 0x08005000 erased
Flash page at addr: 0x08005400 erased
Flash page at addr: 0x08005800 erased
Flash page at addr: 0x08005c00 erased
Flash page at addr: 0x08006000 erased
Flash page at addr: 0x08006400 erased
Flash page at addr: 0x08006800 erased
Flash page at addr: 0x08006c00 erased
Flash page at addr: 0x08007000 erased
Flash page at addr: 0x08007400 erased
Flash page at addr: 0x08007800 erased
Flash page at addr: 0x08007c00 erased
Flash page at addr: 0x08008000 erased
Flash page at addr: 0x08008400 erased
Flash page at addr: 0x08008800 erased
Flash page at addr: 0x08008c00 erased
Flash page at addr: 0x08009000 erased
Flash page at addr: 0x08009400 erased
Flash page at addr: 0x08009800 erased
Flash page at addr: 0x08009c00 erased
Flash page at addr: 0x0800a000 erased
Flash page at addr: 0x0800a400 erased
stlink_fwrite_flash() == -1
2015-12-09T22:01:57 INFO src/stlink-common.c: Loading device parameters....
2015-12-09T22:01:57 INFO src/stlink-common.c: Device connected is: F1 Medium-density device, id 0x20036410
2015-12-09T22:01:57 INFO src/stlink-common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0xb4a000 bytes (11560 KiB) in pages of 1024 bytes
2015-12-09T22:01:57 INFO src/stlink-common.c: Attempting to write 42368 (0xa580) bytes to stm32 address: 134217728 (0x8000000)
2015-12-09T22:01:57 INFO src/stlink-common.c: Finished erasing 42 pages of 1024 (0x400) bytes
2015-12-09T22:01:57 INFO src/stlink-common.c: Starting Flash write for VL/F0/F3 core id
2015-12-09T22:01:57 INFO src/stlink-common.c: Successfully loaded flash loader in sram
2015-12-09T22:02:18 ERROR src/stlink-common.c: flash loader run error
2015-12-09T22:02:18 ERROR src/stlink-common.c: run_flash_loader(0x8000000) failed! == -1
```
What is the issue? Thank you)
Alternatively, first issue a seperate command to erase the chip and then upload
From what it appears, its a texane/stlink issue rather than platformio issue. Maybe we should wait for a proper fix from their end??
Well, a follow up.
I tried the same what @stevestrong tried with his nucleo board.Except I tried with my Disco F030R8 board.
I, too, faced the same issue as posted by anirbax in another thread.
As i said, I tried it with the st-util bundled with platformio and no success . I manually downloaded the 1.3 binaries from texane/github and tried invoking the same command with 1.3 binary and voila! it works fine.
I ll open an issue as you suggested and maybe that might solve a couple of issues with the flashing and debugging.
PS: Actually another good samaritan has already opened the same issue.
opened 04:49AM - 16 Jan 17 UTC
help wanted
What kind of issue is this?
- [x] PlatformIO Core. If you’ve found a bug, ple… ase provide an information below.
------------------------------------------------------------------
### Configuration
**Operating system**: Linux
**PlatformIO Version** (`platformio --version`): 3.2.1
### Description of problem
The st-util tool causes error on STM32F091 Nucleo-64 board. This issue is fixed at latest version of the tool.
#### Steps to Reproduce
1. Using some elf file.
2. Run "~/.platformio/packages/tool-stlink/st-util"
3. Run "arm-none-eabi-gdb foo.elf"
4. Type "tar ext localhost:4242" on gdb
5. Type "load" on gdb
### Actual Results
The gdb console shows:
```
Loading section startup, size 0xc0 lma 0x8000000
Loading section .text, size 0x62ac lma 0x80000c0
Loading section .data, size 0xb8 lma 0x8006370
Error finishing flash operation
```
The st-util console shows:
```
2017-01-15T20:20:47 INFO src/stlink-common.c: Loading device parameters....
2017-01-15T20:20:47 INFO src/stlink-common.c: Device connected is: F09X device, id 0x10006442
2017-01-15T20:20:47 INFO src/stlink-common.c: SRAM size: 0x8000 bytes (32 KiB), Flash: 0x40000 bytes (256 KiB) in pages of 2048 bytes
2017-01-15T20:20:47 INFO gdbserver/gdb-server.c: Chip ID is 00000442, Core ID is 0bb11477.
2017-01-15T20:20:47 INFO gdbserver/gdb-server.c: Target voltage is 3253 mV.
2017-01-15T20:20:47 INFO gdbserver/gdb-server.c: Listening at *:4242...
2017-01-15T20:22:18 INFO gdbserver/gdb-server.c: Found 4 hw breakpoint registers
2017-01-15T20:22:18 INFO gdbserver/gdb-server.c: GDB connected.
2017-01-15T20:22:57 INFO src/stlink-common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2017-01-15T20:22:57 INFO src/stlink-common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:22:57 INFO src/stlink-common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:22:57 INFO src/stlink-common.c: Successfully loaded flash loader in sram
2017-01-15T20:23:01 ERROR src/stlink-common.c: flash loader run error
2017-01-15T20:23:01 ERROR src/stlink-common.c: run_flash_loader(0x8000000) failed! == -1
```
### Expected Results
The gdb console should show:
```
Loading section startup, size 0xc0 lma 0x8000000
Loading section .text, size 0x62ac lma 0x80000c0
Loading section .data, size 0xb8 lma 0x8006370
Start address 0x80000c0, load size 25636
Transfer rate: 11 KB/sec, 6409 bytes/write.
```
The st-util console should show:
```
st-util 1.1.0-316-g0106c53
2017-01-15T20:25:01 INFO /home/kiwamu/src/stlink/src/common.c: Loading device parameters....
2017-01-15T20:25:01 INFO /home/kiwamu/src/stlink/src/common.c: Device connected is: F09X device, id 0x10006442
2017-01-15T20:25:01 INFO /home/kiwamu/src/stlink/src/common.c: SRAM size: 0x8000 bytes (32 KiB), Flash: 0x40000 bytes (256 KiB) in pages of 2048 bytes
2017-01-15T20:25:02 INFO /home/kiwamu/src/stlink/src/gdbserver/gdb-server.c: Chip ID is 00000442, Core ID is 0bb11477.
2017-01-15T20:25:02 INFO /home/kiwamu/src/stlink/src/gdbserver/gdb-server.c: Listening at *:4242...
2017-01-15T20:25:41 INFO /home/kiwamu/src/stlink/src/gdbserver/gdb-server.c: Found 4 hw breakpoint registers
2017-01-15T20:25:41 INFO /home/kiwamu/src/stlink/src/gdbserver/gdb-server.c: GDB connected.
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:47 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134219776 (0x8000800)
Flash page at addr: 0x08000800 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134221824 (0x8001000)
Flash page at addr: 0x08001000 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134223872 (0x8001800)
Flash page at addr: 0x08001800 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134225920 (0x8002000)
Flash page at addr: 0x08002000 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134227968 (0x8002800)
Flash page at addr: 0x08002800 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134230016 (0x8003000)
Flash page at addr: 0x08003000 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134232064 (0x8003800)
Flash page at addr: 0x08003800 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134234112 (0x8004000)
Flash page at addr: 0x08004000 erased
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:48 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134236160 (0x8004800)
Flash page at addr: 0x08004800 erased
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134238208 (0x8005000)
Flash page at addr: 0x08005000 erased
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134240256 (0x8005800)
Flash page at addr: 0x08005800 erased
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Attempting to write 2048 (0x800) bytes to stm32 address: 134242304 (0x8006000)
Flash page at addr: 0x08006000 erased
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting Flash write for VL/F0/F3 core id
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/flash_loader.c: Successfully loaded flash loader in sram
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Starting verification of write complete
2017-01-15T20:25:49 INFO /home/kiwamu/src/stlink/src/common.c: Flash written and verified! jolly good!
```
<bountysource-plugin>
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40992119-the-st-util-tool-causes-error-on-stm32f091-nucleo-64-board?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38219470&utm_medium=issues&utm_source=github).
</bountysource-plugin>
I opened aa new issue, but saw that previous post later.
OK, it seems that it somehow started to launch stlink flasher correctly.
I closed ATOM and all running Java applications, restarted ATOM and it looks like the upload with stlink now works.
BUT…
it does not work correctly.
The linker has specified a start address of 0x8002000 (VECT_TAB_ADDR=134225920), but the probe will still flash to 0x8000000:
Archiving .pioenvs\genericSTM32F103CB\libFrameworkArduino.a
Linking .pioenvs\genericSTM32F103CB\firmware.elf
Checking program size
text data bss dec hex filename
11924 2136 936 14996 3a94 .pioenvs\genericSTM32F103CB\firmware.elf
Building .pioenvs\genericSTM32F103CB\firmware.bin
Looking for upload disk...
Auto-detected: COM4
Uploading .pioenvs\genericSTM32F103CB\firmware.bin
Flash page at addr: 0x08003400 erased
13/13 pages written
2017-04-06T22:51:01 INFO C:\Users\User\Downloads\stlink\src\common.c: Loading device parameters....
2017-04-06T22:51:01 INFO C:\Users\User\Downloads\stlink\src\common.c: Device connected is: F1 Medium-density device, id 0x20036410
2017-04-06T22:51:01 INFO C:\Users\User\Downloads\stlink\src\common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes
2017-04-06T22:51:01 INFO C:\Users\User\Downloads\stlink\src\common.c: Attempting to write 14060 (0x36ec) bytes to stm32 address: 134217728 (0x8000000)
2017-04-06T22:51:02 INFO C:\Users\User\Downloads\stlink\src\common.c: Finished erasing 14 pages of 1024 (0x400) bytes
2017-04-06T22:51:02 INFO C:\Users\User\Downloads\stlink\src\common.c: Starting Flash write for VL/F0/F3 core id
2017-04-06T22:51:02 INFO C:\Users\User\Downloads\stlink\src\flash_loader.c: Successfully loaded flash loader in sram
2017-04-06T22:51:02 INFO C:\Users\User\Downloads\stlink\src\common.c: Starting verification of write complete
2017-04-06T22:51:02 INFO C:\Users\User\Downloads\stlink\src\common.c: Flash written and verified! jolly good!
How can I change the flashing start address?
Is there a script which I can patch somehow, making the flash start address dependent on some compiler flags?
Furthermore, it seems that it loads the data into SRAM? Or it just the flash loader which is running from SRAM?
Uplading with ST-Link V2 seems to work reliably now.
However, after upload I always have to press the reset button, otherwise it won’t re-initialize the board.
Is there a way to make the st flasher to automatically reset the board after uploading?
Arduino IDE uses for the SMT32F103 devices the “ST-LINK_CLI.exe” command line utility (available under “.platformio\packages\tool-stm32duino\stlink”) to upload the binary. This has the “-Rst” argument which resets the board after upload.
But PlatformIO does not uses this tool for uploading, right?