Go Down

Topic: Windows/Linux/Mac Eclipse plugin to compile and upload arduino sketches (Read 121180 times) previous topic - next topic


I don't consider myself old but I have some decades of experiance in programming C/C++ myself; so I know what you are talking about.
I always had mixed feelings about not supporting multiple configurations. Now with he potential of debugging on the DUE this may become harder.
Point is however that the configuration in Arduino 1.5.X is done in 2 files ( boards.txt platform.txt) external to Eclipse. This is why I removed nearly all compiling options in V2. My current thinking is that if you want multiple configurations you have to modify the boards.txt file.
I currently see 2 options
1) adding a menu option for debug
2) adding a debug board (uno debug; mega debug ....)
Both are very easy to implement and supported by Arduino IDE and my Arduino eclipse plugin V2.
Do you think this can help you out?



Adding extra boards, and having them assignable per build configuration is probably the best way that fits in with your current model, and is easy to work with to changwe the build options in the boards.txt file then. I like it - neat and easily kept simple.



I hope you can pinpoint the Due upload problem you are experiencing. (I see nothing glaringly wrong in the info)
Best regards
Jantje



I solved it (Well, pinpointed the problem and come up with a workaround until I get time to spend more time poking the linker)

The problem arose again for me when in a different project attempting to allocate some memory with malloc(), and anything with a new operator (obviously the same thing really) and a couple of other times in object constructors.

With the malloc problem, it was easier to debug, as I got more information out of it. _sbrk (the underlying memory allocation call) was not linkable.

Basically, although syscalls_sam3.c (the syscall stub for the M3) was being compiled correctly and then linked correcly into the audino.ar archive ( a quick dump shows the relevent objects there), the final link step was not finding any symbol from this file to link into the image. The inclusion of the linker option "-Wl,--warn-unresolved-symbols" meaning that the action didn't error, yet built a seemingly valid image, which it would happily upload to a due and cause it to do, well, nothing!

So after swearing at whoever thought that option was a good idea ;) I spent some time looking at the audiono.ar file and the linker. I couldn;t find any obvious issue as to why it won;t link, but when I get some time I will do more work on that. It's a long, lng time since I've had to take apart linker dumps... it will be "fun" ;D

So as a workaround, if you link the syscalls_sam3.c file directly into your project using import, then it will force it to be included on the link line as a single object in addition to the auduino.ar file (reflecting the command line I used to finally make it all work), then it links correctly and all works fine. (Any conflict is avoided by the fact that the linker denies the existance of those symbols in the archive).

So, until I have time to pull the linker apart and find out exactly what's happening, this is an effective workaround whenever anything uses calls in syscalls.h, most obvious being any memory allocation.

Kate.

Hello,

I am trying to set up my Arduino Due project under the eclipse with the newest plugin from  http://www.baeyens.it/eclipse/V2 but when I am building it, I got this linking error:

Starting combiner
"D:/Development/Arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-g++" -Os -Wl,--gc-sections -mcpu=cortex-m3 "-TD:/Development/Arduino/arduino-1.5.1r2/hardware/arduino/sam/variants/arduino_due_x/linker_scripts/gcc/flash.ld" "-Wl,-Map,D:/Temp/eclipse/Workspace/Firmware/Release/Firmware.map" -o "D:/Temp/eclipse/Workspace/Firmware/Release/Firmware.elf" "-LD:/Temp/eclipse/Workspace/Firmware/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     ./libs/ClickDelayedOffSwitcher.cpp.o ./libs/ClickDelayedSwitcher.cpp.o ./libs/ClickMultiSwitchers.cpp.o ./libs/ClickNextSwitcher.cpp.o ./libs/ClickPressReleaseSwitcher.cpp.o ./libs/ClickSwitcher.cpp.o ./libs/OffSwitcher.cpp.o ./libs/OnOffSwitcher.cpp.o ./libs/PressReleaseSwitcher.cpp.o ./libs/SmartyHomeCore.cpp.o ./libs/TemperatureSensor.cpp.o  ./Firmware.cpp.o   D:/Temp/eclipse/Workspace/Firmware/Release/arduino.ar   "D:/Development/Arduino/arduino-1.5.1r2/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a" "D:/Temp/eclipse/Workspace/Firmware/Release/arduino.ar" -Wl,--end-group
d:/development/arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-abort.o): In function `abort':
abort.c:(.text+0xa): warning: undefined reference to `_exit'
d:/development/arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x12): warning: undefined reference to `_sbrk'
d:/development/arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text+0x18): warning: undefined reference to `_kill'
d:/development/arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text+0x0): warning: undefined reference to `_getpid'
d:/development/arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text+0x16): warning: undefined reference to `_write'
d:/development/arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text+0x12): warning: undefined reference to `_close'
d:/development/arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text+0x14): warning: undefined reference to `_fstat'
d:/development/arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text+0x12): warning: undefined reference to `_isatty'
d:/development/arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text+0x16): warning: undefined reference to `_lseek'
d:/development/arduino/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text+0x16): warning: undefined reference to `_read'
Finished building: Firmware.elf

I don't know what to do in order to avoid thesse warnings and to create successfully the .elf file.
Can you help me please?

Thanks,
Andrei

Jantje

can you compile the project in the arduino IDE with verbose compile options and paste the compile outcome here?
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 -

As a temporary solution the fix I suggested in my post above yours will fix your issue. You are seeing the same issue as I did with the link not linking syscalls_sam3.c from the audiono.ar correctly.

Jantje

katekarnage
That is what I thought. But I need the arduino log to know what the plugin is doing differently to do the final fix.
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 -

Absolutely.

Apologies BTW for not having got around to taking apart the linker yet to see what it thinks it's doing - just haven't had the time yet :(




Jantje

I found the bug
Code: [Select]
String Value = MakeEnvironmentString(Var[1].replace("\"{build.path}/syscalls_sam3.c.o\"", "")); // /TOFIX
No more need for the verbose log output.
As I'm working on multiple configurations right now I can not quickly release a new version. Next version will contain the fix.
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 -

Hi Jantje,

Can you tell me please me where can I put this code in order to fix temporary the issue until you will release a new version?

Thanks,
Andrei

HI katekarnage,

Thank you very much for your reply! I will do this as a workaround until Jantje will release a new version,

Thank both of you for these quick replies!

Andrei

Jantje

I'm looking for alfa testers for V2.1 as this version should fix the bug for due I see at least 2 potential candidates here  :D.
Read more at http://blog.baeyens.it/#post5
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 -

DrObscure

Just installed the plugin version 1.2.4 (tried 1.2.0, but it failed with errors about not being able to find things at the site).
I have Arduino Vers-1.5.2..  and Eclipse Juno.. all running on Win8...

When I try to configure the Arduino plugin settings, I get an error on the Paths..
"Arduino folder is not correct"

I have the Arduino IDE Path set to the location of the arduino.exe file..
I have the Private Library set to the arduino-1.5.2\lib directory..
(I have also tried setting it to the \libraries directory with no changes in the result)

What is the plugin looking for here that I have missed?

Thanks..

Jantje

If you want to run on Arduino IDE 1.5.2 you need V2 of the plugin
What are the errors you got? Are you behind a firewall?
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 -

DrObscure

I am not behind a firewall (I am using a WiFi at my relatives place today.. don't really know firewall status, and they probably don't either, but it appears not  :)

The errors I received when trying to have Eclipse install the most current version (1.2.2 - didn't write it down, so not clear on version) .. the errors were related to not being able find files at the site...

So, I choose to install the version from the 'uncatorized' list...

How do I get plugin V2??
--thx

Jantje

for installing V2 see http://blog.baeyens.it/#post4
this one refers to the normal installation guide located at http://eclipse.baeyens.it/Install.html
Which states
Quote
uncheck "group items by category"

So all seems OK to me  :D

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 -

DrObscure

All is OK for me now too...
Thanks Jantje for the assist, and all your hard work on this project for the community at large..

Now to get to work :)
--chane

Go Up