Pages: [1]   Go Down
Author Topic: Problem with Eclipse/Jantje Plugin vs Arduino IDE using Arduino DUE  (Read 1834 times)
0 Members and 1 Guest are viewing this topic.
Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 370
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Having bought a DUE to experiment with AND being a tremendous fan of the Jantje Plugin under ECLIPSE, I started to try the Blink program on the DUE. However I did run into an interesting problem:
Arduino IDE 1.5.2
Blink program compiles and links fine and is installed with ease.

Eclipse
Blink compiles fine but runs into an error

Code:
'Starting combiner'
"D:/Arduino/hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-g++" -Os -Wl,--gc-sections -mcpu=cortex-m3 "-T/D:/Arduino/hardware/arduino/sam/variants/arduino_due_x/linker_scripts/gcc/flash.ld" "-Wl,-Map,D:/workspace/testDue/Release/testDue.map" -o "D:/workspace/testDue/Release/testDue.elf" "-LD:/workspace/testDue/Release" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "D:/workspace/testDue/Release/arduino/syscalls_sam3.c.o"    ./testDue.cpp.o   D:/workspace/testDue/Release/arduino.ar   "/D:/Arduino/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a" "D:/workspace/testDue/Release/arduino.ar" -Wl,--end-group
arm-none-eabi-g++: /D:/Arduino/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a: Invalid argument
make: *** [testDue.elf] Error 1

This seems a bit funny as to my understanding both use the same compiler environment. Jantje am I correct in assuming this?
No doubt I did something wrong here smiley-mr-green But I would like to know where I f..ck..d up  smiley-mr-green
Logged

Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 370
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Wel I found the cause:
This
Code:
/D:/Arduino/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a

Should be
Code:
D:/Arduino/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a
The first slash should be left out. When I changed the environment variable it works fine. Now to find out why this was put in in the first place.
Logged

Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 370
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Dug some deeper. It seems there is a little bug in Jantje's plugin.
If I fill in constants (i.e. the correct location) in the platform.txt the environment variable is still created wrong (A.BUILD.VARIANT.PATH = "/D:/Arduino...etc). This first slash is incorrect. Should not be there. But since I am ignoring this parameter in  the SAM platform.txt file it will at least compile fine without having to change the environment variable every time.
Now the clue is to find where this variable is built up. Seems to be in the Helper file. I'll dig deeper.
Logged

Tasmania - Australia
Offline Offline
Sr. Member
****
Karma: 15
Posts: 307
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

mmm interesting, I wonder if it will also apply to Linux and OSX configurations?
If I get a chance tomorrow, I'll like hook one up and see what happens.
____
Paul
Logged


Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 370
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Could be it works fine for non-wondows systems as in Unix it would be a full pathname. It would certainly help to find a solution smiley
Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1920
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The code you are looking for is
Code:
IEnvironmentVariable var = new EnvironmentVariable(ENV_KEY_build_variant_path, pathMan.getURIValue(
ArduinoConst.PATH_VARIABLE_NAME_ARDUINO_PINS).getPath()
+ "/${" + ArduinoConst.ENV_KEY_build_variant + "}");
contribEnv.addVariable(var, confDesc);
From what I see it looks like the arduino pin path is not properly set.
As this is part of the "post processing" (so after the platform.txt and boards.txt have been processed) this can not be overwritten by these files.

Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1920
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just created a new due sketch and compiled on linux and windows xp. Worked in both environments.
I assume there is a problem with the "linked resource" arduino pin path in your environment.

Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 370
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just checked but it looks correct
D:\Arduino\hardware\arduino\sam\variants
« Last Edit: January 02, 2014, 02:25:14 am by nicoverduin » Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1920
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just checked but it looks correct
D:\Arduino\hardware\arduino\sam\variants
wierd.
Easiest to track down the problem would be to debug.  I have searched again and the only location I can find where this environment variable is set is in the method setTheEnvironmentVariablesPostProcessing in arduinohelpers.java.
Easiest would be to debug the code. I'm sure you can do so.
Is there anything special to the d drive? Such as cloud drive or linked drive ...
Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 370
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Jantje
I agree and I am planning to do so when I find the time smiley-fat
At least it is not a show stopper as there are 2 workarounds:
- hardcode in platforms.txt
- modify the parameter in the environment variables once the project is generated.
However as I am apparently the only one.... I probably made messed up my environment (too many different arduino versions on my laptop or something). Unless the world is falling apart I'll dig into it and let you know.
Another educational problem smiley-mr-green :Dlike those!!!
Logged

Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 370
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Whatever it is, it happens on all  my platforms (Arduino, Tiny and sam). So for some unclear reason the Variant path starts with a / instead of a Drive letter. But since I only use the variants with the SAM processors all go well by coincidence.

I made some prints of the variables:
Code:

Path Variable Name Arduino Pins
ENV_KEY_build_variant_path=A.BUILD.VARIANT.PATH
PATH_VARIABLE_NAME_ARDUINO_PINS=ArduinoPinPath
Pathman PATH_VARIABLE_NAME_ARDUINO_PINS=/D:/Arduino/hardware/arduino/sam/variants
ENV_KEY_build_variant=A.BUILD.VARIANT
Path Variable =A.BUILD.VARIANT.PATH=/D:/Arduino/hardware/arduino/sam/variants/${A.BUILD.VARIANT} ; [REPL]
Notice that Pathman is already wrong. and it is built with this statement:
Code:
   private static void setTheEnvironmentVariablesPostProcessing(IContributedEnvironment contribEnv, ICConfigurationDescription confDesc) {
IPathVariableManager pathMan = confDesc.getProjectDescription().getProject().getPathVariableManager();
   IPathVariableManager pathMan = confDesc.getProjectDescription().getProject().getPathVariableManager();

This is where it goes wrong.



« Last Edit: January 02, 2014, 06:20:28 pm by nicoverduin » Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1920
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

just for my understanding
Can you give me a printscreen of the project properties->resource->linked resource->path variables ?
Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 370
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have added the project properties from an Arduino Uno project and a SAM project as well as the wrong environment variable for both projects. It happens (in my case for all my projects). SAM was the first for me to use the Variant. That is why I never saw it..
SAM project



Arduino project


Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1920
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I really can't make sense of this.
Eclipse is known for "once a workspace is bad it is hard to fix"
could you try if you have the same problem in a new workspace?
And is your D drive in any way special? version control; cloud drive ....
Best regards
jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Heemskerk, Netherlands
Offline Offline
Sr. Member
****
Karma: 10
Posts: 370
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nope it is a standard D drive. Nothing special.
But I will have a look at it later. No time now. Connecting an ethernet Card and a nrf24L01 on an Arduino. Using softSPI for the nrf seems to work smiley
Logged

Pages: [1]   Go Up
Jump to: