Teensy with arduino-cli and make

Spyy

Well-known member
Hi,

i need a little help regarding compiling for Teensy and influencing the given "parameter" e.g. CPU speed.
Make is up and running fine
arduino-cli is up and running fine
I have also installed the Arduino IDE 2.3.3

What i want to do is reducing the CPU clock to 528Mhz or modify other "parameter"

Then i call this: arduino-cli compile --fqbn teensy:avr:teensy41 xpuipcISFD.ino --verbose
Then i get this:
1727898044094.png

It seems the compiler commands are build together "somewhere" else, i get a huge line (see obove) with the parameters already defined.
I know that i can change them in the Arduino IDE via menu. When i change it there to 528Mhz my expectation was that this changes also this somewhere that the command line in the CLI changes also....
Long story short: How can i change/overwrite those "parameters" in the CLI environment.

Thank you

Torsten
 
The “Arduino way” is to add any changes to the platform.local.txt file. Unfortunately, the Teensy platform doesn’t support this because its platform.txt file doesn’t include support for overrides in platform.local.txt. So the next best thing is to modify platform.txt itself. (Perhaps there’s another configuration file or way I’m not remembering offhand, and I’m not next to my computer, so can’t check right now.)

If you want to add support for platform.local.txt, see here:
(“Configuring macros using the Arduino IDE” section.)

I use this feature and these modifications in my testing.
 
Last edited:
I have built with a Windows batch file:
Code:
set model=teensy41
set speed=600
set opt=o2std
set usb=serial

Setting those things up from another batch file allows each to be selected. Then the fully formed FQBN is assembled as follows:
Code:
set fqbn=teensy:avr:%model%:usb=%usb%,speed=%speed%,opt=%opt%,keys=%keys%

If you specify all four of those in the FQBN then it should build using provided values?
 
Ah, wow thank you, will try....
And what about adding some defines (like this -DTEENSYDUINO=159) to control the #ifdef ?
 
...after some testing i found this works (monitored the changes when the parameter where changed in the IDE)...
SPEED := speed=528,opt=o3std => 528Mhz and fastest
BOARD = teensy:avr:teensy41:$(SPEED)

=> So it seems it is possible to add somthing on the --fqbn option

${ARDUINO} compile --fqbn ${BOARD} --build-property ${CLI_FLAGS} --library "${LIB_PATH}" ${PROJECT}.ino --verbose
 
I’m glad you got it working for your needs. I was just about to respond that @defragster’s approach should be tried first, and then, if you need further options that aren’t supplied there (eg. library-specific options), the approach I outline should be used.
 
Sorry, shawn

it was not my intention to ignore anyones suggestions here....sorry for this....was faster with trying things and writing here....

Do not be angry with me....
 
Sorry, shawn

it was not my intention to ignore anyones suggestions here....sorry for this....was faster with trying things and writing here....

Do not be angry with me....
Quite the opposite. No anger here. I don’t feel like you ignored anything. My statement that I’m glad you got @defragster’s suggestion working first was sincere. :)

In fact, his suggestion is actually preferred, and I’m glad he brought it up, because it’s easier to do and, for the options provided in that approach that are appropriate to your needs, is more appropriate.
 
Great you got it working with that!

Windows Batch file for use in editors looks to be about 6 years old:

Running TSET.cmd in sketch folder generates compile.cmd {prompting for which Teensy/speed/usb/optimize} that replicates the Arduino IDE 1.x command line that used the FQBN telling the Arduino build the options for the boards.txt and platform.txt
 
Back
Top