Linking Teensyuino object files with Atmel Studio object files


Active member
Hi guys,

I am working on a project on Teensy 4.1.

The story is:
I buildt a project in Atmel (Microchip) Studio 7 running on an Arduino Uno. It is a very special sound player. And it is running on an Arduino Uno, but it's to slow to match my needs.
The details of the project doesn't matter here, there is no issue because it is running - but to slow.

So I looked for an alternative to the Uno, and bought a Teensy 4.1 to get more performance.

I think best for Teensy 4.1 is the Arduino IDE with Teensyduino.
But I don't want to port the whole project.

My idea is to write hardware related parts of the project in Arduino IDE with Teensyduino. I want to build some includes and then fetch the object files (.o) to put it into object files into Atmel (Microchip) Studio 7, where the existing and working project has been developed.

I start with a simple thing:

>> On Teensyduino the code is:

/* LED Include for Teensy 4.1 */

#include <Arduino.h>

const int ledPin = 13;

void LED_on() {
pinMode(ledPin, OUTPUT); // initialize the digital pin as an output
digitalWrite(ledPin, HIGH); // set the LED on

void LED_off() {
pinMode(ledPin, OUTPUT); // initialize the digital pin as an output
digitalWrite(ledPin, LOW); // set the LED on

I fetched the .o-file and put it as 'other object' into the ARM/GNU linker.

>> On Atmel Studio the code is:

extern void LED_on (void);

int main(void) {
LED_on(); // set the LED on

In Atmel Studio I changed the target processor of the existing project to ATSAMD51G19A (is this a good choice?) and started the build process..

Atmel Studio tells me:
Error ..\Teensy Projekte\Teensy1\sketch\TeensyLED.cpp.o uses VFP register arguments, Teensy1.elf does not

To solve this I have two questions at first:

1. Am I able to change the compiler options in Teensyduino that they match those of Atmel Studio Compiler?
How and where?

2. Has anybody in the community done this?
And what is your experience with it?

Any suggestions? Many thanks.

Good morning Community,

I'm surprised I didn't get a response to my thread at all. Not even a

Sorry - I am a newbee - may be I have broken the rules of this forum.

If so, please let me know. I will improve myself.

Thank you for understanding.
You can not link an object file compiled for one processor to an object file compiled for another processor. Object files contain the actual machine code which is totally dependent on the processor.
Yes I know.
The processor I choose in Atmel Studio is a a workaround. Bt I think it's the same family.
The processor of the Teensy 4.1 I didn't find.
The error message coming from the linker is not related to the processor. I searched on the web that it's something with floating point, but there is no floating point in the code.
Do you agree?

Thank you for your reply.
You would need to set your ATMEL Studio to the toolchain which is used by Teensyduino and use the same compiler switches. But this would be the same as using the Arduino IDE and select a Teensy board. So, I'm afraid you will have to port the source code of your UNO project if you want to run it on a Teensy.