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

STM32F091RC: Flashing fails (#356, but mass erase does not work) #612

Closed
4 tasks done
sandeepmvd opened this issue Jun 30, 2017 · 5 comments · Fixed by #1113
Closed
4 tasks done

STM32F091RC: Flashing fails (#356, but mass erase does not work) #612

sandeepmvd opened this issue Jun 30, 2017 · 5 comments · Fixed by #1113

Comments

@sandeepmvd
Copy link

sandeepmvd commented Jun 30, 2017

  • Programmer/board type: Stlink/v2
  • Operating system: Linux
  • Stlink commandline tool name: st-flash & st-util
  • Target chip (and optional board): STM32F091RC

I am seeing the issue mentioned in : #356

I tried mass erase and flash but that did not work.

OUTPUT/ERROR of the commandline tool(s)
F091RC$ st-flash erase
st-flash 1.3.1-19-g55c0572
2017-06-30T18:51:00 INFO src/common.c: Loading device parameters....
2017-06-30T18:51:00 INFO src/common.c: Device connected is: F09X device, id 0x10006442
2017-06-30T18:51:00 INFO src/common.c: SRAM size: 0x8000 bytes (32 KiB), Flash: 0x40000 bytes (256 KiB) in pages of 2048 bytes
Mass erasing

F091RC$ st-flash write ./BUILD/NUCLEO_F091RC/GCC_ARM/example.bin 0x8000000
st-flash 1.3.1-19-g55c0572
2017-06-30T18:51:11 INFO src/common.c: Loading device parameters....
2017-06-30T18:51:11 INFO src/common.c: Device connected is: F09X device, id 0x10006442
2017-06-30T18:51:11 INFO src/common.c: SRAM size: 0x8000 bytes (32 KiB), Flash: 0x40000 bytes (256 KiB) in pages of 2048 bytes
2017-06-30T18:51:11 INFO src/common.c: Attempting to write 124096 (0x1e4c0) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x0801e000 erased
2017-06-30T18:51:13 INFO src/common.c: Finished erasing 61 pages of 2048 (0x800) bytes
2017-06-30T18:51:13 INFO src/common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2017-06-30T18:51:13 INFO src/flash_loader.c: Successfully loaded flash loader in sram
2017-06-30T18:51:13 ERROR src/flash_loader.c: write error, count == 4294967295
2017-06-30T18:51:13 ERROR src/common.c: stlink_flash_loader_run(0x8000000) failed! == -1
stlink_fwrite_flash() == -1

Expected/description:
Should be able to flash without issues

@sandeepmvd sandeepmvd changed the title F091RC flashing on F091RC fails (Same as #356 but mass erase does not work) Jun 30, 2017
@xor-gate xor-gate modified the milestones: v1.3.2, Unplanned (Contributions Welcome) Jun 30, 2017
@sandeepmvd
Copy link
Author

I could reproduce it again today.

Mass erase did not work.

But when i unplugged st-link from power and connected back(basically reset st-link), i was able to flash..

@yohboy
Copy link

yohboy commented Jul 6, 2017

Hi, same problem on L073RZ.
Mass erase did not work. Reset did not work too.
It works some time but not a lot ...
Always this errors :
st-flash 1.4.0-1-g5e740a8
2017-07-06T15:51:16 INFO src/common.c: Loading device parameters....
2017-07-06T15:51:16 INFO src/common.c: Device connected is: L0x Category 5 device, id 0x20086447
2017-07-06T15:51:16 INFO src/common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x30000 bytes (192 KiB) in pages of 128 bytes
2017-07-06T15:51:16 INFO src/common.c: Attempting to write 105836 (0x19d6c) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08019d00 erased
2017-07-06T15:51:22 INFO src/common.c: Finished erasing 827 pages of 128 (0x80) bytes
2017-07-06T15:51:22 INFO src/common.c: Starting Half page flash write for STM32L core id
2017-07-06T15:51:22 INFO src/flash_loader.c: Successfully loaded flash loader in sram
2017-07-06T15:51:26 ERROR src/flash_loader.c: flash loader run error
2017-07-06T15:51:26 WARN src/common.c: l1_stlink_flash_loader_run(0x8000000) failed! == -1
2017-07-06T15:51:26 WARN src/common.c:
write_half_pages failed == -1
825/826 pages written
2017-07-06T15:53:05 INFO src/common.c: Starting verification of write complete
2017-07-06T15:53:07 INFO src/common.c: Flash written and verified! jolly good!

Of course it's not working.

@fuzzyTew
Copy link

fuzzyTew commented Aug 6, 2017

I had this issue, and resolved it by bringing my st-link firmware up-to-date using the windows utility. It now functions in linux perfectly.

@fuzzyTew
Copy link

fuzzyTew commented Aug 6, 2017

Update: After firmware update, I was able to flash my own code, but I was still unable to flash the bootloader using st-flash or gdb. The windows utility reported that the pages involved were write-protected in the option bytes. When told to program the area, it was able to disable the write protection, flash, and then re-enable it, which I suppose is a feature that st-flash lacks.

@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 modified the milestones: Feedback required, v1.5.1 Mar 18, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: v1.5.1, Feedback required Mar 18, 2020
@Nightwalker-87 Nightwalker-87 removed their assignment Mar 20, 2020
@Nightwalker-87 Nightwalker-87 changed the title flashing on F091RC fails (Same as #356 but mass erase does not work) F091RC flashing fails (#356, but mass erase does not work) Mar 31, 2020
@Nightwalker-87
Copy link
Member

Duplicate of #597.

@Nightwalker-87 Nightwalker-87 changed the title F091RC flashing fails (#356, but mass erase does not work) STM32F091RC: Flashing fails (#356, but mass erase does not work) Mar 31, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: Feedback required, Device issues, ERROR flash_loader.c: write error Mar 31, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: e) ERROR flash_loader.c: write error, a) Old issues, Old issues, v1.6.2 Mar 11, 2021
@stlink-org stlink-org deleted a comment from xloem Mar 21, 2021
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Mar 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.