K64 Beta Test :: Teensy 3.5

Status
Not open for further replies.
OK thanks ... I guess I've gotta bite that bullet.
Bit of a learning curve and some work to do though, I don't have cmake or much familiarity with it ... yet
 
Reseting a Teensy if you have code running is
https://forum.pjrc.com/threads/2430...rt_Teensyduino()?p=35985&viewfull=1#post35985
Still leaves the question of getting logic that reboots at the time you are actually wanting to see. Other option is to have a shell type code running that responds to serial commands received and returns status information, including maybe something that does actually trigger a soft reboot.

One tool I've found very handy for debug is a 3.3 compatible (or butchered 5V) FTDI cable on Teensy Serial1. Means Serial port remains during programing/reboot, and leaves the USB serial free for whatever your application is sending on it without debug clutter.

Do not believe there is a schematic yet, there are for other Teensies so would assume one will show up in due course.
 
1) Not sure if there are any official ways to reboot the Teensy 3.5/3.6. I have seen some threads showing ways for earlier boards. But there are probably many ways to get the board to reset. I know as I hit several when trying to add support for some new features during the beta. Example, suppose your program is not using Serial5 and as such you have not enabled the access to the memory associated with the registers for UART4 by doing: SIM_SCH1 |= SIM_SCG1_UART4; (Which is done internally to all of the Serial4 commands), just try to access any of the registers like: UART4_C1 = 0;
And the processor will hit a memory fault and reboot... Probably not the cleanest method...

2) I do not believe the Schematics have been released yet. But it is my assumption is that they will be, probably reasonably soon (within the next few months), as he has released the schematics of all of the previous boards.
 
thanks for all the suggestions. I think I need to invest in TyQt.

Because teensy does not reset when Serial Monitor is restarted, the only method I have so far is to recompile and upload the same code ... seems a bit weird to me.

If I use a FTDI adapter into Serial1, how does teensy know new code is now uploaded via Serial1?
(Is the USB port called Serial0?)
 
thanks for all the suggestions. I think I need to invest in TyQt.

Because teensy does not reset when Serial Monitor is restarted, the only method I have so far is to recompile and upload the same code ... seems a bit weird to me.
Why not ?
If you don't like it, you can add a reset-button.

If I use a FTDI adapter into Serial1, how does teensy know new code is now uploaded via Serial1?
It does not know it - because..it is not possible. Upload is USB only.
(Is the USB port called Serial0?)
No. Serial. (<-- no number)
 
USB is Serial.
Code is only uploaded to Teensy via USB - while the Teensy is Offline in Program Mode - using a USB cable HID protocol.
The Teensy with active USB can be put into Program Mode using USB mechanism - as done by IDE or TYQT.

Indeed get TYQT - 7.5-210 is the latest I see and I've been using it on the T_3.6/T_3.5 like on prior Teensys to good effect.:: files/koromix/ty
TYQT can conflict with TeensyDuino - Teensy.exe. I've been using the Tools / Integrate to Arduino and close Teensy.exe.
If can RESET or UPLOAD to one or more connected Teensys under program control.
 
don't know if it would be useful - i could image a short routine that checks for DTR high to DTR-lo transition (with Serial.dtr() ) and resets the teensy.
(DTR means "DATA TERMINAL READY")

On the other hand... that would mean that your teensy restarts every time when you close the monitor. Do you want that ??? Are the other Arduinos doing that ? (I don't know,.. don't have one. Sounds annoying.)
 
Last edited:
Code:
/* Reset on dtr high -> dtr lo
 *  
 * Frank B 16/10/17
 */

void resetWhenTerminalStops() {
  static int8_t stateOfDtr = 0;
  if (stateOfDtr==0 && Serial.dtr()) stateOfDtr=1;
  else 
  if (stateOfDtr==1 && !Serial.dtr()){
    SCB_AIRCR = 0x05FA0004; // software reset
  }
}


void setup() {
  // put your setup code here, to run once:
  while(!Serial);
  delay(100);
  Serial.println("R E S E T");
}

void loop() {
  // put your main code here, to run repeatedly:
  resetWhenTerminalStops();

  //Do something useful
  delay(100);
  Serial.println("Running");
}

Have fun with it..

use it or not.. :)

edit: Played a bit with it.. it IS annyoing.. :)
 
Last edited:
wow the ideas just keep on flowing ... :)

I'm happy to dive into TyQt or add a RESET button myself, but in case I'm actually doing something wrong here's how my teensy works using the IDE + teensyduino. It should explain why I've been asking how to RESET:

1) Say I'm developing a sketch and I've uploaded it to the teensy and it runs, almost always I have it reporting to the Serial Monitor (SM) ... all good so far.

2) Of course I spot a bug or somethiing I want to improve so I edit the sketch and upload. The SM has not been closed, but after the sketch is uploaded SM does not report anything unless I restart it.

3) If I restart SM soon enough after upload it will show all expected outputs from start of sketch / setup(). But it's tricky, I often loose first few feedback lines if I'm not quick enough.

4) If I'm debugging sketch startup / setup() then only choice is to recompile & upload again & try to open SM real quick to catch first few lines of feedback.

5) Whereas If I was using Uno/Mega/Due I would just hit reset button whilst SM was open, and see everything on SM from t = 0 onwards ...
 
The Teensy like some of the other Arduinos like Leonardo, have the USB as part of the actual processor and as such, yes the Serial port may go away when you upload a new program to your processor

So you have Serial.print statements right at the start of your program, you can miss some.

Which is why, a lot of us add code like:

while (!Serial && (millis() < 5000)) ;

At the start of our program, usually then add the Serial.begin() and then maybe a short delay, for everything to stabilize.
 
Like this provides 5 seconds to get Serial Monitor on USB connected - Teensy is typically ready in under 2 seconds when the SerMon is:
Code:
  Serial.begin(38400);
  while (!Serial && (millis ()  <= 5000)) ;
  Serial.println("Hello World");

TYQT is a joy and makes Teensy Better. Unzip to a directory on Windows - unblock - and run TYQT.exe .
 
yep my sketches already include that !Serial code (as discussed a little earlier in this loo...oong thread) .. although I do need to add it to my latest sketch.

Anyway I'm sold by all the enthusiasm for TYQT (TyQt?) so I'm heading that way as soon as I can. cheers++
 
Last edited:
In absence of schematics I was wondering if there is a built in pull-up resistor on the reset (RST) input pin/hole to T3.5/3.6
If these are at all similar to T3.2 that schematic shows no pull up fitted.
 
ninja2 i've stopped counting how often you mentioned that you want to see the schematic. I guess, we all noticed it, now.

Edit: And i hope that more important things are on Pauls TODO
 
Sorry not meaning to hassle, and I'm quite OK with waiting.
But please don't under estimate how much information a schematic transfers. software is not the solution to everything :)
Just one example: it would answer my question about whether there is a pull up on reset line or not
 
Last edited:
There must be a pullup somewhere otherwise the pin would be floating and erratically reset the teensy.
Logic.

Edit: it's inside the chip, if there is no external resistor.
 
Last edited:
true, maybe inside the K64 / K66 chips?
I should just wire in a pushbutton to ground and see what happens.
 
Last edited:
Status
Not open for further replies.
Back
Top