Go Down

Topic: Problem with Eclipse/Jantje Plugin vs Arduino IDE using Arduino DUE (Read 2 times) previous topic - next topic

nicoverduin

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: [Select]

'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:
Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl

nicoverduin

Wel I found the cause:
This
Code: [Select]

/D:/Arduino/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a


Should be
Code: [Select]

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.
Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl

nicoverduin

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.
Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl

rockwallaby

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

nicoverduin

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 :)
Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl

Jantje

The code you are looking for is
Code: [Select]
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.

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 -

Jantje

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

nicoverduin

#7
Jan 02, 2014, 07:04 am Last Edit: Jan 02, 2014, 08:25 am by nicoverduin Reason: 1
Just checked but it looks correct
D:\Arduino\hardware\arduino\sam\variants
Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl

Jantje


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

nicoverduin

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!!!
Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl

nicoverduin

#10
Jan 03, 2014, 12:18 am Last Edit: Jan 03, 2014, 12:20 am by nicoverduin Reason: 1
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: [Select]


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: [Select]

   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.



Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl

Jantje

just for my understanding
Can you give me a printscreen of the project properties->resource->linked resource->path variables ?
Best regards
Jantje
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 -

nicoverduin

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


Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl

Jantje

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

nicoverduin

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 :)
Met vriendelijke groet / kindest regards
Nico Verduin
www.verelec.nl

Go Up