Pages: [1] 2   Go Down
Author Topic: How do I write core for an abandoned board?  (Read 1460 times)
0 Members and 1 Guest are viewing this topic.
Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 2
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 594
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just change pins_arduino.c with the different pins
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 2
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

ottawa, canada
Offline Offline
God Member
*****
Karma: 5
Posts: 989
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Faraday Member
**
Karma: 19
Posts: 3420
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Check out my experiments http://blog.blinkenlight.net

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 2
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Faraday Member
**
Karma: 19
Posts: 3420
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Check out my experiments http://blog.blinkenlight.net

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 2
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Logged

0
Offline Offline
Faraday Member
**
Karma: 19
Posts: 3420
20 LEDs are enough
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink
Logged

Check out my experiments http://blog.blinkenlight.net

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 178
Posts: 12288
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6379
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 2
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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!

Logged

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 2
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 2
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
 
Logged

Pages: [1] 2   Go Up
Jump to: