altineller 4 Posted August 9, 2015 Share Posted August 9, 2015 Hello, There used to be a document on this forum, or stellaristi forum, like general guidelines for porting from arduino to energia. It had explained all the caveats and includes you have to do and change, and was a nice document. Unfortunately, i can not find it anymore. and it seems that stellaristi has been shut down. Anyone remembers where I can find this document? I googled for a while, but failed. Any ideas/help/recomendations greatly appreciated, Best, Quote Link to post Share on other sites
Rei Vilo 695 Posted August 9, 2015 Share Posted August 9, 2015 I remember having posted or contributed to this thread about porting an Arduino library to Energia but I can no longer find it. I hope it hasn't been lost... Quote Link to post Share on other sites
Fmilburn 446 Posted August 9, 2015 Share Posted August 9, 2015 There is this one: http://forum.43oh.com/topic/7511-howto-porting-libraries-some-help-needed/ But I also seem to remember another one and can't find it. Rei Vilo 1 Quote Link to post Share on other sites
altineller 4 Posted August 10, 2015 Author Share Posted August 10, 2015 There is this one: http://forum.43oh.com/topic/7511-howto-porting-libraries-some-help-needed/ But I also seem to remember another one and can't find it. this one is good, but I think the other one is unfortunately lost, I wonder if we can fetch it from archive.org or google's cache. If we had the original url that would not be a problem. Quote Link to post Share on other sites
bluehash 1,581 Posted August 11, 2015 Share Posted August 11, 2015 this one is good, but I think the other one is unfortunately lost, I wonder if we can fetch it from archive.org or google's cache. If we had the original url that would not be a problem. Any idea which one? Is there a link? Quote Link to post Share on other sites
Fmilburn 446 Posted August 12, 2015 Share Posted August 12, 2015 @@bluehash - There are a number of individual posts about specific Arduino library conversions scattered about and maybe those are collectively what I remember. The one above is the only consolidated one I could find. Quote Link to post Share on other sites
altineller 4 Posted August 12, 2015 Author Share Posted August 12, 2015 @@Fmilburn @@bluehash hello, on the other forum that was closed there was a document, that collected those individual posts into a generalized howto. apparently it is lost, or my memory is failing me. But @@Rei Vilo remembers such document too. anyway, what is lost, we can reconstruct. best. Quote Link to post Share on other sites
bluehash 1,581 Posted August 12, 2015 Share Posted August 12, 2015 @@Fmilburn @@bluehash hello, on the other forum that was closed there was a document, that collected those individual posts into a generalized howto. apparently it is lost, or my memory is failing me. But @@Rei Vilo remembers such document too. anyway, what is lost, we can reconstruct. best. Was it on stellarisiti? Because those forum posts are on this forum now. Quote Link to post Share on other sites
altineller 4 Posted August 12, 2015 Author Share Posted August 12, 2015 Was it on stellarisiti? Because those forum posts are on this forum now. yes it was and it was like a pinned document at the top. Quote Link to post Share on other sites
theja2289 0 Posted November 5, 2015 Share Posted November 5, 2015 is it possible to build an automatic converter based on the first link contribution? Quote Link to post Share on other sites
Fmilburn 446 Posted November 5, 2015 Share Posted November 5, 2015 Hi @@theja2289 is it possible to build an automatic converter based on the first link contribution?That would be nice wouldn't it? I'm not the most qualified to answer, but here goes anyway. The short answer is that it isn't practical for a number of reasons but ultimately because the underlying hardware is different and Energia / Arduino / Wiring have diverged somewhat over time. When the authors of code and libraries stick to the common "language" and libraries then things pretty much work. But, there are a number of reasons they might not, and plenty of deviations. For example: The pin functions vary The software may access hardware features present in one microcontroller but not another The software may directly accesses hardware, say to speed things up or reduce memory requirements (maybe even through assembly language) The C++ compiler upon which Energia/Arduino are based differ somewhat There are core features/libraries added to Arduino but not Energia (and vice versa). This even holds for different boards within Energia / Arduino. The language evolves with time Etc. It is possible to write libraries and sketches that work with different underlying architecture but it requires more effort - basically the author needs to be familiar with and deal with the issues listed above. This isn't always possible. Anyway, the further things get from the high level abstractions in Energia / Arduino, the harder it gets to directly port (and the harder it would be to write a universal translator). Sometimes it is easier just to start from scratch and write new code - hard to expect a compiler translator to do that EDIT: This link has useful information also. Quote Link to post Share on other sites
igor 163 Posted November 5, 2015 Share Posted November 5, 2015 is it possible to build an automatic converter based on the first link contribution? Many of the simpler changes mentioned in the howto thread can be handled automatically using macros, etc. More recent versions of Energia include some macros which handle some of the changes mentioned in the thread. Having standard, cross-platform libraries for some common functions (which are not currently abstracted) would help. (i.e. create a common abstraction layer for functions which are currently handled on a device specific basis). For instance: a standard timer class. I worked some on a cross-platform timer object which would work on MSP430, AVR, SAM, Tiva. (Based on DueTimer, TimerOne, etc.) But this would only help if it became widespread enough that the program writer happened to have used it. (Though I suppose it might help if there was a simple enough way of translating timer access idioms on a particular machine into uses of the standard library that it could be done automatically.) Given that there are now Arduino environments used for many different processors (x86, STM32, etc.) it would probably help to have a more general guide to porting code/writing Arduino code that is easy to adapt to many different processors/families. (Of course most writers of Arduino programs, being inexperienced, would probably not use it. But it might help for those writing libraries.) Fmilburn 1 Quote Link to post Share on other sites
Rei Vilo 695 Posted November 6, 2015 Share Posted November 6, 2015 Sometimes, it is easier to start developing the library from scratch instead of trying to adapt it. This is especially true when the initial library uses MCU-specific functions and registers. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.