STM32L072CZ: Load HEX file
- [x] Programmer/board type: Stlink/v2 Clone (specifically this one)
- [x] Programmer firmware version: V2.J34.S7 as reported by Windows STM32 ST-LINK Utility software
- [x] Operating system: Linux (specifically Ubuntu 18.04)
- [x] Stlink tools version and/or git commit hash: e.g master (3690de9f)
- [x] Stlink commandline tool name:
st-flash - [x] Target chip (and optional board): STM32L072CZ
I am looking to simply load a HEX file onto the target using this programmer. When I run the following command: st-flash --format ihex write myapp.hex
I get the following error trace / output:
st-flash 1.5.1-50-g3690de9
2020-01-13T16:19:45 INFO usb.c: -- exit_dfu_mode
2020-01-13T16:19:45 INFO common.c: Loading device parameters....
2020-01-13T16:19:45 WARN common.c: Invalid flash type, please check device declaration
core status: unknown
Unknown memory region
And if I run st-info --chipid I just get: 0x0000.
...and st-info --probe outputs the following when the programmer is plugged into USB:
Found 1 stlink programmers
serial: 2c0f03013212354d434b4e00
openocd: "\x2c\x0f\x03\x01\x32\x12\x35\x4d\x43\x4b\x4e\x00"
flash: 0 (pagesize: 0)
sram: 0
chipid: 0x0000
descr: unknown device
I'm not sure what, if anything, I might be doing wrong. I built the repository from source and I can obviously run the resultant binaries without a problem. Please can someone help set on the right course? If there is an easier path than using the tools in this repository, I'm also open to hearing that.
This may be looked at in the context of #923 and #1108.
@wolsty7 Would you fancy to give this a test as well? Please let us know.
@Nightwalker-87 Most likely using --connect-under-reset will solve this issue
my programmer is the V3SET that isn't supported by 1.5.1 and i'm on raspbian... --connect-under-reset helps in my case
using branch l0_soft_loader_fix 1.6.1-330-g679ab65 that works for #1138:
st-flash --format ihex write /home/pi/Downloads/v1.hex st-flash 1.6.1-330-g679ab65 Failed to enter SWD mode Failed to connect to target
using branch l0_soft_loader_fix 1.6.1-330-g679ab65 that works for #1138:
st-flash --format=ihex write /home/pi/Downloads/v1.hex st-flash 1.6.1-330-g679ab65 Failed to enter SWD mode Failed to connect to target
using branch l0_soft_loader_fix 1.6.1-330-g679ab65 that works for #1138:
st-flash --connect-under-reset --format=ihex write /home/pi/Downloads/v1.hex st-flash 1.6.1-330-g679ab65 2021-07-21T11:28:03 INFO common.c: L0xx Category 5: 20 KiB SRAM, 192 KiB flash in at least 128 byte pages. 2021-07-21T11:28:03 INFO common.c: Attempting to write 78900 (0x13434) bytes to stm32 address: 134217728 (0x8000000) 2021-07-21T11:28:03 INFO common.c: Flash page at addr: 0x08000000 erased 2021-07-21T11:28:03 INFO common.c: Flash page at addr: 0x08000080 erased ###removed for brevity### 2021-07-21T11:28:08 INFO common.c: Flash page at addr: 0x08013300 erased 2021-07-21T11:28:08 INFO common.c: Flash page at addr: 0x08013380 erased 2021-07-21T11:28:08 INFO common.c: Flash page at addr: 0x08013400 erased 2021-07-21T11:28:08 INFO common.c: Finished erasing 617 pages of 128 (0x80) bytes 2021-07-21T11:28:08 INFO common.c: Starting Flash write for L0 2021-07-21T11:28:08 INFO flash_loader.c: Successfully loaded flash loader in sram 2021-07-21T11:28:08 INFO flash_loader.c: Clear DFSR 2021-07-21T11:28:08 ERROR flash_loader.c: write_buffer_to_sram() == -1 2021-07-21T11:28:08 WARN common.c: Failed to use flash loader, fallback to soft write 1232/1232 halfpages written 2021-07-21T11:28:14 INFO common.c: Starting verification of write complete 2021-07-21T11:28:15 INFO common.c: Flash written and verified! jolly good!
using branch master 1.7.0:
st-flash --connect-under-reset --format=ihex write /home/pi/Downloads/v1.hex st-flash 1.7.0 2021-07-21T11:50:56 INFO usb.c: Unable to match requested speed 1800 kHz, using 1000 kHz 2021-07-21T11:50:56 WARN common.c: NRST is not connected 2021-07-21T11:50:56 ERROR common.c: Soft reset failed: timeout 2021-07-21T11:50:56 ERROR common.c: Can not connect to target. Please use 'connect under reset' and try again Failed to connect to target
So it appears to work correctly using the l0_soft_loader_fix branch
Going through this, we need somebody with a L0 board and an STLink-v2 programmer to be able to investigate properly starting with v1.5.1 onwards.
This issue is now closed due to inactivity.
Please also note that any version prior to v1.7.0 is unsupported according to our #Security Policy.
Should the problem persist, please retry with the latest version in the develop branch.
If this is the case, one should then open a new ticket.