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

Nucleo-F303K8: Flash loader run error with eclipse or gdb #807

Closed
5 tasks done
sawik-PL opened this issue May 25, 2019 · 6 comments · Fixed by #1113
Closed
5 tasks done

Nucleo-F303K8: Flash loader run error with eclipse or gdb #807

sawik-PL opened this issue May 25, 2019 · 6 comments · Fixed by #1113

Comments

@sawik-PL
Copy link

sawik-PL commented May 25, 2019

  • Programmer/board type: Nucleo-F303K8 Stlink/v2-1-onboard
  • Operating system: Linux
  • Stlink tools version and/or git commit hash: 1.5.1-28-gd040db5
  • Stlink commandline tool name: st-util -m -v
  • Target chip (and optional board): e.g STM32F303K8 Nucleo-F303K8

From debug output:
2019-05-25T22:01:13 ERROR flash_loader.c: write error, count == 1023
2019-05-25T22:01:13 ERROR common.c: stlink_flash_loader_run(0x8003800) failed! =
when trying to flash app image (from eclipse or gdb) - please note, that app begins not at the beginning of the flash region (offset is 0x3000)

Log attached
issue-log.txt

@xor-gate xor-gate changed the title flashing error on F303K8 Flash loader run error on F303K8 with eclipse or gdb May 28, 2019
@xor-gate
Copy link
Member

Are you sure there is no flash write protection?

@sawik-PL
Copy link
Author

Just checked to be 100% sure. The sequence is following

$ st-flash erase
st-flash 1.5.1-28-gd040db5
2019-05-28T21:04:02 INFO common.c: Loading device parameters....
2019-05-28T21:04:02 INFO common.c: Device connected is: F3xx medium density device, id 0x10016438
2019-05-28T21:04:02 INFO common.c: SRAM size: 0x3000 bytes (12 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes
Mass erasing

Then flashing bootloader:

st-flash write build/STR-bootloader.bin 0x8000000
st-flash 1.5.1-28-gd040db5
2019-05-28T21:06:47 INFO common.c: Loading device parameters....
2019-05-28T21:06:47 INFO common.c: Device connected is: F3xx medium density device, id 0x10016438
2019-05-28T21:06:47 INFO common.c: SRAM size: 0x3000 bytes (12 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes
2019-05-28T21:06:47 INFO common.c: Attempting to write 9660 (0x25bc) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08002000 erased
2019-05-28T21:06:47 INFO common.c: Finished erasing 5 pages of 2048 (0x800) bytes
2019-05-28T21:06:47 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2019-05-28T21:06:47 INFO flash_loader.c: Successfully loaded flash loader in sram
5/5 pages written
2019-05-28T21:06:48 INFO common.c: Starting verification of write complete
2019-05-28T21:06:48 INFO common.c: Flash written and verified! jolly good!

Bootloader works
Then running

st-util -m -v

and trying to load app from eclipse/gdb

  • works once
  • doesn't work next times
  • but works via command line "st-flash write build/STR-app.bin 0x8003000"

@Nightwalker-87 Nightwalker-87 added this to the General milestone Feb 19, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: General, v1.7.0, Feedback required Mar 14, 2020
@Nightwalker-87 Nightwalker-87 changed the title Flash loader run error on F303K8 with eclipse or gdb Nucleo-F303K8: Flash loader run error with eclipse or gdb Apr 1, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: Feedback required, Device issues, ERROR flash_loader.c: write error Apr 1, 2020
@Nightwalker-87
Copy link
Member

This wants verification with Release v1.6.0 and at least comparable hardware.

@Nightwalker-87 Nightwalker-87 modified the milestones: e) ERROR flash_loader.c: write error, a) Old issues Mar 11, 2021
@Nightwalker-87 Nightwalker-87 modified the milestones: Old issues, v1.6.2 Mar 22, 2021
@Nightwalker-87
Copy link
Member

Nightwalker-87 commented Mar 25, 2021

@Ant-ON: What is the actual definition of stlink_flash_loader_run(0x8003800)?

@Ant-ON
Copy link
Collaborator

Ant-ON commented Apr 6, 2021

@Nightwalker-87 I think this should be fixed by #1113
ps 0x8003800 is not an error code, it's the write address.

@Nightwalker-87 Nightwalker-87 linked a pull request Apr 6, 2021 that will close this issue
@Nightwalker-87
Copy link
Member

Closed by #1113.

@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants