Closed cstrahan closed 1 year ago
Hm... I think this was/is only manifesting when the previous thing flashed to Teensy was a program built with the official Teensy Arduino core. After flashing and then cutting power, subsequent flashes seem to work fine. And a quick sanity checking that I can set the other pins works just fine.
Kind of curious, but I guess I'll close this for now.
Good find. Here's what I guess is happening, with some context:
If a program built from the official SDK were flashed, those IOMUXC_GPR
registers are set. After programming with JTAG, they're likely still set until an appropriate reset can clear those IOMUXC_GPR
register values. A power cycle must be one of those reset events.
If this is correct, something like this code (near the top of board::prepare_resources
) might resolve the issue.
ral::write_reg!(ral::iomuxc_gpr, instances.IOMUXC_GPR, GPR26, 0);
ral::write_reg!(ral::iomuxc_gpr, instances.IOMUXC_GPR, GPR27, 0);
ral::write_reg!(ral::iomuxc_gpr, instances.IOMUXC_GPR, GPR28, 0);
ral::write_reg!(ral::iomuxc_gpr, instances.IOMUXC_GPR, GPR29, 0);
I expect the HalfKay bootloader handles this nuance for the majority of Teensy 4 users 😛 but it's been a while since I've tried the official SDK, so I should double-check this. And this might not hold anymore if the MicroMod has JTAG / SWD debug capabilities.
Describe the bug
When I flash one of the LED blinky examples to my Teensy 4.1 or MicroMod over JTAG, the LED only starts blinking after power cycling.
The following program uses
defmt_rtt
to log messages via RTT, which I successfully receive (usingcargo embed
):But the LED doesn't blink until I power cycle the Teensy. I'm guessing some sort of board initialization issue? :thinking:
To Reproduce
Kinda hard to repro without a modded Teensy :)
Expected behavior
LED blinky example should result in blinky LED.
Additional context
N/A