-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
- Programmer/board type: Stlink/v2
- Programmer firmware version: don't know how to get it
- Operating system: Ubuntu 16.04.1 LTS 4.4.0-31-generic USB Issues after bad code write #50-Ubuntu SMP
- Stlink tools version and/or git commit hash: a781594
- Stlink commandline tool name:
st-info,st-flash, probably any - Target chip (and optional board): STM32F030C6T6
Steps to reproduce:
- Connected my device using STM32F030C6T6 to Stlink/v2 programmer.
- Flashed it succesfully.
- Disconnected my device from programmer, DON'T disconnect programmer from laptop's USB.
- Connected the device to programmer again.
- Tried to flash it with the same command or even just got any information and get error.
Output:
pavel@pavel-UX31A:~/stlink$ ./st-flash --reset write ../Desktop/WB-MSW_2.0.1.bin 0x8000000
2016-07-26T13:27:41 INFO src/stlink-common.c: Loading device parameters....
2016-07-26T13:27:41 INFO src/stlink-common.c: Device connected is: F0 small device, id 0x10006444
2016-07-26T13:27:41 INFO src/stlink-common.c: SRAM size: 0x1000 bytes (4 KiB), Flash: 0x8000 bytes (32 KiB) in pages of 1024 bytes
2016-07-26T13:27:42 INFO src/stlink-common.c: Attempting to write 19860 (0x4d94) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08004c00 erased
2016-07-26T13:27:42 INFO src/stlink-common.c: Finished erasing 20 pages of 1024 (0x400) bytes
2016-07-26T13:27:42 INFO src/stlink-common.c: Starting Flash write for VL/F0/F3 core id
2016-07-26T13:27:42 INFO src/stlink-common.c: Successfully loaded flash loader in sram
19/19 pages written
2016-07-26T13:27:43 INFO src/stlink-common.c: Starting verification of write complete
2016-07-26T13:27:44 INFO src/stlink-common.c: Flash written and verified! jolly good!
pavel@pavel-UX31A:~/stlink$ ./st-flash --reset write ../Desktop/WB-MSW_2.0.1.bin 0x8000000
[!] send_recv
[!] send_recv
[!] send_recv
[!] send_recv
[!] send_recv
2016-07-26T13:28:18 INFO src/stlink-common.c: Loading device parameters....
[!] send_recv
2016-07-26T13:28:18 ERROR src/stlink-common.c: Failed to read core_id
[!] send_recv
2016-07-26T13:28:18 WARN src/stlink-common.c: unknown chip id! 0x19c6010
pavel@pavel-UX31A:~/stlink$ ./st-info --descr
[!] send_recv
[!] send_recv
[!] send_recv
[!] send_recv
[!] send_recv
[!] send_recv
[!] send_recv
Expected/description:
If disconnect programmer from USB and connect again error goes away. Now I use special script from here to reset USB port before flashing: http://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line