-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Xmc flash 2 #7317
Xmc flash 2 #7317
Conversation
eboot is always run with the flash access speed set to 20MHz, so there is no need for special treatment of XMC chips.
If the data written to flash is as expected, the line cmp:0 will be displayed after the usual @cp:0 from eboot.
For some reason this was an issue during the reboot after an OTA update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code wise it looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'm not sure what the point of checking is. The way the code is written, you'll get an error, print a failure code, clear the command buffer and then SWRESET. At that time it'll just LOAD_APP anyway, same as if it passed verification.
That said, I can't give a much better idea of what to do in that case, anyway. Don't want to continually overwrite (i.e. don't clear the cmd so next reboot will try writing again) as you could end up in a hard reboot-write-reboot-write...loop and destroy the flash.
The verify is supposed to cover the case when the flash write seems to succeed, i. e. no error, but in truth it didn't take at hw level due to whatever reason. |
@earlephilhower the check is relatively cheap (in terms of code size and execution time) and if we do have problems with OTA updates to XMC chips will make it easy to identify if it is a problem with writing to the chip. |
Remove the unnecessary XMC chip support from eboot and verify the flash contents after copying new firmware.
Testing shows there should be no issue with the XMC chips in eboot because the flash access speed is always 20MHz, however verifying the content written will help identify any issues if they do occur.
The additional code is minimal, and as it only reads, the verify is very quick.