Go Down

Topic: How do I write core for an abandoned board? (Read 1 time) previous topic - next topic

skyjumper

Hi All...

I'm relatively new to Arduino, but not to software development. I have a Sanguino, but I didn't learn until after I made a commitment to it that support for it gos back to 0018 and apparently has stopped (even though they are still being sold). I can't use the String class or the new SDFat class. So I decided to try to bring core up to date for it, but after a bit of tinkering I realized there is a lot I need to know.

I'm wondering, is there a doc or FAQ or anything about writing core to support a new board? Or anything else tha covers what needs to be done?

Thanks!

frank26080115

just change pins_arduino.c with the different pins
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

skyjumper


just change pins_arduino.c with the different pins


No its more than that. I tried, as someone suggested, taking the files from the current Arduino and copying them into the Sanguino folder, excluding those two source files for the pins.

But, then Serial1 is not recognized. I had a look into HardwareSerial.h/cpp and saw what the macro (#define) needed to be and I defined it, but still no joy.

There is more to it I assume...


bill2009

I can't remember where i saw it but i believe there are posted instructions for updating newer arduino cores for sanguino.  Maybe the author's blog?

Udo Klein

You have several options:
1) Use Arduino 18
2) Adapt Arduino libraries to work with this board
3) Learn how to get rid of the Arduino stuff and how to compile/upload from the commandline
3b) learn how to reuse Arduino stuff even if you build without Arduino ;)

I prefer (3). Might take some ffort though.
Check out my experiments http://blog.blinkenlight.net

skyjumper


You have several options:
1) Use Arduino 18
2) Adapt Arduino libraries to work with this board
3) Learn how to get rid of the Arduino stuff and how to compile/upload from the commandline
3b) learn how to reuse Arduino stuff even if you build without Arduino ;)

I prefer (3). Might take some ffort though.



Well option 2 makes sense, but thats essentially updating the cores, which is what I want to do. Then I can distribute the updates for everyone to use.

Option 1 is not great, since some libraries won't work with it. Examples are SDFat and the String library thats now in core.

Option 3 is fine, but I don't see how it solvs the primary issue, which is that some libs don't work under 0022...

Udo Klein

It depends on your goal. If you want to solve it for everyone you have to go for (2). If you want it to work for you go for (3). Once you master (3) you need not care about updates anymore. It is pretty simple to adapt almost any library once you understand the guts of the system. (3) helps to learn this.
Check out my experiments http://blog.blinkenlight.net

skyjumper

Okay so when you say "arduino stuff" in option 3, do you mean the IDE or all the Arduino libs? Some of the libs are pretty handy but don't compile under 0022 for Sanguino. How does running make from the command line fix the libs?

If i do 3, can I write my own main.cpp and get rid of the setup() and loop() functions? I saw main.cpp in the core and i realize it would be easy to ditch.



Udo Klein

Running from the command line and switching to C++ makes you understand how the libs are compiled into your code. This in turn goes a long way in the direction of analyzing and understanding them. The libs are actually pretty simple to understand once you know how to locate them ;)
Check out my experiments http://blog.blinkenlight.net

Coding Badly


Have you tried this core?
http://www.avr-developers.com/

westfw

See the discussion starting here: http://arduino.cc/forum/index.php/topic,58990.msg425186.html#msg425186

skyjumper



Have you tried this core?
http://www.avr-developers.com/



Cool!!!

I just installed those, and my app compiled with a String and Serial1 in there, so i have hope. No time to test tonight but I'll play tomorrow. This my just solve my problem, thank you!


skyjumper

This was a great solution for me. Everything compiles and runs like a champ, thank you for pointing this out!


CrossRoads

Fill me in on what you changed. My IDE install at home is totally hosed from the mucking about I did to get the 644P working for the demo I wrote for you, can't compile anything anymore.
I want to remove it all, reload with -0021, and then update from there for the 644P again.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

skyjumper


Fill me in on what you changed. My IDE install at home is totally hosed from the mucking about I did to get the 644P working for the demo I wrote for you, can't compile anything anymore.
I want to remove it all, reload with -0021, and then update from there for the 644P again.


Er, sorry about that :-(

This is super easy though, although these cores are adapted for 0022. I doubt that will matter. If you do this and select the ATMega644P from the boards menu then it will use these, and probably use the 0021 cores for the native boards. This guy supports almost everything under creation. Not the next gen faster chips though. I was hoping for that! Atmel told me the newer ones have much better performance. Oh well.

Anyhow, go here:

http://www.avr-developers.com/corefiles/index.html

And like he says on that page, unzip his dirtro into the hardware folder. Thats it!
 

Go Up