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

Fixed writing unaligned sections that may overlap page boundaries of SPI-flash (GF180) #85

Closed
wants to merge 3 commits into from

Conversation

shaos
Copy link

@shaos shaos commented Jul 4, 2023

One example that was written incorrectly by old version of utility:

...
@000009B0
00 00 00 00 01 00 00 00 00 00 00 00 02 00 00 00 
03 00 00 00 02 00 00 00 00 00 00 00 01 00 00 00 
00 00 00 00 02 00 00 00 03 00 00 00 02 00 00 00 
00 00 00 00 04 00 00 00 00 00 00 00 02 00 00 00 
06 00 00 00 02 00 00 00 00 00 00 00 04 00 00 00 
00 00 00 00 02 00 00 00 06 00 00 00 02 00 00 00 
12 00 00 00 02 00 00 00 00 00 00 00 08 00 00 00 
00 00 00 00 60 00 00 00 20 00 00 00 60 00 00 00 
40 00 00 00 60 00 00 00 62 00 00 00 E2 00 00 00 
62 00 00 00 60 00 00 00 62 00 00 00 E2 00 00 00 
E0 00 00 00 60 00 00 00 61 00 00 00 60 00 00 00 
61 00 00 00 60 00 00 00 FF FF FF FF 00 00 00 00 

Previously utility tried to write 256 bytes overlapping to next page 0xA00 and that extensive part was not written properly, corrupting beginning of the current page.

Now fixed utility do

  • erase the flash (entirely as before);
  • read file to buffer (filling holes with FFs and at the end up to the next page boundary);
  • write buffer to flash page by page (so no going through page boundaries while writing);
  • verify by reading flash page by page (comparing with buffer, not file).

CC @jeffdi

@shaos shaos changed the title Fixed writing small sections that may overlap page boundaries Fixed writing unaligned sections that may overlap page boundaries Jul 4, 2023
@shaos shaos changed the title Fixed writing unaligned sections that may overlap page boundaries Fixed writing unaligned sections that may overlap page boundaries (GF180) Jul 5, 2023
@shaos shaos changed the title Fixed writing unaligned sections that may overlap page boundaries (GF180) Fixed writing unaligned sections that may overlap page boundaries of SPI-flash (GF180) Jul 5, 2023
@shaos
Copy link
Author

shaos commented Jul 5, 2023

Problem is still happening if page end is located in the middle of the line so I'm going to re-write most of the logic in the script - reading all sections to array, then write this array page by page to SPI-flash and then do verification against this array (so reading from the file will be done only once). It should also fix this issue: #83

@shaos
Copy link
Author

shaos commented Jul 31, 2023

Now it's fully fixed and ready to go ( it also fixes #83 )

@shaos shaos closed this Aug 2, 2023
@shaos
Copy link
Author

shaos commented Aug 2, 2023

need to re-create this pull-request because repo is too different now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant