blink_fast.hex file for Teensy 3.5

Status
Not open for further replies.

digysol

Member
Downloaded the blink_hex zip file in order to start testing. I have a Teensy 3.5.

However, there are multiple hex files in the unzipped folder. Appreciate someone telling which is the correct hex file to use.

Also, which C compilers (or IDE's) can be used to generate hex files for the Teensy 3.5 ?
 
Anything else besides Arduino ? I am developing code using gcc. So, can I just use plain gcc to create hex files ?
 
Anything else besides Arduino ? I am developing code using gcc. So, can I just use plain gcc to create hex files ?

Arduino + Teensyduino from Paul is all you need.
All is cpp, but you can put plain c into separate .c files

Assume you have a standalone test program with main and not setup/loop:
a way to port such standard main to Arduino concept:
either divide your cpp program into setup function and into functions that are called repetitively via the loop().

of if to difficult
simple workaround

open from Arduino new program
you will get an empty sketch labelled say "sketch_oct28a" for today
save the sketch, this creates a directory sketch_oct28a or the name you choose,in your local Arduino folder
copy your *.cpp program (say myApp.cpp) into this folder.

open this file with Arduino (opens a new window with the basic *ino file and the new myApp.cpp file in the tabs)
select your myApp.cpp file and change main to, say 'myApp'
select the ino file and insert in setup a call to myApp

Your ino program is now something like this


Code:
int myApp(void);

void setup() {
  // put your setup code here, to run once:

  myApp();
}

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

}

and you separate program is something like this

Code:
#include "arduino.h"

void blink (uint32_t del) { digitalWriteFast(13,!digitalReadFast(13)); delay(del);}

int myApp(void)
{
	pinMode(13,OUTPUT);
	
	while(1)
	{
		for(int ii=1; ii<10; ii++)
			blink(10*ii);
	}
	return 0;
}

verify or download, that is all.

Yes, I know, there a lot of steps to do, and I only mention it because it is an option.
If non-Arduino program will run on teensy, that is another question.

IMO, the best thing is to start simple, analyse your program, divide it into setup functions and into recurring operations that may go into loop().

If you do not like Arduino environment, you can always use a makefile setup, and there are some other IDE's promoted in this forum.
There is a makefile in Teensy3/core in the Arduino folder.
 
Last edited:
Thanks for the extensive replay. i will try the setup / loop breakdown.

There may be issues related to typing and overall size of the code. But, let me give it a shot.

What's the largest Arduino-generated executable (hex) file that you are aware of ?
 
Size of the code ?? Tell more about your project! I'm curious.
My largest code for Teensy was about 170KB.
 
Unfortunately, I can't say more about the project. But, the fact that your largest size code went to 170 KB makes me feel better.
 
The HEX file is ascii text and typically much larger than the actual code size - where FrankB says code about 170KB the hex was possibly ~250KB. But the T_3.5 has room for over 500KB of code/data that has probably been tested somewhat - the T_3.6 can take 1MB in code and flash data and that was tested over the 512KB boundary.
 
Anything else besides Arduino ? I am developing code using gcc. So, can I just use plain gcc to create hex files ?

You can, but using Arduino is so much simpler. All Arduino does is run gcc. In File > Preferences, turn on verbose info while compiling to see the actual gcc commands it executes when you compile.

Leaving the comfort of Arduino is possible, but if you're not familiar with the details, I strongly recommend you at least use Arduino to avoid fiddling with so many tech details and get your project off to a good start.
 
I've updated the stand-alone Teensy Loader pages with the latest software (supports 3.5 & 3.6) and blink slow & fast hex files for the new boards.
 
Status
Not open for further replies.
Back
Top