I there a "teensy_reader_cli" program?

Status
Not open for further replies.

bengt

Member
With teensy_loader_cli I can load a compiled program into my Teensy.

Which is the recommended procedure to read out a specified address interval from the memory of the Teensy via the USB interface?
 
The teensy_loader_cli communicates with the second programming processor on the Teensy to load code onto the main processor. It does not have an interface or facilities to read and return the contents of that processor.
 
I understand that teensy_loader_cli is not usable for readouts.

Is/are there any hints on alternative/s to use for reading the memory content via the USB interface?
 
I understand that teensy_loader_cli is not usable for readouts.

Is/are there any hints on alternative/s to use for reading the memory content via the USB interface?

Other than writing a sketch that reads the memory content and sends it over the USB interface?

On T3.(5/6) you could use a debugger, AFTER to modified hardware to connect and activate the SWD interface.
 
For reading data, every software with access to the Serial works. Any terminal software. For example the Arduino Serial Monitor. Or write your own with HID access.

Reading the program memory is an other topic, as WMXZ said. In addition, it is not needed - didn't you sent the contents to the Teensy before? ;-)
 
I am new to Teensy and have started to experiment with Teensy2.

The reason I wish to read memory content is to verify the result from my test program (which writes information into an array in the memory).

My assumption was that there could be a cli program for this. But there may be other ways...?
 
I am new to Teensy and have started to experiment with Teensy2.

The reason I wish to read memory content is to verify the result from my test program (which writes information into an array in the memory).

My assumption was that there could be a cli program for this. But there may be other ways...?

Teensy2 is different to Teensy3.x, and I have no clue on teensy2.
 
Is Serial.printf() what you're looking for?

Any program that deals with serial ports can be there other end of the communication: minicom, screen, arduino serial monitor, even cat if your stty settings are right.
 
Maybe that Serial.printf() is the solution. Must learn more about this.

Assume that I need to use the RXD/TXD pins on Teensy and load serial communication routine to accomplish serial communication? Any hints on example code to learn from? I am using Linux.
 
Code:
/* [B]Serial Monitor Example, Teensyduino Tutorial #3
   http://www.pjrc.com/teensy/tutorial3.html
[/B]
   After uploading this to your board, use Serial Monitor
   to view the message.  When Serial is selected from the
   Tools > USB Type menu, the correct serial port must be
   selected from the Tools > Serial Port AFTER Teensy is
   running this code.  Teensy only becomes a serial device
   while this code is running!  For non-Serial types,
   the Serial port is emulated, so no port needs to be
   selected.

   This example code is in the public domain.
*/


void setup()   {                
  Serial.begin(38400);
}

void loop()                     
{
  Serial.println("Hello World");
  delay(1000);
}

The communication happens over USB. No need to connect anything more than that. The value 38400 is a dummy - the communication happens with USB speed.
Sometimes it is helpful to add a "while(!Serial){;}" to your Sketch. This waits for a established USB connection (the PC Host can be very slow when connect.)

Attention: printf needs much space. Better, esp. on Teensy 2.x, is to use Serial.print (<- does not support any formatting options. Please read the Arduino tutorials).
 
Last edited:
I understand that teensy_loader_cli is not usable for readouts.

Is/are there any hints on alternative/s to use for reading the memory content via the USB interface?

This was to be read as : the second programming processor on the Teensy does not have an interface or facilities to read and return the contents of that processor. It was not to refer to teensy_loader_cli.

As noted - any in memory values or variables can be exposed by printing to Serial or other ports/displays/devices. So as noted in follow up - without hardware mods you cannot pull data from a Teensy after the fact.

As Paul notess - when you ask specific questions you get specific answers. Background and intent are useful information to add - knowing that you want in RAM values versus trying to pull out uploaded program code or information like EEPROM or other makes a difference - also as noted what Teensy you are using should be made clear.
 
Please excuse me if my question was unclear and if I misunderstood the answer. I am new to Teensy and unused to ask questions in this forum.

I will give the serial communication a try, but I probably need some time...

Meanwhile, thank you all for responding to my questions.
 
I highly recommend you read the documentation (such as it is) at pjrc.com and try some of the example programs. I'm getting the impression that you're expecting things to be way harder than they are.

In the Arduino application, there's a menu item Tools > Serial Monitor. It gives you a console window to talk to your Teensy. When your application is finished and you don't want to use the Arduino application, you can talk to the Teensy like you would talk to any other USB-Serial device. Plug it into a USB port and open a terminal program or treat it like a file...
 
The reason I wish to read memory content is to verify the result from my test program (which writes information into an array in the memory).

My assumption was that there could be a cli program for this. But there may be other ways...?

Sorry, this doesn't exist. Teensy Loader and the bootloader are specifically designed to *not* read back the memory. Many use Teensy inside their commercial products, where they would not want competitors to be able to easily read & copy the code they wrote.

Of course, you can put Serial.print() and other stuff into *your* code.


I am new to Teensy and unused to ask questions in this forum.

Everyone starts a beginner, including how to effectively ask for help...

When it comes to this forum, the best way to ask for help is by showing what you've already tried, and explaining what you wish to accomplish. Maybe you've seen the message at the top about posting complete code? Even if your program is small and simple, it's important to post a complete program that any can copy and paste into Arduino and run on another Teensy. If you look over the many threads on this forum, you'll see we do very well at helping when complete code is posted, and when the question includes an explanation of the actual goals, to give enough context for people to understand.

Next time, try that way. It really does work much better than a narrowly focused question that doesn't explain what you're trying to accomplish and doesn't show the unsuccessful effort you've already tried.
 
Status
Not open for further replies.
Back
Top