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

Cannot flash STM32L151 w Stlink/v2 on MAC #596

Closed
JonesWest opened this issue May 19, 2017 · 2 comments · Fixed by #847
Closed

Cannot flash STM32L151 w Stlink/v2 on MAC #596

JonesWest opened this issue May 19, 2017 · 2 comments · Fixed by #847

Comments

@JonesWest
Copy link

JonesWest commented May 19, 2017

Hi,

I am trying to flash a an STM32L151 using Stlink/v2 on a Mac with OSX Sierra.
I've installed stlink 1.3.1 using homebrew as explained in the readme. I am now trying to flash the device:

$ st-flash write Bootloader.bin 0x08000000
st-flash 1.3.1
2017-05-19T14:13:37 INFO src/common.c: Loading device parameters....
2017-05-19T14:13:37 INFO src/common.c: Device connected is: L1 Medium-Plus-density device, id 0x10386427
2017-05-19T14:13:37 INFO src/common.c: SRAM size: 0x8000 bytes (32 KiB), Flash: 0x40000 bytes (256 KiB) in pages of 256 bytes
2017-05-19T14:13:37 INFO src/common.c: Attempting to write 37348 (0x91e4) bytes to stm32 address: 134217728 (0x8000000)
2017-05-19T14:13:37 WARN src/common.c: pecr.pelock not clear (0x7)
2017-05-19T14:13:37 ERROR src/common.c: Failed to erase_flash_page(0x8000000) == -1
stlink_fwrite_flash() == -1

My Stlink/v2 is running V2.J27.S6 JTAG+SWIM Debugger
And I've tried downgrading to V2.J17.S4, but it makes no difference.

Anyone?

@xor-gate
Copy link
Member

xor-gate commented Jun 10, 2017

Could you try a building a newer version from the master branch sources? And see if the problem remains?

@xor-gate xor-gate added this to the Unplanned (Contributions Welcome) milestone Jun 10, 2017
@Nightwalker-87 Nightwalker-87 modified the milestones: Unplanned (Contributions Welcome), Next, General, Feedback required Feb 19, 2020
@Nightwalker-87 Nightwalker-87 self-assigned this Feb 21, 2020
@Nightwalker-87 Nightwalker-87 removed their assignment Mar 21, 2020
@Nightwalker-87 Nightwalker-87 added the programmer/STLINK/V2 V2 / V2-A / V2-B label Mar 21, 2020
@Nightwalker-87
Copy link
Member

Nightwalker-87 commented Apr 9, 2020

2017-05-19T14:13:37 WARN src/common.c: pecr.pelock not clear (0x7)

This indicates that the flash memory of the used device is locked.
Unlocking for this chip is possible since commit 751da60 / PR #847, which added support to write option bytes for the STM32L1 device family. An example how to make use of this feature with the st-flash command can be found in our project documentation in /doc/tutorial.md.
As this answer fully addresses this request for support, this issue is now closed as resolved.

@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.