How do I write core for an abandoned board?

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!

just change pins_arduino.c with the different pins

frank26080115:
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...

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?

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 :wink:

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...

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.

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.

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 :wink:

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

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

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!

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

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.

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.

Er, sorry about that :frowning:

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!

Thanks, will give it a try.
I think in my case was somewhat user induced - windows vista appears to have some "virtual c:\program files" kind of thing going on, I got caught up in that and the regular c:\program files, my arduino stuff is now all over the place and not working at all. Old Sony Vaio just died (opened it up to add more memory, now it won't even boot, evenwith putting the old memory back), so we just got a $350 HP Pavilion laptop at Bestbuy to replace it. Big performance differnce over a 2004 era machine, even at 2.2 GHz. Was small & light too, great for airplane travelling. New one is not too bad, touch heavier at 5.1 lbs I think.
So now every computer in the house has a different operating system - my old desktop with XP, son's old desktop changed from XP to Linux, my laptop with Vista, hers with Windows7, son's Mac with SnowLeopard or something. Configuration nightmare!

And you get to support it all! I finally got all the PCs on to Windows 7, except my netbook which is about dead anyhow and of course the kid's Mac...

I'm not messing with what's working :slight_smile: Not at $200 a pop for Win7 licences, and then having to reinstall years of applications...