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

flashing: Impossible to flash large file on stm32f4 #68

Closed
ardf69 opened this issue Mar 9, 2012 · 6 comments · Fixed by #268
Closed

flashing: Impossible to flash large file on stm32f4 #68

ardf69 opened this issue Mar 9, 2012 · 6 comments · Fixed by #268

Comments

@ardf69
Copy link

ardf69 commented Mar 9, 2012

If I flash a file of 0x74000 size with the following command

st-flash write file.bin 0x08080000

I obtain the following error:

2012-03-09T15:48:20 INFO src/stlink-common.c: Loading device parameters....
2012-03-09T15:48:20 INFO src/stlink-common.c: Device connected is: F4 device, id 0x20006411
2012-03-09T15:48:20 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
2012-03-09T15:48:20 INFO src/stlink-common.c: Ignoring 1 bytes of Zeros at end of file
2012-03-09T15:48:20 INFO src/stlink-common.c: Attempting to write 475135 (0x73fff) bytes to stm32 address: 134742016 (0x8080000)
2012-03-09T15:48:20 WARN src/stlink-common.c: unaligned addr or size
stlink_fwrite_flash() == -1

Ciao Angelo

@karlp
Copy link
Contributor

karlp commented Jun 26, 2012

This should be closed, F4 flashing has been rewritten to use an sram based flash loader, so this should no longer be an issue.

@rewolff
Copy link
Contributor

rewolff commented Aug 6, 2013

@karlp : NOPE!
the problem is (I think) a different one.
At least.. I was intending to report a bug(and fix) I found, but it looks suspiciously like this one (mentioning the EXACT same byte address where my bug begins)....

Here is the patch:

--- a/gdbserver/gdb-server.c
+++ b/gdbserver/gdb-server.c
@@ -271,7 +271,7 @@ static const char* const memory_map_template_F4 =
   "  <memory type=\"flash\" start=\"0x08010000\" length=\"0x10000\">"          
   "    <property name=\"blocksize\">0x10000</property>"                        
   "  </memory>"
-  "  <memory type=\"flash\" start=\"0x08020000\" length=\"0x70000\">"          
+  "  <memory type=\"flash\" start=\"0x08020000\" length=\"0xE0000\">"          
   "    <property name=\"blocksize\">0x20000</property>"                        
   "  </memory>"
   "  <memory type=\"ram\" start=\"0x40000000\" length=\"0x1fffffff\"/>"        

As ardf69 seems to be using the "st-flash" program and this is located in the gdb-server code, it seems a similar bug exists in the st-flash code.

Update. F*** github. Can't put a patch in a comment.
On line 274 of gdb-server.c change 0x70000 to 0xe0000 .

@karlp
Copy link
Contributor

karlp commented Aug 6, 2013

  1. try reading the "GitHub Flavoured Markdown" help box on the top right of the comment form, it would show you how to put your code inline, with highlighting, instead of using [code] from wordpress or something.
  2. actually, that's all, I don't use stlink at all anymore, so I'm not looking at this.

@xor-gate xor-gate closed this as completed May 4, 2016
@Nightwalker-87 Nightwalker-87 added this to the v1.6.1 milestone Feb 24, 2020
@Nightwalker-87 Nightwalker-87 added this to To do in Release v1.6.1 via automation Feb 24, 2020
Release v1.6.1 automation moved this from To do to In progress Feb 24, 2020
@Nightwalker-87 Nightwalker-87 moved this from In progress to To do in Release v1.6.1 Feb 27, 2020
@Nightwalker-87 Nightwalker-87 changed the title Impossible to flash large file on stm32f4 flashing: Impossible to flash large file on stm32f4 Mar 17, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: v1.6.1, Feedback required Mar 20, 2020
@Nightwalker-87 Nightwalker-87 removed this from To do in Release v1.6.1 Mar 20, 2020
@Nightwalker-87
Copy link
Member

Why was this closed? I think we should verify if this has been fixed in the code.

@Nightwalker-87
Copy link
Member

Nightwalker-87 commented Mar 27, 2020

@rewolff: I found that your patch has made it into the code and linked the related PR to this ticket.

@Nightwalker-87
Copy link
Member

Closed by commit 8151bf5 and PR #268.

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

Successfully merging a pull request may close this issue.

5 participants