-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Wrong contents written for particular binary file #193
Comments
I ran into the same issue with a different binary file. I'm using an STM32F417.
|
Hi, I reviewed the code in file src/stlink_common.c, function Could you comment the num_empty computation logic (from line 1749 to 1760) Thanks 2014-03-20 20:42 GMT+01:00 yigitb [email protected]:
|
Hi, I commented out the num_empty lines, and the corrupted bytes are still there, at the same location as before. Here is the diff of the what's programmed vs. what's on the processor: The version with a lot of 0's are from the processor. The differences after the first line are actually starting from offset 0xc000, if that makes a difference. Thanks. |
Thanks for the info, I will investigate asap. Any help welcome ! 2014-03-24 14:19 GMT-05:00 yigitb [email protected]:
|
Hi again, I think I found a workaround. I commented out the lines that set the stack pointer and the program counter, then run the processor after programming in stlink_fwrite_flash() (lines 1763, 1765, 1766 in stlink-common.c). The specific binary file I was working with programmed just fine. I tested it multiple times and on two different processors, and they are correct byte by byte. I didn't try any other binary files yet. I honestly have no clue why this workaround works, though. |
It is strange. Could you remove your comments and put a long delay ( Let me know, Thanks 2014-03-24 16:41 GMT-05:00 yigitb [email protected]:
|
Hi, The sleep() call didn't seem to change anything. The binary still gets corrupted if the register sets are there. |
Thanks for the info. Then, I have no clue ... 2014-03-27 14:11 GMT-05:00 yigitb [email protected]:
|
As this is a old issue, please test against latest tools in master, and latest stlink firmware. Reopen a new issue when the problem still exists with more details. |
This problem appeared about one month before Release v1.0.0. This has likely been fixed somewhen around that point in time, but not clear where exactly - which would be helpful though. Maybe addressed by 5dcd45d ? Any helpful ideas when looking at it? |
@chenguokai: You contributed to "st-flash write is ignoring 0xff at end of file" (Issue 609). |
It could be, I will check the binary file if possible. Edit: The diff results seem to be irrelevant with the 0xff ones. That issue only affects the tail empty bytes. For this one, however, corrupted bytes appear in the middle. |
Obviously fixed by #377 where the mentioned code section was rewritten. |
When writing this https://www.dropbox.com/s/ykshejjyu77pwmy/rand.bin file at 0x8004000 using
and reading it back using
the read data https://www.dropbox.com/s/9w2vjmo1ap0i97e/flash.bin differs from the written data around offset 0x650. Writing the binary file using the built-in dfu bootloader works just fine.
STM320F407 on STM32F4DISCOVERY
The text was updated successfully, but these errors were encountered: