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

STM32F1 load fail #182

Closed
dimitraPat opened this issue Oct 4, 2013 · 13 comments
Closed

STM32F1 load fail #182

dimitraPat opened this issue Oct 4, 2013 · 13 comments

Comments

@dimitraPat
Copy link

@dimitraPat dimitraPat commented Oct 4, 2013

Hi!
I've found this utility for flashing the STM32 mcu and I think it's very cool.

However, I've been trying to flash the STM32F1 and while at the beginning seems to load correctly, when it reaches add 0x08080000 the flash loader fails.

Does the utility support F1? Do I have to change anything in order to work correctly?

Thanks!

@qneverless
Copy link

@qneverless qneverless commented Oct 5, 2013

Does your mcu have more than 512kB of memory?

@dimitraPat
Copy link
Author

@dimitraPat dimitraPat commented Oct 7, 2013

Yes, the mcu is with dual flash banks. The second bank must be defined somehow.

@jsarenik
Copy link

@jsarenik jsarenik commented Oct 9, 2013

I have the same problem on current version of stlink (a13e75a) with STM32VL-DISCOVERY and STM32F105 (both over STLINKv1).

When I try to 'load' via arm-none-eabi-gdb, I get following on the st-util terminal:
ERROR src/stlink-common.c: flash loader run error
ERROR src/stlink-common.c: run_flash_loader(0x8000000) failed! == -1

and on the GDB terminal I get 'Error finishing flash operation'.

When I use st-flash, it works with the latest version, using
st-flash write out.bin 0x08000000

I have tried to compile older stlink (as I remember it worked back then),
29d03e9 and 'load' via GDB works
with that version. Sorry I cannot bisect at the moment but in case I do,
will let you know which commit breaks it.

Thanks and good luck!

@jsarenik
Copy link

@jsarenik jsarenik commented Oct 15, 2013

My problem is fixed by using "-1" flag for st-util. Tested with latest commit.

@AmazingPants
Copy link

@AmazingPants AmazingPants commented Apr 28, 2014

@jsarenik please can you explain in detail what did you do?

@jsarenik
Copy link

@jsarenik jsarenik commented Apr 28, 2014

There is not much to explain. I just run "st-util -1" whenever I would run "st-util"... does that make sense?

@idubrov
Copy link

@idubrov idubrov commented May 23, 2014

Somehow adding "-v" fixes similar problem to me. I.e, "st-util" fails whenether I try to load image & debug from Eclipse, "st-util -v" works. Bizarre.

@xor-gate
Copy link
Member

@xor-gate xor-gate commented May 17, 2016

Feel free to open a new issue when the problem still remains with v1.2.0 or master. Thanks all for your contributions.

@xor-gate xor-gate closed this May 17, 2016
@jonbinney
Copy link

@jonbinney jonbinney commented Jun 19, 2016

-v fixed the problem for me as well... very strange....

@jsarenik
Copy link

@jsarenik jsarenik commented Jun 20, 2016

Yes, I remember that behavior. With -v it worked, without it needed -1 to work. I no longer have the HW to try v1.2.0.

@xor-gate
Copy link
Member

@xor-gate xor-gate commented Jun 20, 2016

@jonbinney do you still need -v with v1.2.0 ?

@jonbinney
Copy link

@jonbinney jonbinney commented Jun 20, 2016

I did have this problem yesterday with the current git master version (hash 3f7d0f9df3b1b551ac317b9d3a185c48f19c0c97 )

But today (after a reboot) I can't reproduce the problem at all. It works with or without -v. I tried it 5 times and didn't have any problems.

@xor-gate
Copy link
Member

@xor-gate xor-gate commented Jun 20, 2016

Probably when adding -v printf output takes CPU time and "sleeps" te original code. This seems a timing issue, I have seen an issue with a broken usb cables resulted in super weird behaviour. Probably you could also inspect dmesg | tail when running under linux.

@Nightwalker-87 Nightwalker-87 modified the milestones: Resolved questions, v1.2.0 and older Feb 25, 2020
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 14, 2020
@stlink-org stlink-org deleted a comment from armdeveloper Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.