adafruit / uf2-samdx1

MSC bootloader (based on UF2) for SAMD21
Other
212 stars 184 forks source link

SAMD51: 48MHz GCLK0 Output on pin PB14 #21

Closed dhalbert closed 5 years ago

dhalbert commented 6 years ago

leftover debugging clock output?

https://github.com/Microsoft/uf2-samd21/issues/43 from @MartinL1:

Shouldn't the lines 8 and 9 in the "init_samd51.c" file be commented out?

// Output GCLK0 to Metro M4 D5. This way we can see if/when we mess it up.
PORT->Group[1].PINCFG[14].bit.PMUXEN = true;
PORT->Group[1].PMUX[7].bit.PMUXE = 12;

It's just that these lines will cause the SAMD51 to output GCLK0 at 48MHz on port pin PB14, whenever the board's in bootloader mode. This is digital pin D5 on the Metro M4.

GMagician commented 5 years ago

I see this now and I already found such lines in code. My 0.02$ answer is yes, you never know what is connected to sub pins so this choice is too dangerous (what if this is a device output...short circuit, with probably some damages) They should be removed as soon as possible

ladyada commented 5 years ago

@GMagician please submit a PR