Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32L072: Can't flash device #690

Closed
6 tasks done
Faduf opened this issue Mar 21, 2018 · 10 comments · Fixed by #1113
Closed
6 tasks done

STM32L072: Can't flash device #690

Faduf opened this issue Mar 21, 2018 · 10 comments · Fixed by #1113

Comments

@Faduf
Copy link

Faduf commented Mar 21, 2018

I have a similar problem than the issues #593 and #579. I can't flash my STM32L0 anymore and I have the failure "l1_stlink_flash_loader_run(0x8000000) failed! == -1".

  • Stlink/v2-1 onboard
  • Don't know, never changed, board bought in February 2018
  • Linux Ubuntu 16.04
  • st-flash version V1.5.0
  • st-flash
  • STM32L072CZ on the board "STM32L0 Discovery kit LoRa, Sigfox, low-power wireless"
st-flash write obj/l072.bin 0x8000000
st-flash 1.5.0
2018-03-21T19:35:00 INFO common.c: Loading device parameters....
2018-03-21T19:35:00 INFO common.c: Device connected is: L0x Category 5 device, id 0x20086447
2018-03-21T19:35:00 INFO common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x30000 bytes (192 KiB) in pages of 128 bytes
2018-03-21T19:35:00 INFO common.c: Ignoring 96 bytes of 0x00 at end of file
2018-03-21T19:35:00 INFO common.c: Attempting to write 57100 (0xdf0c) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x0800df00 erased
2018-03-21T19:35:02 INFO common.c: Finished erasing 447 pages of 128 (0x80) bytes
2018-03-21T19:35:02 INFO common.c: Starting Half page flash write for STM32L core id
2018-03-21T19:35:02 INFO flash_loader.c: Successfully loaded flash loader in sram
2018-03-21T19:35:05 ERROR flash_loader.c: flash loader run error
2018-03-21T19:35:05 WARN common.c: l1_stlink_flash_loader_run(0x8000000) failed! == -1
2018-03-21T19:35:05 WARN common.c: 
write_half_pages failed == -1
445/446 pages written
2018-03-21T19:35:57 INFO common.c: Starting verification of write complete
2018-03-21T19:35:57 ERROR common.c: Verification of flash failed at offset: 0
stlink_fwrite_flash() == -1
@xor-gate
Copy link
Member

Thats a pitty, the flash loaders for the L0 and L1 seem to be unstable. In the meantime you should try to use openocd if that is possible to get a more stable result.

@Faduf
Copy link
Author

Faduf commented Mar 26, 2018

Ok, thanks for the feedback. Openocd works fine. Don't hesitate if you need help to debug.

@Faduf
Copy link
Author

Faduf commented Apr 1, 2018

This is working in boot mode (boot to Vdd). I'm closing the issue, thanks.

@Faduf Faduf closed this as completed Apr 1, 2018
@xor-gate xor-gate removed this from the Unplanned (Contributions Welcome) milestone Apr 1, 2018
@xor-gate
Copy link
Member

xor-gate commented Apr 1, 2018

Great it works now

@Nightwalker-87
Copy link
Member

@Faduf: Does this work without openocd as well with Release v1.6.0 ? Can someone verify?

@Faduf
Copy link
Author

Faduf commented Mar 21, 2020

@Nightwalker-87 sorry for not giving feedback on this topic but I'm stuck at home due to the coronavirus pandemy. My boards with the F0 chip are at the office and I can't go there until few weeks.

@Nightwalker-87
Copy link
Member

@Faduf: No problem at all, we're not in a hurry. Thx for your feedback. 👍

@Nightwalker-87
Copy link
Member

Sorry for the delay. Please check if #876 resolves this problem as it resolves #579, one of the similar issues you mentioned in your opening post.

@Nightwalker-87 Nightwalker-87 changed the title Can't flash STM32L072 STM32L072: Can't flash device Apr 2, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: Feedback required, Device issues Apr 2, 2020
@grevaillot
Copy link
Collaborator

grevaillot commented Apr 3, 2020

I just checked on my tree with the same board (l0 discovery lora thing), apparently there's a flash loader run error, indeed - but the flashing goes well here.
i dont think i have an other l0 device to check.

% ./build/Release/st-flash write /tmp/saved.bin 0x8000000
st-flash 1.6.0-98-gd7cffeb-dirty
2020-04-03T10:55:23 INFO common.c: L0xx Category 5: 20 KiB SRAM, 192 KiB flash in 128 byte pages.
2020-04-03T10:55:23 INFO common.c: Attempting to write 196608 (0x30000) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x0802ff80 erased
2020-04-03T10:55:33 INFO common.c: Finished erasing 1536 pages of 128 (0x80) bytes
2020-04-03T10:55:33 INFO common.c: Starting Half page flash write for STM32L core id
2020-04-03T10:55:33 INFO flash_loader.c: Successfully loaded flash loader in sram
2020-04-03T10:55:34 ERROR flash_loader.c: flash loader run error
2020-04-03T10:55:34 WARN common.c: l1_stlink_flash_loader_run(0x8000000) failed! == -1
2020-04-03T10:55:34 WARN common.c:
write_half_pages failed == -1
1535/1536 pages written
2020-04-03T10:58:38 INFO common.c: Starting verification of write complete
2020-04-03T10:58:40 INFO common.c: Flash written and verified! jolly good!

I'll have a look at the flash loader run error.

@Nightwalker-87
Copy link
Member

Ah, thx @grevaillot! I know about this error from quite a few other tickets.
It would be very helpful indeed, if you could find a solution to this.

@Nightwalker-87 Nightwalker-87 modified the milestones: Device issues, Flash-loader errors Apr 6, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: c) Flash loader run errors, a) Old issues, Old issues, v1.6.2 Mar 11, 2021
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Mar 25, 2021
@Nightwalker-87 Nightwalker-87 moved this to Done in Release v1.7.0 Apr 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.