Please provide a complete/short example showing incorrect function.
If usage was in error forum may help clarify, if the code really is in Error then it needs to be corrected.
Setting this seems essential: InChar = 0; // Added to fix crash after updating to IDE 1.8.19
When called without any Serial.available() if the prior exit was with:: if (InChar == 10)
It will enter that...
Opps - I hesitated asking the obvious ... are there any interrupt functions involved that should not be in FLASHMEM.
The Teensy's 1062 has 32KB code cache - so maybe it can get away with it for some time if it stays...
WORKING - back on Windows 11!
Now Com18 instead of COM6.
Found a BLUETOOTH ??? device also on COM6
Device Mgr remove of the Com6 devices didn't do it.
Used RegEdit to search "COM6" ignored Bluetooth ......
Looking at TeensyThreads.cpp, no malloc - just :
threadp = new ThreadInfo();
stack = new uint8_t;
Added threads get default 1K or specified Stack and Thread0 main loop() gets 10K.
Not sure what...
Malloc seems to have the idea there is one HEAP - but each Thread seems to have some reserved space from RAM - how that is allocated would be shown in TeensyThreads? Does it do malloc() for the requested Stack space?
...
Opps - too long since then. Thanks for detail reminder
Suppose 15s Wipe was working - but prior times Loader was open with code to reinstall
Still have to go back to Win 11 and see if it can get cleared to work...
Fun Update - On the porch with Win 10 Laptop that probably hasn't seen the old T_3.5
OLD_T_3.5 seems to work NORMALLY here
Tried three 15s Restores - finally wiped the code - but not running factory Blink
Next...
I saw similar funny # for Remains
This MIGHT be a work around - but it might just give way to another issue later on.
The malloc code uses those fixed points for REF and it isn't clear they are valid when...
BTW: In testing I made a LARGE Flash code test and that worked. So, it has to be some specific problem code that runs from Flash when it conflicts
That code github.com/Defragster/T4LockBeta/tree/main/Code4Code was...
Also - OLD_T_3.5 is ignoring the 15 second Restore as that was timed and tried about 6 times. with timer at 14,15,16 seconds.
It seems 'something failed' on OLD_T_3.5 - except it worked when I went to DUAL Serial, so...
Pulled out a T_3.5 - used quite a bit in past for past testing - not used in Months++
- Once cut VIN<>VUSB - now soldered again
- Top side Female headers in place
- No problems when last used
>> This is Win 11...
Thought that might be the case - and if it isn't auto restarting then CrashReport code may not get called in this case.
And if the Button won't go into Program mode it seems the MCU is 'offline'?
If there is a...
I didn't post the code - but the p#9 alloc_func() was just called from setup() in the existing code - then it no longer acted the same when called from the Thread.
The malloc code has some dependencies that may not...
Indeed, the malloc() code does do something on first call with regard to finding and using a HEAP to build on?
Adding this to setup before starting the thread - whatever is allocated here is then available for alloc...
Good to know it is TSET and not just this system.
It is probably path inclusions of: "%LOCALAPPDATA%\Arduino15\..."
> in : ...\TSet\TSet.cmd2
> the same one that BREAKS when that folder fails to exist.
echo...
Have not seen that reported before.
Does the Teensy do a Restart after the 'freeze'? If there is some 8 seconds delay and a restart it may be from a usable gathering of Crash Data.
Try using CrashReport to see if...
@KurtE - my computer didn't stop my getting to the post #20 'downloader' (and didn't see an obvious attack) it displayed an HTML that won't attach as a file. Here is a TEXT copy of the content.
USB-Verbundgerät
...
@KurtE / @mjs513 : using TSET CMDLINE build is this seen?
The UnZip install of TD 1.57 was done - and The IDE 2.0 is installed - but cannot run to update?
Not sure of the relationship of TD IDE 1.89 .vs. 2.0 -...
Thanks @Neal for the DOC link - that is the one searching on 'AN12253' found on this prior Jan 2021 thread: pjrc.com/threads/65768-Teensy-4-1-CPU-Heat-Limits
With the SAVED HEX file safe in a known location the Teensy Loader can 'File / Open HEX File' - that was the context of Post #25
Sorry, did not document the IDE : 'Sketch / Export compiled Binary' { Ctrl + Alt + S }...
Thanks for the nice review! Yes, all pin ports 6,7,8,9 - when 1062 Teensy in FastIO mode - are mapped to one _isr vector.
Code as posted with CHANGE on PWM was running at freq=100K {200K changes/sec}, and times went...
With a saved .HEX file - restart the system.
Open Teensy.exe the loader, and use the menu to open the hex file.
Plug in the Teensy and push the Button.
Perhaps open Help / Verbose info to watch Teensy captured...
No scope here, though tried to get interrupt response time, in CPU cycles counts, for fun and show some of the code.
> like NVIC_SET_PRIORITY(IRQ_GPIO6789, 30);
Here PWM triggers p#34 wired from p#18, and toggles...
You must be bdlabitt@github ... I posted there with reinstall as an option.
... bummer the linux version in use upgrade breaking TyCommander ... it will be missed ...
Great that it is running.
@Paul's p#5 gave some indication about loss of USB. If the code goes awry and trashes memory the USB Stack can get disabled.
If the code was writing to that array without a limit on...
There is another older thread where some fewer intermittent issues were noted. I got out a new one or two {from early production} and had some odd pins - but they went away swapping across boards so none seemed faulty...
Does the computer have Teensy Loader open with a Teensy LC compatible program built and ready to upload?
The Button on a Teensy is not Reset or 'boot' - but puts the Teensy into Program mode.
If Teensy Loader is...
Odd. If it were a typical crash that CrashReport would handle, the device would go offline 8 seconds and restart.
Wondering if the WDT was interfering with CrashReport - it does not seem to. With no WDT or not...
@was-ja : sorry just seeing you replied to this.
Attempting to pinpoint which instruction was causing the fault it was modified as below.
NOTE: The code below initially tested on a T_4.1 with only 8MB PSRAM, running...
There is a: Serial.printf( "\tdeg C=%u\n" , (uint32_t)tempmonGetTemp() );
That will report the temp measured in the processor, if USB Serial montior is available.
145F is 63C and that is where (at or above) it...
Will depend on if storage is in RAM1 or RAM2. See T_4.1 product page if details needed.
Both at 512KB - But RAM1 is filled with CODE and default program Data - and runs at Processor speed. RAM2 typically unused but...
I started with ZIP install and saw the Auto Update work as well - very cool, except for Update it then runs the MSI Installer leaving the ZIP install orphaned and now running form the Arduino install location.
pjrc.com says: "Update, July 30, 2022: We expect to have Teensy 4.0 in stock by August 8."
and: "Update: August 1, 2022: We have only Teensy 4.1 without ethernet right now. Many Teensy 4.1 with ethernet recently...
@PaulStoffregen might make something useful of the Verbose output
It shows linux in use. Wonder if some OS update recently is breaking Teensy connection?
Do you have access to another computer?
That looks like a nice program and assembly with the display!
Safe to assume since it was soldered to that PCB as pictured it has been programmed some number of times after that?
When USB is connected, and Teensy...
RE #1: Would also be helpful perhaps to show the link to the active Forum DEV thread for MTP {54 pages!}:
> pjrc.com/threads/68139-Teensyduino-File-System-Integration-including-MTP-and-MSC
RE #2: for sure best to...
Pushing the button would have a different RED LED response.
The 2 Blink suggests it restarted (after power loss?) - and the (external?) power was not suitable in current supply and rise time.
The 2 Blinks is on...
The diagnostic RED LED flashes are noted on this page: 2 Blinks = NXP JTAG Not Responding
The note for that is:
How is the Teensy being powered? Standard USB or external supply?
Had it worked before and been...
Bummer - no time to lose chips.
Some number have been produced before with PJRC bootloader and they worked?
Now altered layout and first one assembled not acting right?
Not a wide audience for help much, or...
@Paul should give a look then.
Indeed, the CARD image shows a wire trace going directly towards VIN - so functionally it replicates the VUSB pad - but would seem to bypass the fuse if installed above board inline...
Indeed, you did - and the somewhere in above "examples" demonstrates setting the RTC ... perhaps not as desired with the one indicated that does refer to DS1307RTC ...
Indicated forum search - or better - should find...
Yeah - PTC ... wasn't sure that was the proper TLA ... so 'soft' fuse ... i.e. not a fuse that 'blows' as noted.
Correct - looking now - there is a second VUSB 'pad' that replicates the connector pad to expose it in...
This example seems to replicate the above code - maybe adding the offset from UTC?
>> {local install}\hardware\teensy\avr\libraries\Time\examples\TimeGPS\TimeGPS.ino
But that doesn't appear to set the RTC clock.
...
Not a schematic reader ... but there are two VUSB tags showing. The tag labelled near 'WRONG'/'CORRECT' has no connection except to the Device connector - appears to be labelling the line for orientation and location...
T_4.x has a RED LED that will blink AFAIK when USB is not connected when the Button is pushed.
This works on a production T_4.1, but does not work the same way when Lockable T_4.1 is Locked:
Not sure if this is...
Aug 3, 22 : MalwareBytes Support got the teensy_secure.exe program removed from unsafe list.
Going back and forth with MalwareBytes on False Positive detection for Quarantine of Teensy_Secure.exe in %appdata% folder...
Teensyduino 1.57 has been released << Release change notes here
pjrc.com/teensy/td_download.html
Quick summary: 1.57 adds USB host support for disk drives, audio input by analog input pin, fixes a MacOS crash...
When TeensyDuino installed there is a copy of the EEPROM code for the Teensy4 family directory. It is not a simple matter of directly writing.
That code is non-trivial, it works with the processor reserved area...
@Paul - BreadCrumb is noted as added - a lin kto the example might help it get use:
github.com/PaulStoffregen/MyFault/tree/main/examples/BreadCrumb
Though it is really short:
// MyFault - collection of examples...
There is a FAULT occuring on entering loop() it seems. THere is an 8 second wait and then a restart.
Add this to setup:
while (!Serial && millis() < 10000 );
Serial.println("\n" __FILE__ " " __DATE__ " "...
How long is the break in the beam?
This line: delay(1000);
Will only allow one INSTANT check every second.
The SENSORPIN is set PULLUP - so that assume the sensor when triggered will drop the pin to LOW?
...
That was just for sanity - would have been nice if it cleaned it up. Promising the Teensy working as RAW_HID ...
basic\Blink sketch doesn't have any print()'s ... Typically here a Serial.println( micros() ); in the...
Tested here on a T_4.1 that has a larger EEPROM space.
Didn't do the math - not sure if the initial math may be running off the end? The addr++ method versus the i+1*(n+1) math would push farther into the addr space?...
Yes, the posted code worked here.
For better code that would not have hardcoded work/hack look into replacing with indicated get() and put() that are designed to work with such Structs or other declared types.
Windows 10 and Teensy connect without any extra driver as noted.
If the build works properly there should be no problem, with a good cable.
TeensyDuino 1.57 just released after beta period. Nothing in that should...
Yes, Speed should be set at compile/build time. It is a complex interrelation of clocks and settings, changing at run time is non-trivial and has side effects as some device/elements have clock expectations set at...
Please update TeensyDuino to just released version 1.57.
Using that here and Running p#2 code here gives what seems to be a correct answer:
0.00 0 4095
0.75 1265 1393
0.85 1538 1294
1.00 1947 1143
1.20...
@Paul: Got Support notice of update to fix MalwareBytes. It still sees Teensy_Secure as Malware in “%appdata%\..\local” - copied you on the email reply for ref.
Overnight the T_4.1 16 MB PSRAM LittleFS RamDrive ran...
Locked T_4.1 program fail with pin #25 connected to unpowered T_4.1:
> Original text case was 8 Serial test between two T_4.1's where Serial 6 uses pins 24/25.
Simple repro Setup:
Open IDE 1.8.19 example...
was detected on "new" hardware
8X Serial Code and details were in email ... 7/26 2:08 AM, follow up email 10:42 AM : Happens with Blink or any sketch when a locked T_4.1 is pin 25 connected to unpowered T_4.1.
Will...
@Paul - TD 1.57 seems good on a few sketches of the last 2 T_4.1's received.
One with 8MB the other 16MB of QSPI PSRAM just passed testing using the PJRC test sketch RND/Fixed values.
Running LFS_Integrity PSRAM on...
No, will have to check again if I get Support follow up.
MalwareBytes scan of updated IDE 2 folder - removed the Exception for 'no scan' of: C:\Users\Tim\AppData\Local\Arduino15.
There in %appdata% it still...
Yes, because I excluded it from monitoring folders running Teensy_secure.exe :(
I had not heard back from them - so didn't remove the exceptions - or test.
Just tested the copy in TD 1.57 unzip folder - copied out...
Was in OPEN IDE 2 RC9. Didn't show 1.57.0 until closed and restarted. Not sure of prompting Board update check from server ... and it was new ...
On restart board manager now installing TD 1.57.0 ... Works to See...
Running with a new T_4.1 trying out the IDE 2 on Win 10 laptop. Starting with LittleFS to test the QSPI soldering. It triggered a really cool SerMon Spasm I'll go add to that last line cropping:...
Wires to SD adapter seem quite long 10"? Maybe on the edge and T_3.5 works and T_3.2 fails?
Do any of the provided SD Examples act any differently when run alone on the T_3.2?
Updated IDE 2 RC9 Win 10 laptop to TD 1.57b5 and it worked to update and program the last T_4.1 I got.
Both T_4.1's soldered up with pins - and still working!
Submitted Certified Teensy_Secure to MalwareBytes...
Installed 1.8.19 TD 1.57b5 on Win 11 no problem.
Ran with latest two T_4.1's I got and both working well ... hopefully the same after soldering ... found a pack of 3 PSRAM's ... will see what I have for a FLASH and...
This page or product might indicate the connections for using HOST mode: pjrc.com/store/cable_usb_host_t36.html
The Teensy needs to have enough 5V power onboard to run what the connected device requires. If powered...
@Paul: Opened arduino-ide/issues/1250 : Autoscroll fails to disable on FAST USB 480 Mbps
Referred to 1062 Teensys and test sketch : github.com/PaulStoffregen/USB-Serial-Print-Speed-Test
When the edit is made in cores\...\usb.c the Serial Lines Per Second changes immediately on upload restart - on this Win 10 machine.
With the line commented in usb.c and added to setup() {as in p#2} the LPS speed...
Just checked and in real use this doesn't work as post#2 versus editing directly in usb.c and building.
> at least on this Win 10 machine, last test was on Win 11
Using the code from:...
Yes: Hard to watch 1M ... timing on 2M change was 4 secs and 4M in 8 secs
> running fast and smooth with no apparent garbage. 80%+ on Arduino and 8 cores showing all 100%
Put the teensy_secure.exe in a scanned directory, confirmed it is signed, MalwareBytes approved of it:
However, when executing it then triggers on its real time operation testing?
So, so back to blocking scan...
Got the updated EXE xx,3016 ... will put that on laptop w/1.8.19 and test the secure...exe against MalwareBytes.
Also got the PaulStoffregen/USB-Serial-Print-Speed-Test
Will see how my laptop runs against IDE 2 ...
@KurtE - thanks - knew enough that T_sermon was injected somewhere ... so not responsible for the ui. A shame it is stuck in that frame under code and not a popout for full size view. Also once in Arduino mode the UI...
I didn't set up Virtual Ram Drive on Win 10 laptop - I only bumped it to 16GB - I don't often use it and RAM was more $$$ last year. That isn't a Win 11 issue - the other reported case was on Win 10. Where that issue on...
Cool, post back with observed results after more usage ...
@PaulStoffregen might see and comment if this is good/safe solution.
Given his understanding and involvement in the USB protocol this might be a usably...