Hi There,
I have a 16 x 16 array of WS2812's in a ZIG ZAG configuration.
I can build the matrixtest code in the Arduino IDE fine, and it runs as expected.
However, I far prefer to be working in eclipse for Arduino.
I have this working well for a project that drives a neopixel ring. I can build and deploy from the eclipse enviroment happily.
When I modify this code, or start a new project from clean, the moment I add in the neomatrix library the code does not appear to run on target.
To validate this I gutted the code back to a simple setup routine that flashes a LED on D2 on/off/on/off, with no other code.
With the adafruit neopixel and GFX libs included in the project ( though not used ) the startup code can be seen to run.
Adding in the NeoMatrix lib however, even with no functional calls to the lib as the test harness above, and it does not appear to run the setup function, ie no flashing leds.
Now I know this should easily fit, I am using an Nano board, and as commented the full code runs fine when built / loaded from the Arduino 1.5.6-r2 enviroment.
It is only when building from the eclipse environment I have the problem.
I can add / remove the NeoMatrix lib, and clean rebuild, and the problem can be reproduced / removed at will.
I assume it is something to do with the memory layouts, and the extra flash requirement messing up the image / boot address, but struggling to prove it. No doubt at link time it is deciding to roll in many lib functions even though I don't substantiate and call anything.
Any ideas how I can dig this out?
I will scratch around in the memory reports from the build chain and see if I can spot anything, but scratching my head right now...
Thanks.
Neomatix lib in eclipse for Arduino
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- big_red_frog
- Posts: 27
- Joined: Sat Dec 21, 2013 11:10 pm
Re: Neomatix lib in eclipse for Arduino
Haven't been able to find anything obvious, and at a bit of a loss right now :-(
- big_red_frog
- Posts: 27
- Joined: Sat Dec 21, 2013 11:10 pm
Re: Neomatix lib in eclipse for Arduino
OK, found the answer, feel a little stupid, but it was a mine, and I stepped on it.
There is a subfolder in the NeoMatrix lib directory called extras that contains a file called gamma.c
As there is a legitimate gamma.h in the lib build, I hadn't questioned the gamma.c file.
However, chopping through excluding each file, I isolated, that gamma,c could be excluded, and everything was fine.
Looking in the file, it is obvious there is a main() function in there!
The file clearly states
// THIS IS NOT ARDUINO CODE -- DON'T INCLUDE IN YOUR SKETCH. It's a
// command-line tool that outputs a gamma correction table to stdout;
// redirect or copy and paste the results into header file for the
// NeoMatrix library code.
So its a support tool
The Arduino IDE seems to ignore this file, however, importing the same lib into Arduino Eclipse IDE tries to roll it in, and the wrong main is run, surprised the build doesn't fail with two "main" functions though.
I have highlighted this experience to the kind keepers of the plugin, so hopefully lib import behavior an be tightened. Not sure how dangerous it is to have this c file in the lib folder structure in general...
Main thing is I can continue to develop in eclipse which is sweet.
There is a subfolder in the NeoMatrix lib directory called extras that contains a file called gamma.c
As there is a legitimate gamma.h in the lib build, I hadn't questioned the gamma.c file.
However, chopping through excluding each file, I isolated, that gamma,c could be excluded, and everything was fine.
Looking in the file, it is obvious there is a main() function in there!
The file clearly states
// THIS IS NOT ARDUINO CODE -- DON'T INCLUDE IN YOUR SKETCH. It's a
// command-line tool that outputs a gamma correction table to stdout;
// redirect or copy and paste the results into header file for the
// NeoMatrix library code.
So its a support tool
The Arduino IDE seems to ignore this file, however, importing the same lib into Arduino Eclipse IDE tries to roll it in, and the wrong main is run, surprised the build doesn't fail with two "main" functions though.
I have highlighted this experience to the kind keepers of the plugin, so hopefully lib import behavior an be tightened. Not sure how dangerous it is to have this c file in the lib folder structure in general...
Main thing is I can continue to develop in eclipse which is sweet.
- big_red_frog
- Posts: 27
- Joined: Sat Dec 21, 2013 11:10 pm
Re: Neomatix lib in eclipse for Arduino
It is likely the arduino plugin for eclipse will be modified to also exclude extras folder in libs, as this is believed to be current arduino IDE behaviour.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Neomatix lib in eclipse for Arduino
Thanks for posting the information. We don't have any in-house expertise with Eclipse (we don't use it), but this should help anyone else who runs into the same problelm in the future.
- big_red_frog
- Posts: 27
- Joined: Sat Dec 21, 2013 11:10 pm
Re: Neomatix lib in eclipse for Arduino
I would be interested to know what you are developing in.
Although you have to move away from the .ino file extension for the eclipse plugin, to a more traditional workspace / c file structure, it is a minimal change and healthy for anyone learning their way into embedded.
For very little overhead and no cost, you get a fully featured IDE including really helpful features like full relational browsing out of the box.
If anyone wants to have a look, then I recommend downloading a full package of eclipse with CDT ( C development toolkit ) and arduino extensions from the originators site at
http://www.baeyens.it/eclipse/
Kudo's to Jantje for creation and maintaining this.
The most active thread is
http://forum.arduino.cc/index.php/topic,79595.0.html
I have no connection with this development beyond being a happy user the stumbled across it when in need!
For simple deployment, ( I can only talk to windows ) this instance is a nightly, has all of the above, including the fix for excluding the extras folder
http://eclipse.baeyens.it/download/prod ... -14.tar.gz
Unpack it to a suitable location, launch exclipseArduinoIDE.exe, and go into window/preferences/arduino
Set the paths according to your installation of 1.5.6 Arduino IDE, so eclipse can find all the toolchains.
Then set your perspective ( view configuration ) via window/open perspective/other/arduino, you will have the classic verify / load icons in the toolbar as per the standard arduino IDE.
Create a new project via arduino / new sketch, and you get to select your target hardware.
At that point you will have a workspace in the project explorer, including myProjectName.cpp which will look like the skeleton of your classic .ino file.
You can cut and paste the content of any existing .ino file in here, and drag and drop any supporting files directly into the workspace in project explorer and you will be good to go.
Libraries registered with the arduino IDE can be added into your project simply via
Arduino/add a library to the selected project
Once you are up and running, you can get complex code up with strong tooling, this took me a surprising short period of time to get running in a maintainable manner.
http://youtu.be/JTI7bfBAYBQ
Enjoy, hope I havent confused matters...
Although you have to move away from the .ino file extension for the eclipse plugin, to a more traditional workspace / c file structure, it is a minimal change and healthy for anyone learning their way into embedded.
For very little overhead and no cost, you get a fully featured IDE including really helpful features like full relational browsing out of the box.
If anyone wants to have a look, then I recommend downloading a full package of eclipse with CDT ( C development toolkit ) and arduino extensions from the originators site at
http://www.baeyens.it/eclipse/
Kudo's to Jantje for creation and maintaining this.
The most active thread is
http://forum.arduino.cc/index.php/topic,79595.0.html
I have no connection with this development beyond being a happy user the stumbled across it when in need!
For simple deployment, ( I can only talk to windows ) this instance is a nightly, has all of the above, including the fix for excluding the extras folder
http://eclipse.baeyens.it/download/prod ... -14.tar.gz
Unpack it to a suitable location, launch exclipseArduinoIDE.exe, and go into window/preferences/arduino
Set the paths according to your installation of 1.5.6 Arduino IDE, so eclipse can find all the toolchains.
Then set your perspective ( view configuration ) via window/open perspective/other/arduino, you will have the classic verify / load icons in the toolbar as per the standard arduino IDE.
Create a new project via arduino / new sketch, and you get to select your target hardware.
At that point you will have a workspace in the project explorer, including myProjectName.cpp which will look like the skeleton of your classic .ino file.
You can cut and paste the content of any existing .ino file in here, and drag and drop any supporting files directly into the workspace in project explorer and you will be good to go.
Libraries registered with the arduino IDE can be added into your project simply via
Arduino/add a library to the selected project
Once you are up and running, you can get complex code up with strong tooling, this took me a surprising short period of time to get running in a maintainable manner.
http://youtu.be/JTI7bfBAYBQ
Enjoy, hope I havent confused matters...
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Neomatix lib in eclipse for Arduino
We use the Arduino IDE.. that's what most of our customers will use, so we need to stay compatible with its quirks.
For preference, we suggest version 1.0.4. 1.0.5 added a set of default libraries that include an out-of-date version of our Adafruit_GFX, and that causes all sorts of obscure problems. The 1.0.5 compiler has also been tuned for very strict type matching, which gets in the way as often as not.
We suggest avoiding the 1.5 branch unless you're working with a platform that specifically demands it, like the Yun or Due. That branch is experimental, and kicks up obscure bugs on a fairly regular basis.
For preference, we suggest version 1.0.4. 1.0.5 added a set of default libraries that include an out-of-date version of our Adafruit_GFX, and that causes all sorts of obscure problems. The 1.0.5 compiler has also been tuned for very strict type matching, which gets in the way as often as not.
We suggest avoiding the 1.5 branch unless you're working with a platform that specifically demands it, like the Yun or Due. That branch is experimental, and kicks up obscure bugs on a fairly regular basis.
- big_red_frog
- Posts: 27
- Joined: Sat Dec 21, 2013 11:10 pm
Re: Neomatix lib in eclipse for Arduino
Good info, appreciated
Please be positive and constructive with your questions and comments.