capeman121
Member
anyone can give me a hand with this please. thanks.
void setup() {
while (!Serial && (millis() < 5000)) ;
Serial.begin(115200);
Serial.println("Setup called"); Serial.flush();
(Call your first init function)
Serial.println("First function completed"); Serial.flush();
...
Sketch uses 24736 bytes (38%) of program storage space. Maximum is 63488 bytes.
Global variables use 2600 bytes (31%) of dynamic memory, leaving 5592 bytes for local variables. Maximum is 8192 bytes.
Sketch uses 20740 bytes (32%) of program storage space. Maximum is 63488 bytes.
Global variables use 2468 bytes (30%) of dynamic memory, leaving 5724 bytes for local variables. Maximum is 8192 bytes.
void setup() {
Serial.begin(115200);
while (!Serial && millis() < 5000 );
Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);
DebState( LED_BUILTIN );
// ...
DebText2( "Hello World ", micros() ); // this 2 parameter print formats the string and the value and prints with record of the line number.
DebText( "ping" ); // this will just print text "ping" and the line number where it happened.
_:L=25: Hello World 745088
_:L=28: ping
uint8_t temp;
deb_t3( 4, 222 );
temp = UART2_C2;
>>>> debug_fault >>>> debug_fault >>>> TYPE:hrd
Debug Info:
2 => 476 0x1DC [L#40_C#2
4 => 222 0xDE [L#51_C#6 _<< last func::setup
6 => 47825 0xBAD1 [L#42_C#3
7 => 1052688 0x101010 [L#47_C#5
8 => 476203 0x7442B [L#45_C#4
fault:
??: 4006C000 ??: 33 ??: 0
psradr:FFFFFFF9
lr: 460E r12:C23 r3: 808080
r2: 1FFFFEDC r1: 1FFFFD40 r0: 460E
r4: 33 lr: 20
---
Found a T_LC. It doesn't have a cycle_counter which I was using to 'time' the 'panic' blink. Made a quick workaround that seems to suffice, though not always working with Auto (non-button) Reprogram as it was.
Tested on T_LC only - others should not be affected. There is one ODDITY {dumps string garbage} after a fault I'll need to look into - it seems okay to use as code already faulted. Not sure if it is unique to T_LC - or if I had another change in progress.
Here it is as tested in case it can help - see examples for usage after unzipping and placing into the 'sketchbook\libraries' folder:
Seems to add 3996 bytes of code and uses 132 bytes of RAM on T_LC Serial sketch compiled 'Smallest Code' using new example : "...\libraries\debug_t3\examples\DebugMin\DebugMin.ino"
With Debug included min T_LC Serial sketch:
Same code with all the debug library code and calls removed:
<edit>: Went back to T_3.6 with that code - the string garbage dump is somehow unique to T_LC - and going back to T_LC it doesn't show. The FAULT was in printf() so it was doing USB output. It was captured and helped - but the stream seems corrupted.
re: "Were you able to get Ben's library and example to work on T_LC? "
No, I hadn't looked to repro as I don't have the hardware - was hoping it might show help in your case.
yea i appreciate the debug code but i cant even get the teensy to work after uploading this sketch. seems to just crash. Was hoping to see if someone else had this working on an LC