Teensyduino 1.55 Beta #1

Status
Not open for further replies.
Paul - follow on to the above posting about not seeing crash report...
Here is a stupid simple sketch:
Code:
#include <LFS_MTP_Callback.h>
#include <MTP.h>
#include <SDMTPClass.h>
#include <Storage.h>
#include <USB_MSC_MTP.h>

void setup() {
  while (!Serial && millis() < 5000) ;
  Serial.begin(115200); 
  Serial.print(CrashReport);

  Serial.println("Enter something to go boom");
  while (Serial.read() == -1);
  uint8_t *ptr = 0;
  *ptr = 99;
}

void loop() {
  
}
Compile it with MTP as USB type.

Open up Serial Terminal... Nothing will display
Enter something... It will reboot after the 10 seconds... Again nothing shows up...

EDIT: Note I am running on Windows 10...
Have not tried on Ubuntu yet... Note: MTP code can run on Ubuntu... Will talk more about that on appropriate therad.

@KurtE - trying to catch up on things and since I have pretty much the same library configs as you do I ran your test sketch. Hit the enter and waited - closed the serial monitor and reopened it and
Code:
CrashReport:
  A problem occurred at (system time) 19:55:16
  Code was executing from address 0xF0
  CFSR: 82
	(DACCVIOL) Data Access Violation
	(MMARVALID) Accessed Address: 0x0 (nullptr)
	  Check code at 0xF0 - very likely a bug!
	  Run "addr2line -e mysketch.ino.elf 0xF0" for filename & line number.
  Temperature inside the chip was 47.69 °C
  Startup CPU clock speed is 600MHz
  Reboot was caused by auto reboot after fault or bad interrupt detected
Enter something to go boom
if I don't do the close/open it just sits showing the OFFLINE at the top of the monitor. This is with a T4.1 using your modified MTP Disk Serial.


Using MTP Disk I get the same behavior that you describe in your post!!!
 
Paul - I am not sure any of this is something you may want to tackle during this release cycle. Only cases I can potentially see would be if you thought that the USB Descriptor for MTP could be improved...

Is there any way to reproduce the no response after Serial.begin() using only USB Type "MTP Disk (experimental)" without including any extra libraries other than the ones from the Teensyduino installer?

I tried uploading a basic CrashReport print with USB Type "MTP Disk (experimental)". At least on Ubuntu 20 it prints properly. Didn't try Widnows or MacOS, but can if needed.

If the only way to reproduce the problem involves use of libraries not yet integrated & bundled with the installer, then I definitely want look into that during the 1.56 betas, but not have it delay a 1.55 stable release.
 
Just to be clear, if the problem can be reproduced without any extra libraries, I want to take a quick look and see if it's something I can address quickly. Any decision whether to fix it for 1.55 will really depend on how complicated the problem looks.

My goal is for 1.55-beta3 by the end of the weekend, rolling up the many recent fixes and about a dozen more I'm going to do soon. If even more fixes and changes are made, I guess we may have a 4th beta. But I really want to wrap up a stable 1.55 release in about 1 week.

Diving into a complex problem or attempting any fixes that have substantial changes would not be a good path towards getting 1.55 wrapped up next week.
 
Compiling code below as "MTP Disk (exp)' with as shown - no headers included.

It works "as expected" from IDE and IDE SerMon, but not TyComm. TyCommander still sits in the 2nd while with short off flash - something about it seeing the USB to connect - so not a PJRC issue.

So ignoring TyComm ... it works with IDE and Teensy SerMon.

However in getting there I got the DUAL LED Flash once. This was IDE and T_SerMon. Seems I had done a Button Push when it triggered to Restart the sketch. It seems the red may precede the Orange ... ever so slightly ... maybe just a device voltage issue? Seems I reported the opposite before? Last lasts some few seconds of Dual Blink then stops.

Any how a few more compiles and Button pushes and no repeat.

Code:
#if 0
#include <MTP.h>
#include <SDMTPClass.h>
#include <Storage.h>
#include <USB_MSC_MTP.h>
#endif
void setup() {
  pinMode( 13, OUTPUT );
  digitalWrite( 13, 1 );
  while (!Serial && millis() < 5000) {
    delay( 50 );
    digitalWrite( 13, 0 );
    delay( 200 );
    digitalWrite( 13, 1 );
  }
  Serial.begin(115200);
  digitalWrite( 13, 0 );
  while (!Serial ) {
    delay( 250 );
    digitalWrite( 13, 0 );
    delay( 50 );
    digitalWrite( 13, 1 );
    // if ( Serial.available() ) break;
  }

  Serial.print(CrashReport);

  Serial.println("Enter 'x' to go boom");
  int cc;
  while ( -1 == (cc = Serial.read()));
  if ( 'x' == cc ) {
    digitalWrite( 13, 0 );
    uint8_t *ptr = 0;
    *ptr = 99;
  }
  Serial.println("Enter and see Echo ...");
}

void loop() {
  if (Serial.available()) {      // If anything comes in Serial (USB),
    Serial.write(Serial.read());
  }

}
 
@defragster @Paul @mjs513...
...
improved...
My MTP one is slightly modified from the current ones in builds. Mainly the order of the Interfaces...

I changed it to be closer to that of Audio...
...

@KurtE - is that an added usb_desc.h entry needing an edit to boards.txt menu for selection?

When using that does the TyComm see the Teensy? Here the current MTP experimental TyComm as noted it fails to connect - it 'sees' it - but won't connect until Host sends..
 
Regarding the code from msg #393

Try removing all header files except MTP.h...

I'm running it here on Ubuntu 20.04 with the latest code. Can't reproduce the problem. It always prints the CrashReport info.

screenshot.jpg
 
Last edited:
Ok, I've *finally* caught up to this huge thread!

@Defragster - Is there any more info about problem on msg #330? Maybe this was continued on the 1.55-beta2 thread?
 
@Paul, @mjs513 - I verified that Ubuntu will print out the Crash of that test case.

Note: MTP I don't believe is installed by default on Ubuntu:
At least I believe to get any of it to work on it, I believe I needed to do: sudo apt-get install mtp-tools
Or maybe you might use other installs to install libmtp...

I have done limited testing with MTP on Ubuntu and more or less none on MAC. More later on this part...

But related to this issue, I believe that Ubuntu times out the MTP init real short! That is with my earlier testing, if we tried to get the used space of SDCard it would time out and nothing would work... Again more later.

I just wanted to mention that I tried the same striped down sketch on Ubuntu. only I added one line just before printing the CrashReport:
Serial.println(millis(), DEC);

And in my test run after the crash: it printed: 807
 
Ok, pulled in the latest MTP_t4 library and copied it over to the Windows 10 machine. Uncommented include MTP.h.

Same thing, still can't reproduce the problem. It prints a non-CrashReport every time I upload. And if I type something and send, it reboots after several seconds and always prints a CrashReport.

capture9.png
 
Glad it's working better now!

I'd much rather be playing with filesystems and MTP right now... but I really do need to keep focusing on fixing the remaining code security GUI lockup bugs and the fuse (re)write bug and hopefully the issue Tim found in msg #330 (which I can't decipher how to recreate from that message) and several other relatively boring bugs.

Fixing Serial.begin() and any other problems where Serial.print() isn't working to the serial monitor is a high priority for 1.55. I know everyone's excited about MTP. I am too. But this is as close as I can get to MTP until after stable 1.55 is released.

Maybe it's about time to close this first beta thread and continue any bugs I should try to fix for 1.55 on the second thread?
 
Paul - Thanks!
Note: we still have the issue with adding in the MTP Disk Serial
USB Type.

Which is not part of the build:

With this you need to install his(WMXZ) or my version of the patches:
That is by adding the stuff to boards.txt or instead put them in local.boards.txt such that you don't have to redo them each time we install.

Also then needed to add in the patches for Teensy4... usb_desc.h into cores...

Then when program runs it comes up if you open up the Serial Monitor. If you then enter something it crashes:
The terminal monitor stays up, but in disabled state.
If you close the window and reopen it, then the data shows up...
At least most of it... That is you get the first part, but if there was lots of data output you get the first part and then it skips the rest...

screenshot.jpg

screenshot2.jpg

But probably not something we need to deal with for this release.
 
Ok, I've *finally* caught up to this huge thread!

@Defragster - Is there any more info about problem on msg #330? Maybe this was continued on the 1.55-beta2 thread?

This hasn't happened again - and not noted on Beta 2 thread.

I have not tried building from TSET again yet and that was the 'cause' for some reason the CmdLine exec that normally works for builder { As FrankB extracted from Console and I've evolved in TSET } was missing something.
Code:
Clearing Verbose and building again this is the content from Teensy Loader.
It seems stuck on THIS file from a failed build under TSET: t:\temp\arduino_build_MakeCode.ino\, MakeCode.ino.hex

Will see about trying TSET again after reviewing console lines for changes to arduino-builder. Here is the current batch file line (broken to fit screen):
Code:
echo Building Sketch: %ino%
[B]"%arduino%\arduino-builder" -verbose=1 -warnings=more -compile -logger=human -hardware "%arduino%\hardware" -hardware "%LOCALAPPDATA%\Arduino15\packages"
 -tools "%arduino%\tools-builder" -tools "%arduino%\hardware\tools\avr" -tools "%LOCALAPPDATA%\Arduino15\packages" -built-in-libraries "%arduino%\libraries" -libraries "%libs%"
 -fqbn=%fqbn% -build-path %temp1% -build-cache "%temp2%"  %ino%
[/B]

Not sure if missed a change in any of that? TSet works best and with TyCommander - but @koromix added a -Param to defer to Teensy Loader for Upload when it isn't integrated into the IDE - as is the case now with Secure builds.

When the first attempt did this I went back to suffering the IDE editor ... and having it crash after rebuilds of large Code4Code. Did a few the other day and it worked, then I did a 'new sketch' for KurtE's tiny "MTP" issue and that crashed it to CLOSED and had to restart.
 

Here I had not pulled the Patch for USB_seremu.h in testing the MTP stalling :(

I just did that patch and USB=MTP now Win 11 x64 Pro works with IDE t_SerMon! Same as it worked when building USB=Serial.

Waiting while(!Serial) Still fails to connect with TyComm on MTP - though removing that in prior code like : while (0 && !Serial ) {
Does have it work and print. Somehow Serial not going True 'Only with TyComm' - but ignoring that continues and works to print and run.
 
Totally agree! Question is more is it worth investigating why it leaves the Serial Terminal disabled.

Paul, As mentioned I believe the MTP Disk with Serial Should Wait and if deemed appropriate that it it get its own PID and not take over the Everything one...

Simple follow on to what I and @mjs513 mentioned about, having to close the Serial Monitor window and Re-open it... And you get the start of the debug output, but not... So slight change of the sketch I showed:
Code:
#include <MTP.h>

void setup() {
  while (!Serial && millis() < 5000) ;
  Serial.begin(115200);
  Serial.println(millis(), DEC);
  Serial.print(CrashReport);

  Serial.println("Enter something to go boom");
}
uint16_t loop_count = 0;
void loop() {
  if (Serial.read() != -1) {
    uint8_t *ptr = 0;
    *ptr = 99;
  }
  Serial.printf("Loop Count: %u\n", ++loop_count);
  delay(250);
}

If you run it with the USB Type of MTP (in build) it now shows the fault and continues to show the data...

If you do it with the version not in build that uses Serial instead of Serial emulation, it will leave terminal offline ... And when you restart it, it shows the initial stuff, but then stops output ...
And you see a gap in output:
Code:
7001
CrashReport:
  A problem occurred at (system time) 12:12:13
  Code was executing from address 0x88
  CFSR: 82
	(DACCVIOL) Data Access Violation
	(MMARVALID) Accessed Address: 0x0 (nullptr)
	  Check code at 0x88 - very likely a bug!
	  Run "addr2line -e mysketch.ino.elf 0x88" for filename & line number.
  Temperature inside the chip was 43.80 °C
  Startup CPU clock speed is 600MHz
  Reboot was caused by auto reboot after fault or bad interrupt detected
Enter something to go boom
Loop Count: 1
Loop Count: 2
Loop Count: 3
[COLOR="#FF0000"]Loop Count: 4
Loop Count: 8[/COLOR]
Loop Count: 9
Loop Count: 10
Loop Count: 11
Loop Count: 12
Loop Count: 13
Loop Count: 14
Loop Count: 15
Again something that maybe be looked at when you have free time...
 
Paul, As mentioned I believe the MTP Disk with Serial Should Wait and if deemed appropriate that it it get its own PID and not take over the Everything one...

Simple follow on to what I and @mjs513 mentioned about, having to close the Serial Monitor window and Re-open it...

Again something that maybe be looked at when you have free time...

For MANY uploads I was impressed with IDE SerMon reconnecting - I meant to note that if I didn't when it was in exclusive use.

The code I've been running hasn't shown a trend I recognized - since often now using TyComm for multiple Teensys, But I have seen some instances as noted where SerMon shows offline when Teensy is running - and it comes back with a Close and Open of IDE SerMon.
 
Status
Not open for further replies.
Back
Top