Paul,
The Teensy AVR print class has a bug in the printNumberHex(unsigned long) function. This shows up when you print uint32_t variables.
If you print a number that is 8 hex digits, you won't get the proper output and it also looks like there is a buffer/stack overflow as well.
Anyway, it looks like the issue is the buffer is exactly 8 bytes which is ok since the code is calling write() with a length vs a C null terminated string,
however it looks like there is an issue with the way the p pointer is handled and then how write() is called once the buffer is built.
Here is a minimal sample sketch that shows the problem:
This same issue may also exist in the other printNumberxxx() functions since the all look to use a similar methodology.
--- bill
The Teensy AVR print class has a bug in the printNumberHex(unsigned long) function. This shows up when you print uint32_t variables.
If you print a number that is 8 hex digits, you won't get the proper output and it also looks like there is a buffer/stack overflow as well.
Anyway, it looks like the issue is the buffer is exactly 8 bytes which is ok since the code is calling write() with a length vs a C null terminated string,
however it looks like there is an issue with the way the p pointer is handled and then how write() is called once the buffer is built.
Here is a minimal sample sketch that shows the problem:
Code:
void setup(void)
{
Serial.begin(9600);
while(!Serial);
Serial.print(0x12345678, HEX);
}
void loop(void){}
This same issue may also exist in the other printNumberxxx() functions since the all look to use a similar methodology.
--- bill