If UART_C2 is set before the corresponding serial port is initialized, despite the fact that the datasheet says it can be read or written at any time, seems to lock up the Teensy. Does anyone know why this may be? I can't seem to find any information about this in the datasheet. My guess is the UART clock isn't enabled.
This was tried on a Teensy 3.2.
Code:
void setup() {
Serial.begin(115200);
while (!Serial && millis() < 4000) {}
Serial.println("1");
// Serial3.begin(115200); <-- Uncomment to not lock up
UART2_C2 &= ~UART_C2_ILIE;
Serial.println("2"); // <-- This doesn't print
}
void loop() {
}
This was tried on a Teensy 3.2.
Last edited: