adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.11k stars 1.22k forks source link

JTAG stopped working on Kaluga #3843

Open jepler opened 3 years ago

jepler commented 3 years ago

I recently experienced that shortly after starting CircuitPython, JTAG debugging on the Kaluga would stop. I think this may be due to #3643, though I didn't bisect it. I can work around it by making the jtag pins never-reset, but I'm not sure if this is the right fix since this (I think) would stop people using them as GPIO in general.

+    common_hal_never_reset_pin(&pin_GPIO39);
+    common_hal_never_reset_pin(&pin_GPIO40);
+    common_hal_never_reset_pin(&pin_GPIO41);
+    common_hal_never_reset_pin(&pin_GPIO42);

Also, the existing never_reset calls are in a board-specific file so this would need to be carried across all boards.

Is there a better way? Or should I go ahead and submit a PR along these lines?

tannewt commented 3 years ago

I was hoping the new reset code would preserve it by leaving the mux alone. I think the right fix is to preserve any pulls as well on those pins.