defragster
Senior Member+
I got this to repro following what @mjs513 reported with uncannyeyes from noted thread above.
Something odd in linking or run time loading? There are multiple pieces to load as noted.
Update:: post #3710 has two ZIP files that should hold all the needed parts as I have them
I have gotten it to Fail and then Unfail and it hinges on FaultHandler code being local or the 'weak' version in the Teensy4.
No displays are needed just a T4 on a USB cable.
UPDATE :: In case it holds some info without needing to do a full setup/build/repro - here are the Hex/Lst/Elf contents of working and not working build directory in the ZIP as named:
<edit> vfprintf is its own thing:
Here is a copy of the post #361 from the other thread with links and parts needed - if it isn't clear @mjs513 should be able to repro and explain:
Something odd in linking or run time loading? There are multiple pieces to load as noted.
Update:: post #3710 has two ZIP files that should hold all the needed parts as I have them
I have gotten it to Fail and then Unfail and it hinges on FaultHandler code being local or the 'weak' version in the Teensy4.
No displays are needed just a T4 on a USB cable.
UPDATE :: In case it holds some info without needing to do a full setup/build/repro - here are the Hex/Lst/Elf contents of working and not working build directory in the ZIP as named:
T:\TEMP\arduino_build_159521>dir /b
build.options.json
FAILS_T4_build.options.zip :: View attachment FAILS_T4_build.options.zip << these files for FAILS
includes.cache
uncannyEyes0.ino.eep
uncannyEyes0.ino.elf
uncannyEyes0.ino.hex
uncannyEyes0.ino.lst
uncannyEyes0.ino.sym
WORKS_T4_uncannyEyes0.ino.zip :: View attachment WORKS_T4_uncannyEyes0.ino.zip << these files for WORKS
Did a CodeCompare Diff of the two LST files and tons of changes not surprising.
One BIG glaring chunk of stuff MISSING in the FAILS case { .lst is 982 KB ) that is present in the WORKS case { .lst is 1,232 KB } is:
// there are 60+ pages for this item missing in the FAILS case.Code:[COLOR="#FF0000"]00006320 <_vfprintf_r>: 6320: e92d 4ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp, lr} 6324: ed2d 8b06 vpush {d8-d10} 6328: b0b9 sub sp, #228 ; 0xe4[/COLOR] 632a: 461c mov r4, r3 632c: 468a mov sl, r1
<edit> vfprintf is its own thing:
...\hardware\teensy\avr\cores\teensy4\avr\pgmspace.h:
70 #define strstr_P(a, b) strstr((a), (b))
71 #define sprintf_P(s, ...) sprintf((s), __VA_ARGS__)
72: #define vfprintf_P(fp, s, ...) vfprintf((fp), (s), __VA_ARGS__)
73 #define printf_P(...) printf(__VA_ARGS__)
74 #define snprintf_P(s, n, ...) snprintf((s), , __VA_ARGS__)
Here is a copy of the post #361 from the other thread with links and parts needed - if it isn't clear @mjs513 should be able to repro and explain:
Lots of pieces from https://forum.pjrc.com/threads/55735-ILI9488_t3-Support-for-the-ILI9488-on-T3-x-and-beyond?p=210182&viewfull=1#post210182 ::
https://github.com/PaulStoffregen/cores
https://github.com/KurtE/Adafruit-GFX-Library
https://github.com/PaulStoffregen/SPI
Here is the UnCannyEyes as used here - with local copy of HardFault_HandlerC(): View attachment 16981
from post >>uncannyEyes0.Zip
… link to st7735 … https://github.com/KurtE/ST7735_t3/tree/writeRect_reset_delay
Time to gather …
NOT NEEDED :: from post >>debug_tt.zip
NOTE: Once it compiles to upload a failed repro build - to get back to working SerMon USB seems to take a SECOND Button push to get working SerMon back from USB. The SPI LED will blink - but USB stays corrupted until a second Button Push upload.
<edit> debug_tt - not required if this is placed in the sketch - just toggle: #if 0 and 1.
NOTE: It is not because the HardFault_HandlerC() is truncated - the copy in debug_tt is a full copy - and instead of the minimal copy below I did another FULL copy of the current version from CORES and the repro is the same. The problem seems to be in the linking or code placement in memory - even though in these cases the T4 is never faulting - so the code is never called or executed.
Code:#if 1 // TOGGLE 0 to exclude and cause BAD USB - set back to 1 and recompile to correct. #ifdef __cplusplus extern "C" { #endif #if defined(__IMXRT1052__) || defined(__IMXRT1062__) void HardFault_HandlerC(unsigned int *hardfault_args) { digitalWriteFast( 13, HIGH ); while (1); } #endif #ifdef __cplusplus } // extern "C" #endif #endif
>> Running with BARE T4 on USB cable - white wire T4B2.
OKAY - I get REPRO when this is changed per note above when this line uncommented:
Code:T:\tCode\t4\uncannyEyes0\config.h: 136 #define BLINK_PIN 1 // Pin for manual blink button (BOTH eyes) 137 #define LIGHT_PIN A2 // Photocell or potentiometer (else auto iris) [COLOR="#FF0000"] 138: //#define LIGHT_PIN_FLIP // If defined, reverse reading from dial/photocell[/COLOR]
NOTE: it fails, then Button upload when debug_tt active in sketch by uncommenting or recommenting - when the local copy of "HardFault_HandlerC" comes or goes - just the change in config.h causes the code to recompile and that brings the failure back.
Note from @mjs513 above:To duplicate load up the sketch on a clean install and then just comment/uncomment the lineIn this case uncomment it. You don't even need to have displays attached. To duplicate it though you can't use your debug_tt. If you include it, it some how fixes the problem.Code://#define LIGHT_PIN_FLIP // If defined, reverse reading from dial/photocell
BUT:: IDE SerMon shows Garbage after first upload - it comes online properly with a second Button Upload. It looks like this:
>> This is a telling PIC of bad USB Garbage from other post <<
Then it clears up showing the 64's and is running???
Edit: I am seeing two kinds of fail - the obvious one I removed debug_tt and made the config.h change - T4 not running - no SPI LED and this on SerMon:
Code:T:\tCode\T4\uncannyEyes0\uncannyEyes0.ino Jul 14 2019 20:57:03 ******** T4 connected Serial_tt ******* debug_tt port T:\tCode\T4\uncannyEyes0\uncannyEyes0.ino Jul 14 2019 20:57:03InitCreate display #Create display #Reset displaysCall init/begin func for each display
The less obvious case it seemed to start and print normally - and had to observe the LED stayed OFF - with no SPI activity.
--- This text from WIP - before I had clean repro steps ---
<EDIT UPDATE> I am not getting "REPRO / NO REPRO /REPRO / … " by reverting the code?
@mjs513 - is your note saying any change to 'LIGHT_PIN' ? I did get a hang now with it commented - before it was when uncommented?
It does seem to take 'Clean Build' - once it works it seems to persist? Maybe it is a change from change to '\uncannyEyes0\config.h' ?
Last edited: