Author Topic: Migrate C/C++ applications from Teensy/Arduino to MCUXpresso.  (Read 1455 times)

0 Members and 1 Guest are viewing this topic.

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
 
Hi.
Does anyone know of any simple or automated system to migrate a C/C++ development from Teensy/Arduino to MCUXpresso?

Some time ago I was trying to understand the intricate and hidden structure of the internal sources and libraries developed with Arduino, and the truth is that I found it quite complex. It is one of the things that I have never liked about Arduino, in addition to its terrible and basic IDE, all the things that are hidden and do not let you migrate a development to other environments, even being the same microcontroller and same GCC compiler.

Regards.
« Last Edit: April 16, 2020, 05:06:21 pm by luiHS »
 

Offline donotdespisethesnake

  • Super Contributor
  • ***
  • Posts: 1093
  • Country: gb
  • Embedded stuff
Re: Migrate C/C++ applications from Teensy/Arduino to MCUXpresso.
« Reply #1 on: April 16, 2020, 06:13:38 pm »
I have ported a few Arduino projects to other platforms, the simple way is to rewrite the application until it runs. It's just code. If by "simple" you mean "not time consuming" then no there isn't.

As for automated, I very much doubt that. If its an Arduino/AVR project you can import it into Atmel Studio. What is your source and target CPU? There are several flavors of Teensy.
Bob
"All you said is just a bunch of opinions."
 
The following users thanked this post: luiHS

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
Re: Migrate C/C++ applications from Teensy/Arduino to MCUXpresso.
« Reply #2 on: April 16, 2020, 07:05:57 pm »
What is your source and target CPU? There are several flavors of Teensy.

Its a Kinetis MK66.
 

Offline tmadness

  • Regular Contributor
  • *
  • Posts: 83
  • Country: us
Re: Migrate C/C++ applications from Teensy/Arduino to MCUXpresso.
« Reply #3 on: April 16, 2020, 07:18:02 pm »
Sounds like a job for python, for the adventurous  |O. I have in the past though about something like this but ended doing what donotdespisethesnake did, hack-compile-transfer lib-repeat
 
The following users thanked this post: luiHS

Online westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Migrate C/C++ applications from Teensy/Arduino to MCUXpresso.
« Reply #4 on: April 16, 2020, 10:29:22 pm »
Quote
I was trying to understand the intricate and hidden structure of the internal sources and libraries developed with Arduino, and the truth is that I found it quite complex. It is one of the things that I have never liked about Arduino, in addition to its terrible and basic IDE, all the things that are hidden
I don't understand what you're talking about.


The Arduino build process is trivial (to the point of being annoying) and pretty transparent and obvious.  Much more obvious than the
average auto-generated template-based Makefile, for instance.

If you turn on "Verbose" compilation in the Arduino IDE preferences, the build window will show every compilation-related command that happens.   Aside from the pre-processing of the user sketch itself, which is "not much", you just have a chain of standard gcc tool usage.
I copy&paste compile/etc commands from the IDE to a CLI shell all the time to add/adjust some parameter that isn't changeable from within the IDE.
In addition, there's a well-documented "3rd party board" description explaining the "patterns" used for creating the compile commands, AND the whole mess of stuff (IDE, cores, libraries, etc) is all Open Source...

 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4040
  • Country: nz
Re: Migrate C/C++ applications from Teensy/Arduino to MCUXpresso.
« Reply #5 on: April 16, 2020, 11:52:49 pm »
I don't understand what you're talking about.

Yeah, I'm with you.

Sure the IDE is a bit basic, but it is functional and certainly a lot lot better than Notepad, which a surprising number of people seem to be happy with. And you can use an external editor if you want.

It's easy to find the source code for something like digitalWrite() for any given MCU, and it's not hard to understand. It's usually a bit *long* -- like 20 or 50 lines of code -- because of the flexibility of being able to specify the pin number dynamically, and mapping Arduino pin numbers to board pin numbers etc. But if you can't understand it then you probably don't have much chance of writing your own code using MCU registers directly anyway, so ...
 

Offline ehughes

  • Frequent Contributor
  • **
  • Posts: 409
  • Country: us
Re: Migrate C/C++ applications from Teensy/Arduino to MCUXpresso.
« Reply #6 on: April 17, 2020, 02:20:03 am »
Just start a new MCUXpresso C++ project.   It already initialized the environment.

To be honest, I can't image there is much in the libraries that can't be reimplemented quickly.

I would just take stock on what you are actually using and go from there.    If you poke around in the arduino install folder you can find all of the porting layers and c++ classess that you could just copy into the build system.
   If there is some teensy specific library you want to re-use,  it shouldn't be hard to find in the filesystem.

IMHO,  your best bet is to forget that your Arduino even exists and start over.       
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf