Closed wyager closed 1 year ago
This might actually have nothing to do with USB, as it looks like even a simple PIT led blinky is broken by uncommenting that line. Closing issue, at least for the moment
For the record, the issue seems to be the use of EXT_SYSTICK_HZ. It's supposed to be set to the core clock freq (like 500MHz or whatever), it seems.
SYSTCK can have two different clock sources. If the clock source is set to "external clock," then EXT_SYSTICK_HZ
is the correct frequency to use for your SYSTICK.
If I'm looking at the right code, it seems that RTIC always uses the processor or "core" clock. EXT_SYSTICK_HZ
won't work in this case. If you're using the teensy4-bsp board setup to configure the clocks, then you can use ARM_FREQUENCY
as the clock frequency for your SYSTICK.
I saw in an earlier version of the teensy4-rs docs, it said that you couldn't have USB logging and systick timing at the same time, but that seems to have been removed.
This was a design limitation of previous BSPs. Nowadays, USB logging and SYSTICK should work together. Reach out if you notice they're not jiving.
Consider the following code, from an RTIC v2 app:
If I uncomment the second line, to activate the systick timer, it seems to break USB. No device even shows up under
/dev/cu....
, and my computer doesn't register any attached USB devices.I saw in an earlier version of the teensy4-rs docs, it said that you couldn't have USB logging and systick timing at the same time, but that seems to have been removed.
Any idea what the situation might be here?