uf2-samdx1 icon indicating copy to clipboard operation
uf2-samdx1 copied to clipboard

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

Open JetForMe opened this issue 5 years ago • 9 comments

Fixes #88.

Works for SAMD21, not sure about SAMD51.

JetForMe avatar Mar 14 '20 08:03 JetForMe

SAMD51 may have different BOD bits to test.

JetForMe avatar Mar 14 '20 08:03 JetForMe

Does anyone review these?

JetForMe avatar Jun 25 '20 11:06 JetForMe

@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 avatar Jun 25 '20 13:06 dhalbert

@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 avatar Jun 25 '20 13:06 dhalbert

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.

dhalbert avatar Jun 25 '20 13:06 dhalbert

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.

JetForMe avatar Jun 26 '20 00:06 JetForMe

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).

dhalbert avatar Jun 26 '20 00:06 dhalbert

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.

JetForMe avatar Jun 26 '20 00:06 JetForMe

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.

dhalbert avatar Jun 26 '20 01:06 dhalbert