Rt1010 sdphost always write to flash#98
Conversation
…d mode (Boot Mode = 01)
nxf58843
left a comment
There was a problem hiding this comment.
I will try to check on hardware this weekend.
| Note1: `sdphost` executable binaries for common platforms (windows/mac/linux) are included in sdphost folder. If you have issue with executable permission, just manually give it permission to run. The source code for sdphost tool is also included just in case binaries for your host platform is not included (e.g ARM, RISC-V etc ...) | ||
|
|
||
| Note2: Since SDP with BootROM doesn't requires external debugger and always exists regardless of the external flash, this method can also be used to de-brick your board should it needs. | ||
| Note2: Since SDP with BootROM doesn't requires external debugger and always exists regardless of the external flash, this method can also be used to de-brick your board should it needs. |
There was a problem hiding this comment.
"should it be necessary" or "should it be needed" would be better grammatically
| uint32_t const boot_mode = (SRC->SBMR2 & SRC_SBMR2_BMOD_MASK) >> SRC_SBMR2_BMOD_SHIFT; | ||
| if (boot_mode == 1) |
There was a problem hiding this comment.
Should we check the revision to prevent accidentally downgrading?
There was a problem hiding this comment.
I thought of this, however there is actually no need to check against SDP. SDP is either production mode or the desperate mode. When used it should just overwrite whatever on the flash.
There was a problem hiding this comment.
That is safest for de-bricking. There is an outside chance that they grab an older .bin than was previously loaded on the board but if they switched to serial download mode it is probably safer to let them load it anyway.
There was a problem hiding this comment.
yup, for version stepping, it is doable in much easier way with drag & drop update-tinyuf2.uf2 is really the de-brick move when user accidentally corrupt flash config and/or bootloader
|
@nxf58843 thank you for reviewing, I have tried it locally and it works well. Since there are several folks at Adafruit working on and need this to test out the prototype hardware. I will merge it now, should there is any issues, we will fix it with follow up PR. |
Use bootmode from SRC->SBMR2 to determine whether we are in Serial Download mode. If so write the tinyuf2 image to flash. So basically everytime SDPHost is uesd, it will write contents to flash. This works better as
@nxf58843 @gsteiert would you mind reviewing the PR, also please accept the contributor invitation, it make requesting you as reviewer much easier in the future