microsoft / uf2-samdx1

USB Mass Storage bootloader (based on UF2) for SAMD21 and SAMD51
Other
243 stars 300 forks source link

Fix for Isse #88: check BOD as well as POR when checking for double-c… #89

Open JetForMe opened 4 years ago

JetForMe commented 4 years ago

Fixes #88.

Works for SAMD21, not sure about SAMD51.

JetForMe commented 4 years ago

SAMD51 may have different BOD bits to test.

JetForMe commented 4 years ago

Does anyone review these?

dhalbert commented 4 years ago

@JetForMe What is the behavior you're trying to get by this? Do you want to enter the bootloader on brownout, or only on multiple brownouts?

dhalbert commented 4 years ago

@JetForMe What is the behavior you're trying to get by this? Do you want to enter the bootloader on brownout, or only on multiple brownouts?

OK, I looked at the other issues, and now understand the context. It's good to explain more fully when you submit a bare PR that doesn't reference an issue.

dhalbert commented 4 years ago

Take a look at https://github.com/adafruit/uf2-samdx1/pull/111, which waits for 100ms for stable voltage. That was to solve a spurious flash write problem on SAMD51 due to low/erratic voltage.

JetForMe commented 4 years ago

Oh, I may have not properly referenced the issue, but I did mention #88 in the title. I had put the project aside when the pandemic hit (busy getting laid off), but decided to look at it again yesterday which is why this came up again.

dhalbert commented 4 years ago

Thanks, I missed the title reference. I put a "Fixes ..." in the OP so the issue will be linked. I will need to test this on a SAMD51, though I think the behavior may already have gone away due to https://github.com/adafruit/uf2-samdx1/pull/111 (which is not yet in this repo).

JetForMe commented 4 years ago

https://github.com/adafruit/uf2-samdx1/pull/111 may prevent it, but still seems like it's more correct to check for a double-tap of the actual reset button, not just any reset source.

dhalbert commented 4 years ago

adafruit#111 may prevent it, but still seems like it's more correct to check for a double-tap of the actual reset button, not just any reset source.

I agree, I would still plan to incorporate this.