Arduino Forum

Products => Arduino Due => Topic started by: rbid on Dec 03, 2012, 02:17 pm

Title: [Q]: Tailoring the Due to Eclipse..
Post by: rbid on Dec 03, 2012, 02:17 pm
Hello,

Today I got my Arduino Due, so I will be starting to play with it.

Reading through the Arduino site, all the pointers in tailoring Eclipse to the Arduino are for the AVR 8-bit processors and not for ARM, therefore, can someone give a link or a tutorial on how to do it here on the Arduino Due forum?

Thanks in advance and have a nice day!

--- Ricky Marek.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Dec 07, 2012, 12:12 am
Hi Ricky,

I have not yet purchased the Arduino Due but I'm also interested in using Eclipse with Arduino Due board in the futur.
I installed Atmel Studio 6.0 (it's free) there is the possibility of creating a project Arduino Due with (Atmel Software Framework : ASF). I know this is not what you want but it is better than the Arduino IDE.
You can download it here : http://www.atmel.com/tools/atmelstudio.aspx (http://www.atmel.com/tools/atmelstudio.aspx)

Good luck.

Bye.

Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: rbid on Dec 07, 2012, 10:08 am

Hi Ricky,

I have not yet purchased the Arduino Due but I'm also interested in using Eclipse with Arduino Due board in the futur.
I installed Atmel Studio 6.0 (it's free) there is the possibility of creating a project Arduino Due with (Atmel Software Framework : ASF). I know this is not what you want but it is better than the Arduino IDE.
You can download it here : http://www.atmel.com/tools/atmelstudio.aspx (http://www.atmel.com/tools/atmelstudio.aspx)

Good luck.

Bye.

Nassa.


I have the Atmel Studio 6.0 which is based on Visual Studio, I just updated it so it I will have the Arduino Due support.
Agree that is more professional than the Arduino IDE because it exposes the ARM processor and you have full control of it.
..... but in another hand, you need to do all by yourself without the Arduino framework.

The reason why I'm looking for Eclipse is that I want my son to get used to a well know IDE used also in several platforms (Embedded, Linux, etc)
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Dec 07, 2012, 02:19 pm
Hello Ricky,

It is possible to compile the source code Arduino framework with your program in Atmel Studio.

Bye.

Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: rbid on Dec 11, 2012, 07:22 pm

Hello,

Today I got my Arduino Due, so I will be starting to play with it.

Reading through the Arduino site, all the pointers in tailoring Eclipse to the Arduino are for the AVR 8-bit processors and not for ARM, therefore, can someone give a link or a tutorial on how to do it here on the Arduino Due forum?

Thanks in advance and have a nice day!

--- Ricky Marek.


Today I tried again to tailor it via the AVR plugin or Arduino plugin, both are for AVR environment and not the SAM3 :(

Any one has done this work?.

Atmel Studio 6 is not suitable for me. (I work in mixed platforms, here in a Windows7, and helping my kid under Linux)

Thanks in advance.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Dec 11, 2012, 09:19 pm
Hi Ricky,

This weekend, I wrote a manual for the Board Teensy 3.0 (*) (compatible with Arduino IDE) to compile in Eclipse. The Board Teensy 3.0 is based on an ARM processor like Arduino Due : http://forum.pjrc.com/threads/1474-Anyone-using-Eclipse-for-development

If you want I can try to find a solution for Arduino Due ?
But I could not test the complied binary file because I did not Arduino Due Board.

Does it make you interested ?

* The Board Teensy 3.0:
http://www.kickstarter.com/projects/paulstoffregen/teensy-30-32-bit-arm-cortex-m4-usable-in-arduino-a?ref=live
http://www.pjrc.com/teensy/

Bye.

Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Dec 15, 2012, 09:51 pm
Hi Ricky !

I wrote a procedure to use Eclipse with Arduino Due board.
This procedure is written for Winwdows, but you can adapt it to Linux if you want.
But the problem is that I don't now what software to use to uplaod the program in Arduino Due board ...
I can't do test because I don't have Arduino Due board.

Eclipse installation for Arduino Due on Windows

Introduction
This manual is written for Arduino Due IDE.
This manual will allow you install an Eclipse environment to edit and compile your programs but also to communicate with your Arduino Due Board with USB (serial) and a terminal.
This is not a definitive solution, but works very well.

#1. You must first download the following elements:
-   Arduino Due IDE : http://arduino.cc/en/Main/SoftwareDue
-   Elicpe IDE for C/C++ Developers Juno SR1 32 bits (64 bits is not compatible with RXTX plug-in) : http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/junosr1
-   GNU ARM Eclipse Plug-in : http://sourceforge.net/projects/gnuarmeclipse/files/Current%20Releases/0.5.4/
-   TM-terminal 3.4.1 : http://www.eclipse.org/downloads/download.php?file=/tm/downloads/drops/R-3.4.1-201209191030/TM-terminal-3.4.1.zip

#2. Installation:
-   Unzip Arduino Due IDE, for example: "C:\arduino-1.5.1r2".
-   Unzip Eclipse IDE for C/C++, for example: "C:\ArduinoDue\eclipse".
-   Add Arduino tool chain path in the Windows Path: "C:\arduino-1.5.1r2\hardware\tools\g++_arm_none_eabi\bin".

#3. Configuration:
-   Start Eclipse and install the GNU ARM Eclipse Plug-in, click on menu "Help/Install New Software…"
-   In the dialog box "Install", click on "Add" button.
-   In the "Add Repository" dialog box, click on "Archive…" button.
-   In the this dialog box, select the downloaded plug-in file : "org.eclipse.cdt.cross.arm.gnu_0.5.4.201202210114.zip"
-   In the dialog box "Install", click on "Add" button.
-   In the "Add Repository" dialog box, type "RXTX" in the "Name" field and type http://rxtx.qbang.org/eclipse/ in the "Location" field and click on the "Ok" button.
-   With Windows Explorer, create a new folder "TM" in the "C:\ArduinoDue\eclipse\dropins" folder.
-   Copy "TM-trminal-3.4.1.zip" file in the "TM" folder, and unzip this file in this folder. Restart Eclipse.

#4. Create the ArduinoDueCore library Project:
-   In Eclipse, create a project, click on menu "File/New/C++ Project".
-   In the dialog box "C++ Project", type the Project Name : "ArduinoDueCore"
-   Disable, "Use default location" checkbox.
-   Click on the "Browse" button and select the location of your project.
-   In the "Project type" area, select "ARM Cross Target Static Library/Empty Project".
-   In the "Toolchains" area, select "ARM Windows GCC (Sourcery G++ Lite)".
-   Click on the "Next" button.
-   On the Configuration area disable the "Debug" checkbox.
-   Click on the "Finish" button.
-   Check the project, click on the project with right mouse button, in the popup window, click on the "Properties" item.
-   In the tree area in the left of dialog box, select "C/C++ General/Paths and Symbols"
-   Verify in the "Includes" tab than "Include directories" are filled with the path based added in the Windows Path (in step #2) on the Assembly, GNU C, GNU C++ languages. If the path is not correctly set, you must verify that the path has been correctly set.
-   Click on the "Cancel" button to close the dialog box.
-   Create a "src\core" folder in project, click on the project with right mouse button, click on "New/Folder" item of popup menu. Type "src\core" in "Folder name" field and click on the "Finish" button.
-   With Windows Explorer select all files in the "C:\arduino-1.5.1r2\hardware\arduino\sam\cores\arduino" folder and copy to the "src\core" folder of the "ArduinoDueCore" project.
-   In the "src\core" folder, remove "main.cpp" and "syscalls_sam3.c" files.
-   In the "src" folder create "lib" folder.
-   From the "C:\arduino-1.5.1r2\hardware\arduino\sam\system\" folder copy the followings folders and files to the "src\lib" project folder:
-   "CMSIS\CMSIS\Include\*.h" (with all the include files).
-   "CMSIS\Device\ATMEL\" with the include files : "sam3.h", "sam.h".
-   "CMSIS\Device\ATMEL\sam3xa\include\component\*.h" (with all the include files).
-   "CMSIS\Device\ATMEL\sam3xa\include\instance\*.h" (with all the include files).
-   "CMSIS\Device\ATMEL\sam3xa\include\pio\pio_sam3x8e.h".
-   "CMSIS\Device\ATMEL\sam3xa\include\" with the include files: "sam3x8e.h", "sam3xa.h", "system_sam3xa.h".
-   "CMSIS\Device\ATMEL\sam3xa\source\gcc_atmel \startup_sam3xa.c".
-   "CMSIS\Device\ATMEL\sam3xa\source\system_sam3xa.c".
-   "libsam\include\*.h".
-   "libsam\source\*.c".
-   "libsam\ship.h".
-   From the "C:\ARM\arduino-1.5.1r2\hardware\arduino\sam" folder copy the followings folders and files to the "src\lib" project folder:
-   "variants\arduino_due_x\linker_scripts\gcc\flash.ld".
-   "variants\arduino_due_x\linker_scripts\" with the files: "pins_arduino.h", "variant.cpp", "variant.h".
-   In Eclipse, click on the project with right mouse button, click on the "Refresh" item.
-   The "src\core" and "src\lib" folders appear with its files and the sub folders and others source code files…

Following the next post...
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Dec 15, 2012, 09:54 pm
... Next part :

#5. ArduinoDueCore library project Settings:
-   In Eclipse, click on the project with right mouse button, click on the "Properties" item.
-   Select "C/C++ Build/Settings" in the tree area on the left.
-   In the "Tool Settings" tab, in "Target Processor" select "cortex-m3" value of "Processor" property and enable the "Thumb" checkbox.
-   Select "ARM Sourcery Windows GCC C Compiler/Preprocessor", in the "Defined symbols" area, adds the following items:
-   __SAM3X8E__
-   USB_PID=0x003E
-   USBCON
-   Select "ARM Sourcery Windows GCC C Compiler/Directories", in the "Include paths" area, add the followings items: (using the "Workspace…" button)
-   "\src\core".
-   "\src\lib\CMSIS\Device\ATMEL".
-   "\src\lib\CMSIS\CMSIS\Include".
-   "\src\lib\libsam\include".
-   "\src\lib\libsam".
-   "\src\lib\CMSIS\Device\ATMEL\sam3xa\include".
-   "\src\lib\variants\arduino_due_x".
-   Same setting for "ARM Sourcery Windows GCC C++ Compiler/Preprocessor" and "ARM Sourcery Windows GCC C Compiler/Directories", and click on "OK" button.
-   To build the ArduinoDueCore library, click on the project with right mouse button, click on the "Build Project" item. In the "Release" folder, the "libArduinoDueCore.a" file has been generated.

#6. Create your Arduino Due project:
-   In Eclipse, create a project, click on menu File/New/C++ Project.
-   In the dialog box "C++ Project", type the Project Name: "MyProject".
-   In the "Project type" area, select "ARM Cross Target Application/Empty Project".
-   In the "Toolchains" area, select "ARM Windows GCC (Sourcery)".
-   Click on the "Next" button.
-   On the Configuration area disable the "Debug" checkbox.
-   Click on the "Finish" button.
-   Create a "src" folder in project, click on the project with right mouse button, click on "New/Folder" item of popup menu. Type "src" in "Folder name" field and click on the "Finish" button.
-   With Windows Explorer select "main.cpp" and "syscalls_sam3.c" files in the "C:\arduino-1.5.1r2\hardware\arduino\sam\cores\arduino\" folder and copy to the "src" folder of the "MyProject" project.
-   In Eclipse Modify main.cpp :

Code: [Select]
#define ARDUINO_MAIN
#include "Arduino.h"

#ifdef USB_SERIAL
usb_serial_class Serial;
#endif

int main(void) {
init();

delay(1);

#if defined(USBCON)
USBDevice.attach();
#endif

pinMode(13, OUTPUT);

for (;;) {
digitalWrite(13, HIGH);
delay(50);
digitalWrite(13, LOW);
delay(950);
}
}


-   In Eclipse, click on the project with right mouse button, click on the "Refresh" item.
-   The "src" folder appears with its files.

#7. MyProject project Settings:
-   In Eclipse, click on the project with right mouse button, click on the "Properties" item.
-   Select "C/C++ Build/Settings" in the tree area on the left.
-   In the "Tool Settings" tab, in "Target Processor" select "cortex-m3" value of "Processor" property and enable the "Thumb" checkbox.
-   Select "ARM Sourcery Windows GCC C Compiler/Preprocessor", in the "Defined symbols" area, adds the following items:
-   __SAM3X8E__
-   USB_PID=0x003E
-   USBCON
-   Select "ARM Sourcery Windows GCC C Compiler/Directories", in the "Include paths" area, add "src" folder of "ArduinoDueCore" : (using the "Workspace…" button)
-   "ArduinoDueCore/src/core"
-   "ArduinoDueCore/src/lib/libsam"
-   "ArduinoDueCore/src/lib/CMSIS/Device/ATMEL"
-   "ArduinoDueCore/src/lib/variants/arduino_due_x"
-   "ArduinoDueCore/src/lib/CMSIS/CMSIS/Include"
-   "ArduinoDueCore/src/lib/CMSIS/Device/ATMEL/sam3xa/include"
-   Same setting for "ARM Sourcery Windows GCC C++ Compiler/Preprocessor" and "ARM Sourcery Windows GCC C Compiler/Directories", and click on "OK" button.
-   Select "ARM Sourcery Windows GCC C++ Linker/General", in the "Script file" field, clicks on the "Browse…" and select "ArduinoDueCore\src\lib\variants\arduino_due_x\linker_scripts\gcc\flash.ld" file, folder of MyProject.
-   Select "ARM Sourcery Windows GCC C++ Linker/Library", in the "Libraries" area, adds "ArduinoDueCore" and in "Library search path" area, adds the path where the ArduinoDueCore library is located, use the "Workspace…" button and select the "Release" folder of ArduinoDueCore library project.
-   Select "Project References", in the "Project references for 'MyProject'" enable the "ArduinoDueCore" checkbox.
-   To build your project, click on the project with right mouse button, click on the "Build Project" item. In the "Release" folder, the "MyProject.hex" file has been generated.


Good Luck !

Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Dec 16, 2012, 08:46 pm
Hi,

I found the solution to upload your programs with Eclipse.
The Arduino IDE uses Bossa Due flash programming for ARM http://www.shumatech.com/web/products/bossa

How to configure Eclipse:

#8. Aduino Due program loader settings:
-   In Eclipse, on the menu "Run/External Tools/External Tools Configurations…"
-   In the dialog box select on the "Program" item in the tree area, and click on the "New launch configuration" icon.
-   In the "Name" field, type "Arduino Due".
-   In the "Main" tab, in the "Location" field, type the path: "C:\arduino-1.5.1r2\hardware\tools\bossac.exe".
-   In the "Arguments" field, type : "--port=COM3 -U false -e -w -v -b ${project_path}\Release\${project_name}.hex -R"
-   Warning, the port argument value is "COM3" change this value if your board is connected on another Com Port.
-   In the "Common" tab, enable the checkbox "External Tools", and click on the "Apply" button.

#9. Upload program to the Arduino Due board:
-   In Eclipse, select your project, "MyProject".
-   Click on the button "Run Arduino Due" of the tools bar to start Bossa loader. For example: http://ekawas.blogspot.fr/2009/04/google-app-engine-eclipse.html

#10. Connect the terminal to the Arduino Due board:
-   Modify your main.cpp file :

Code: [Select]
#define ARDUINO_MAIN
#include "Arduino.h"

#ifdef USB_SERIAL
usb_serial_class Serial;
#endif

int main(void) {
init();

delay(1);

#if defined(USBCON)
USBDevice.attach();
#endif

Serial.begin(38400);
pinMode(13, OUTPUT);

for (;;) {
digitalWrite(13, HIGH);
Serial.println("Hello World");
delay(50);
digitalWrite(13, LOW);
delay(950);
}
}


-   Compile and upload this program.
-   To open the terminal view, click on the menu "Window/Show View/Other…".
-   In the "Show View" dialog box, in the tree area, select "Terminal/Terminal" and click on the "OK" button.
-   In the Terminal view, click on the "Settings" icon to open the "Terminal Settings" dialog box.
-   Type "Arduino Due" on the "View Title", select "Serial" "Connection Type" select box, select the "Port", select the "Baud Rate" to 38400 and click on the "OK" button.
-   Click on the "Connect" button, the "Hello Word" message appears every second.

Good Luck !
Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: graynomad on Dec 17, 2012, 12:19 am
Very well documented Nassa and thanks for the effort.

Nowhere near turnkey enough for this little black duck though, let me know when we just have to do step #10 :)

______
Rob
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Dec 17, 2012, 04:31 pm
Hi Graynomad,

Thanks for your message.
Yes, I spent a lot of time, it was not easy.
For example how to uplaod a program in the board.
I used the Arduino IDE Due, I have compiled a sample program and I clicked on upload button.
As I do not have Arduino Due board, the Arduino Due IDE displays the following message: "No device found on COM3".
I did a search for text "No device found on" in the folder of the Arduino Due IDE, and I found the file bossac.exe.
I replaced this file with a small program that just prints on the stdout the arguments that are get in parameter.
I clicked on upload button on the Arduino Due IDE, and the parameter are displayed in the Arduino IDE.
In this way I got the list of parameters to use with bossac.exe.

I make an improvement on a tool chain path configuration described on the #2 Step.

If like me, you use different board with different toolchain (AVR, Teensy 3.0, Arduino Due...), you will need to modify the PATH environment variable in Windows depending on the board you are using. It is heavy!
In Eclipse, it is possible to configure environment variable to a workspace and therefore no need to change the Winwdows PATH environment variable :

-   Set the tool chain path, click in "Windows/Preferences".
-   In the tree area in the left of "Preferences" dialog box, select "C C++/Build/Environment".
-   On "Preferences/Environment" clicks on the "select…" button.
-   In the "Select variables" dialog box, enable checkbox of "Path" item, and click on the "OK" button.
-   Back on the "Preferences/Environment" select the "Path" item added, and click on the "Edit…" button.
-   In the "Edit variables" dialog box, add the tool chain path "C:\arduino-1.5.1r2\hardware\tools\g++_arm_none_eabi\bin" without remove the current path values, and click on the "OK" button.
-   In the "Preferences/Environment" click on the "OK" button.

Good luck

Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: zad80 on Dec 20, 2012, 05:35 pm
Hi Nassa ,
just for further reference, in the file hardware/arduino/sam/board.txt are listed all the parameters needed to upload the firmware on every boards , for example in case of arduino due


Code: [Select]
arduino_due_x_dbg.name=Arduino Due (Programming Port)
arduino_due_x_dbg.upload.tool=bossac
arduino_due_x_dbg.upload.protocol=sam-ba
arduino_due_x_dbg.upload.maximum_size=524288
arduino_due_x_dbg.upload.use_1200bps_touch=true
arduino_due_x_dbg.upload.wait_for_upload_port=false
arduino_due_x_dbg.upload.native_usb=false
arduino_due_x_dbg.build.mcu=cortex-m3
arduino_due_x_dbg.build.f_cpu=84000000L
arduino_due_x_dbg.build.core=arduino
arduino_due_x_dbg.build.extra_flags=-D__SAM3X8E__ -mthumb -DUSB_PID={build.pid} -DUSB_VID={build.vid} -DUSBCON
arduino_due_x_dbg.build.ldscript=linker_scripts/gcc/flash.ld
arduino_due_x_dbg.build.variant=arduino_due_x
arduino_due_x_dbg.build.variant_system_lib=libsam_sam3x8e_gcc_rel.a
arduino_due_x_dbg.build.vid=0x2341
arduino_due_x_dbg.build.pid=0x003e

arduino_due_x.name=Arduino Due (Native USB Port)
arduino_due_x.upload.tool=bossac
arduino_due_x.upload.protocol=sam-ba
arduino_due_x.upload.maximum_size=524288
arduino_due_x.upload.use_1200bps_touch=true
arduino_due_x.upload.wait_for_upload_port=true
arduino_due_x.upload.native_usb=true
arduino_due_x.build.mcu=cortex-m3
arduino_due_x.build.f_cpu=84000000L
arduino_due_x.build.core=arduino
arduino_due_x.build.extra_flags=-D__SAM3X8E__ -mthumb -DUSB_PID={build.pid} -DUSB_VID={build.vid} -DUSBCON
arduino_due_x.build.ldscript=linker_scripts/gcc/flash.ld
arduino_due_x.build.variant=arduino_due_x
arduino_due_x.build.variant_system_lib=libsam_sam3x8e_gcc_rel.a
arduino_due_x.build.vid=0x2341
arduino_due_x.build.pid=0x003e


hope it helps.
BR
   Zad
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: dabbede on Jan 05, 2013, 05:50 pm
Hi Nassa ,

thank you very much for this guide. Maybe, you should create a specific page in a "tutorial" form, in order to be easier to read and follow.
However, I've tried it on my Ubuntu machine and I've encountered some problem:

- I had to install TM-trminal as explained in this guide http://stackoverflow.com/questions/12140381/how-to-open-a-serial-terminal-in-eclipse-juno (http://stackoverflow.com/questions/12140381/how-to-open-a-serial-terminal-in-eclipse-juno) (via "Install new software" feature) because I couldn't locate the proper "dropin" folder
- in #5 and #7, I think you mean "Same setting for "ARM Sourcery Windows GCC C++ Compiler/Preprocessor" and "ARM Sourcery Windows GCC C++ Compiler/Directories"" (just a typo probably)
- in #8 I had to modify the working directory in ${project_loc}/Release/ and set the bossac parameter parameter as "--port=ttyACM0 -U false -e -w -v -b ${project_name}.hex -R". In particular, pay attention to the ${project_loc} variable, as opposed to ${project_path} which is just relative and didn't work for me
- the hex file is quite large: ~150kB for your "blinking" main.c example, whereas the ArduinoIDE's blink example is just ~10kB when compiled.

The last problem is particularly annoying. Can you give me some more insight?
Thank you very much for your effort!!
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: dabbede on Jan 05, 2013, 07:14 pm
Oh, and by the way, I forgot to mention the most important thing:
for the main.cpp you posted, I was expecting something like a blinking LED on pin13.

However, after uploading the heavy hex, no blinking LED is present! Any idea?!?
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Jan 06, 2013, 08:17 pm
Hi Dabbede,

For the #5 and #7 steps the correct sentence is :
Same setting for "ARM Sourcery Windows GCC C++ Compiler/Directories" and "ARM Sourcery Windows GCC C Compiler/Directories", and click on "OK"

On the size of the binary, I think there is one or more embedded library are unnecessary. I can verify that.

When I wrote this compilation method for Eclipse, I had no Arduino Due Board. I have not tested.
Today I have an Arduino Due board but the command line Bossac for download only function 1 in 50 on my PC and I do not understand why.
I must first solve this problem.

Thanks for your test.

Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: dabbede on Jan 08, 2013, 11:35 am
Hi Nassa!

Bossac doesn't work?! It happened to me, too. Are you using a USB 3 port? This could be the problem.
To fix it, just program the Arduino by using a USB 2 port or, if you don't have it, through a USB 2.0 Hub!
Cheers
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: joppuh123 on Jan 08, 2013, 07:24 pm
I tried to follow to tutorial. But I cant build the static library I think some includes are wrong but I cant find out wich.

I got the following error log (not the complete log just this is just a small part) when trying to build. I'm on osx maybe that got something to do with it

Code: [Select]

'__disable_irq' was not declared in this scope interrupt_sam_nvic.h /ArduinoDueCore/src/lib/libsam/include line 123
'__DMB' was not declared in this scope interrupt_sam_nvic.h /ArduinoDueCore/src/lib/libsam/include line 123
'__enable_irq' was not declared in this scope interrupt_sam_nvic.h /ArduinoDueCore/src/lib/libsam/include line 135
'_dwIrq' was not declared in this scope USARTClass.cpp /ArduinoDueCore/src/core line 60
'_pUsart' was not declared in this scope USARTClass.cpp /ArduinoDueCore/src/core line 43
'Adc' was not declared in this scope adc.h /ArduinoDueCore/src/lib/libsam/include line 175
'Dacc' was not declared in this scope dacc.h /ArduinoDueCore/src/lib/libsam/include line 67
'IRQn_Type' does not name a type USARTClass.h /ArduinoDueCore/src/core line 35
'NVIC_DisableIRQ' was not declared in this scope USARTClass.cpp /ArduinoDueCore/src/core line 72
'NVIC_EnableIRQ' was not declared in this scope USARTClass.cpp /ArduinoDueCore/src/core line 60
'p_adc' was not declared in this scope adc.h /ArduinoDueCore/src/lib/libsam/include line 173
'p_dacc' was not declared in this scope dacc.h /ArduinoDueCore/src/lib/libsam/include line 66
'p_tc' was not declared in this scope tc.h /ArduinoDueCore/src/lib/libsam/include line 73
'p_tc' was not declared in this scope tc.h /ArduinoDueCore/src/lib/libsam/include line 71
'Pdc' does not name a type dacc.h /ArduinoDueCore/src/lib/libsam/include line 70
'Pio' does not name a type pio.h /ArduinoDueCore/src/lib/libsam/include line 124
'pPio' was not declared in this scope pio.h /ArduinoDueCore/src/lib/libsam/include line 109
'pPwm' was not declared in this scope pwmc.h /ArduinoDueCore/src/lib/libsam/include line 76
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Jan 08, 2013, 08:10 pm
Hi Joppuh,

I do not think your problem is not OSX.
In my opinion, there are two possibilities :

Either you forgot one of the 3 defines :
__SAM3X8E__
USB_PID=0x003E
USBCON

Either you forgot an include path or one or more files are missing.

Warning, and include Defines Path must be set in the configuration C and C+ + (Tool Settings) :
ARM Sourcery Windows GCC C Compiler
and
ARM Sourcery Windows GCC C + + Compiler

Let me known please.

Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: joppuh123 on Jan 08, 2013, 08:20 pm
These are my defined symbols in C and C++ compiler
_SAM3X8E_
USB_PID=0x003E
USBCON

These are my included paths

"${workspace_loc:/${ProjName}/src/core}"
"${workspace_loc:/${ProjName}/src/lib/CMSIS/Device/ATMEL}"
"${workspace_loc:/${ProjName}/src/lib/CMSIS/CMSIS/Include}"
"${workspace_loc:/${ProjName}/src/lib/libsam/include}"
"${workspace_loc:/${ProjName}/src/lib/libsam}"
"${workspace_loc:/${ProjName}/src/lib/CMSIS/Device/ATMEL/sam3xa/include}"
"${workspace_loc:/${ProjName}/src/lib/variants/arduino_due_x}"

Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Jan 08, 2013, 08:44 pm
The processor Define is :
__SAM3X8E__
and not
_SAM3X8E_
There is 2 underscore before and 2 underscore after.

Could you verify ?

And let me know please.

Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: joppuh123 on Jan 08, 2013, 09:27 pm
Still got 135 errors but all in USBcore.cpp

But Im able to build I got a libArduinoDueCore.a in my Release folder.

But I think the linker script isnt working for de MyProject
If I build your example I only get a main.o and a syscalls_sam3.o in my release folder..

EDIT
All the errors about USBcore.ccp are could not be resolved errors like:
Code: [Select]
Field 'UOTGHS_DEVCTRL' could not be resolved
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Jan 08, 2013, 09:48 pm
Clean your ArduinoDueCore project :
- clean ArduinoDueCore project
- in the "Problems" tab right click on the root errors node, when the popup is open, click on "Delete" item. You can do the same for warnings.
- bluid ArduinoDueCore.

Build MyProject.


Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: joppuh123 on Jan 08, 2013, 09:55 pm
No more errors or warnings!

But nothing in the release folder of myprojects..

I'll try to make a new project

EDIT
Got a .map file in my release folder but not a hex..
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: zad80 on Jan 09, 2013, 01:51 pm
Hi Nassa ,
I played a bit with arduino uno elipse integration and looking at your guide I don't see the define which says which board is beeng compiled.
In case of Aduino due it is -DARDUINO=151.
Zad
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: zad80 on Jan 09, 2013, 05:01 pm
Hi Nassa,
if I well understood ,to use the PROGRAMMING port with bossac you shall use one of the two procedures reported in the AduinoDue main page. that are :
1) pressing the erase button on the arduino while running bossac
2) Open the serial port without bossac, which activates the Erase and Reset sequence , and then launch the bossac .

Unfortunately I can only use the bossac via command line while pressing the erase button, if I do that using the eclipse external tool it doesn't works.
I'll do a script which opens the port ,closes it and then run the bossac.

By the way, to understand how the bossac is actually run by the arduino IDE , I substituted the original bossac with a simple shell script and run the upload procedure on the IDE.
Here the code :

Code: [Select]

echo $@ >/Applications/Arduino-due.app/Contents/Resources/Java/hardware/tools/bossac.arg
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/tools/bossac.orig $@


Zad
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: joppuh123 on Jan 09, 2013, 06:43 pm
I've got these error's now in myProject
These error's keep coming back I defined -L but it seems i't cant find the library or something if I build like 3 times in a row it completes but only shows the .o files
Code: [Select]

undefined reference to `digitalWrite' main.cpp /MyProject/src C/C++ Problem
undefined reference to `USBDevice' main.cpp /MyProject/src C/C++ Problem
undefined reference to `USBDevice_::attach()' main.cpp /MyProject/src C/C++ Problem
undefined reference to `pinMode' main.cpp /MyProject/src C/C++ Problem
undefined reference to `delay' main.cpp /MyProject/src C/C++ Problem
undefined reference to `init' main.cpp /MyProject/src C/C++ Problem


EDIT:

Fixed it now I got a elf file!
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: zad80 on Jan 09, 2013, 07:11 pm
I resolved the problem with bossac in Eclipse , for some reasons ,in my case , if as first parameter in the arguments list is placed --port=tty.usbmodemfd121 the command ends with :
Code: [Select]
No device found on tty.usbmodemfd121 also when I press the erase button.
if --port is used as seconds parameter, using the erase button, eclipse and bossac run like a charm.

Code: [Select]

Erase flash
Write 9556 bytes to flash

[                              ] 0% (0/38 pages)
[=======                       ] 26% (10/38 pages)
[===============               ] 52% (20/38 pages)
[=======================       ] 78% (30/38 pages)
[==============================] 100% (38/38 pages)
Verify 9556 bytes of flash

[                              ] 0% (0/38 pages)
[=======                       ] 26% (10/38 pages)
[===============               ] 52% (20/38 pages)
[=======================       ] 78% (30/38 pages)
[==============================] 100% (38/38 pages)
Verify successful
Set boot flash true
CPU reset.


I tried to open the programming port and then to launch bossac , but I have still the uploading problem.
For the moment it works fine with the erase button.

@joppuh123:
It seems your core library doesn't contain wiring_digital.c , do you have it in yours library files? it is contained inside variants/arduino_due_x

Cheers
zad
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: joppuh123 on Jan 09, 2013, 07:43 pm
I do got a wiring_digital.c I have it in /src/core not in variants...

I got an elf file I was able to upload the elf file but the led doesn't blink...

Is it because I dont got the -DARDUINO=151 define.

Also the library does build but is was browsing the source file and an error poped up.

Code: [Select]
Field 'PIO_OSR' could not be resolved wiring_digital.c /ArduinoDueCore/src/core line 62 Semantic Error


Getting an stm32 working in eclipse is easier than this!
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: zad80 on Jan 09, 2013, 08:02 pm
HI All,
finally I did it !
I'm able to build the blinky led program and upload it using the external tool all done in eclipse.
The last tiny problem is the bossac manually operation...
I've followed a different path from the one proposed by Nassa, obviously is due to him if I'm at this stage.
I will soon post how I did it .
Cheers
   Zad
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: joppuh123 on Jan 09, 2013, 08:10 pm
Congrats I'm excited to hear how you did it!
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Jan 09, 2013, 08:41 pm
Hi Zad,

What file .h .c .cpp the ARDUINO define is it used, I don't found it ?

I resolved my Bossac problem last night in this topic : http://arduino.cc/forum/index.php/topic,141628.0.html (http://arduino.cc/forum/index.php/topic,141628.0.html)

I used the terminal to erase the memory of the MCU :
- I open the terminal from eclipse.
- I close the terminal from eslipse.
- I launch the Bossac command line from eclipse.

The software upload running...

Thanks very much Zad.

Nassa.

Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: zad80 on Jan 09, 2013, 10:43 pm
Hi ,
Here what I did :
Arduino Ide version 1.5.1
Note Path character separator differs from the windows system, I build it on OSX
## ArduinoDueCoreLibrary
Make New C++ Project -> Arm Cross Target Library -> Sourcery G++ lite.
Import... -> file System-> <ArduinoDueIde>/Contents/Resources/Java/hardware/arduino/sam/cores/arduino all files + USB directory
import... -> file System-> <ArduinoDueIde>/Contents/Resources/Java/hardware/arduino/sam all content of directory variants/
Note that in the last import there is also a precompiled library : libsam_sam3x8e_gcc_rel.a

Project Properties-> C/C++ Build:
->Environment : add PATH Variable with Append option enabled and the following vaulue <ArduinoDueIde>/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi/bin/
->Settings->Target Processor= cortex-m3 ; Thumb enabled
->Settings->Debug = None

->Settings->Assembler GCC-> Preprocessor:
  Use PreProcessor checked
  -defined symbols (I defined those also here , but I think it can be skipped)
Code: [Select]

printf=iprintf
F_CPU=84000000L
ARDUINO=151
__SAM3X8E__
USB_PID=0x003e
USB_VID=0x2341
USBCON

  It is possible to copy the above lines and paste directly in the eclipse "Defined Symbols" area.
->Settings->Assembler GCC C->Warnings:  -Wall
->Settings->Assembler GCC C->Misc : I removed the Assembler Listing lines

->Settings->Compiler GCC C-> Preprocessor : the same of Assembler
->Settings->Compiler GCC C-> Directories :
Code: [Select]

/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/
"${workspace_loc:/${ProjName}/USB}"
"${workspace_loc:/${ProjName}}"
"${workspace_loc:/${ProjName}/variants/arduino_due_x}"
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/CMSIS/Include/
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/Device/ATMEL/
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/

Also the above code can be copied and pasted directly inside the include path area, note that the absolute paths fit in my case , you have to tailor those in respect of your situation.

->Settings->Compiler GCC C-> Optimization
Level : -Os
Function sections checked Data sections checked
->Settings->Compiler GCC C->Warnings:  -Wall
->Settings->Compiler GCC C->Misc :
Optional : -c --param max-inline-insns-single=500 -nostdlib
Language Standard: Compiler Default

->Settings->Compiler GCC C++-> Every things like GCC C Compiler except for :
->Settings->Compiler GCC C->Misc :
Optional : -c --param max-inline-insns-single=500 -nostdlib
Language Standard: Compiler Default
Do not use exception: checked
Do not use RTTI : checked

Then you can build the arduinoDueCore libraries.

## ArduinoDue Blink example
Make New C++ Project -> Arm Cross Target Application -> Sourcery G++ lite.
Create a cpp file like the following one:
Code: [Select]

/*
* Blinker.cpp
*
*  Created on: Jan 9, 2013
*      Author: zad
*/

#include <Arduino.h>

/*
 Blink
 Turns on an LED on for one second, then off for one second, repeatedly.

 This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {
 // initialize the digital pin as an output.
 pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
 digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(1000);               // wait for a second
 digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
 delay(1000);               // wait for a second
}


Project Properties-> C/C++ Build:
->Environment : add PATH Variable with Append option enabled and the following vaulue <ArduinoDueIde>/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi/bin/
->Settings->Target Processor= cortex-m3 ; Thumb enabled
->Settings->Debug = None
->Settings->Additional Tools:
Create FlashImage : Checked
Create Extended Listings: Checked
Print Size: Checked

->Settings->Assembler GCC-> Preprocessor:
 The same used in the library

->Settings->Compiler GCC C-> Preprocessor : the same used in library
->Settings->Compiler GCC C-> Directories :
Code: [Select]

"${workspace_loc:/ArduinoDueLib/USB}"
"${workspace_loc:/ArduinoDueLib}"
"${workspace_loc:/${ProjName}}"
"${workspace_loc:/ArduinoDueLib/variants/arduino_due_x}"
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/CMSIS/Include/
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/Device/ATMEL/
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/

->Settings->Compiler GCC C-> Optimization:the same used in library
->Settings->Compiler GCC C->Warnings:  the same used in library
->Settings->Compiler GCC C->Misc : the same used in library

->Settings->Compiler GCC C++-> the same used in library except for the directories :
Code: [Select]

"${workspace_loc:/ArduinoDueLib/USB}"
"${workspace_loc:/ArduinoDueLib}"
"${workspace_loc:/${ProjName}}"
"${workspace_loc:/ArduinoDueLib/variants/arduino_due_x}"
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/CMSIS/Include/
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/Device/ATMEL/
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/


->Settings->Linker GCC C++
Command line pattern:
Code: [Select]
${COMMAND} ${FLAGS} ${OUTPUT_FLAG}  ${OUTPUT_PREFIX}${OUTPUT} -Wl,--start-group ${INPUTS} -Wl,--end-group[\code]

->Settings->Linker GCC C++->General
Script File:/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/variants/arduino_due_x/linker_scripts/gcc/flash.ld
->Settings->Linker GCC C++->Libraries
libraries area:
[code]
ArduinoDueLib  
sam_sam3x8e_gcc_rel

the first entry above is the output of the arduinoDueCore libraries there you need to wire the output without the lib part and .a suffix , i.e. libArduinoDueLib.a becomes ArduinoDueLib

libraries search paths:
Code: [Select]

"${workspace_loc:/ArduinoDueLib/Debug}"
"${workspace_loc:/ArduinoDueLib/variants/arduino_due_x}"

In my case the output of the lib was in Debug others may have Release it depends on the C++ project and build conf.

->Settings->Linker GCC C++->Misc
Other object area add :
"${workspace_loc:/ArduinoDueLib/Debug/syscalls_sam3.o}"
Other Flags:
Code: [Select]
-lm -lgcc  -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

For
->Settings->Create Flash
->Settings->Create Listing
leave defaults
->Settings->Print->General
I preferred the Barkeley format and Show total checked;

->Settings-> Build Steps Tab and add a post-build command:
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-objcopy -O binary ${ProjName}.elf ${ProjName}.bin



Then you can build the Blink program the program elf shall be about 9548bytes

######## Extern Tool Configurations:
new launch conf chose a name , mine was ARduino_due
Main-> Location:
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/tools/bossac.orig
Main-> Arguments:
Code: [Select]

-U false
--port=tty.usbmodemfd121
-e
-w
-v
-b
"${workspace_loc:}/${project_name:}/Debug/${project_name:}.bin"
-R


Build
I have disable build before launch

Finally you can run , but before you need to press the erase button or open and close a the serial via eclipse as described by Nassa :http://arduino.cc/forum/index.php/topic,141628.0.html

 Cheers
   Zad[/code]
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Jan 09, 2013, 11:11 pm
Very good Job Zad,

I was just doing the same job ...

Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Jan 09, 2013, 11:28 pm


The sketch compilation is :
Code: [Select]

C:\ARM\arduino-1.5.1r2\hardware\tools\g++_arm_none_eabi\bin\arm-none-eabi-g++
-c -g -Os -w
-ffunction-sections
-fdata-sections
-nostdlib
--param max-inline-insns-single=500
-fno-rtti
-fno-exceptions
-Dprintf=iprintf
-mcpu=cortex-m3
-DF_CPU=84000000L
-DARDUINO=151
-D__SAM3X8E__
-mthumb
-DUSB_PID=0x003e
-DUSB_VID=0x2341
-DUSBCON
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\system/libsam
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\system/CMSIS/CMSIS/Include/
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\system/CMSIS/Device/ATMEL/
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\cores\arduino
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\variants\arduino_due_x Blink.cpp -o Blink.cpp.o


The Arduino core compilation for C file
Code: [Select]
command:C:\ARM\arduino-1.5.1r2\hardware\tools\g++_arm_none_eabi\bin\arm-none-eabi-gcc
-c -g -Os -w
-ffunction-sections
-fdata-sections
-nostdlib
--param max-inline-insns-single=500
-Dprintf=iprintf
-mcpu=cortex-m3
-DF_CPU=84000000L
-DARDUINO=151
-D__SAM3X8E__
-mthumb
-DUSB_PID=0x003e
-DUSB_VID=0x2341
-DUSBCON
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\system/libsam
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\system/CMSIS/CMSIS/Include/
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\system/CMSIS/Device/ATMEL/
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\cores\arduino
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\variants\arduino_due_x
C:\ARM\arduino-1.5.1r2\hardware\arduino\sam\cores\arduino\cortex_handlers.c -o cortex_handlers.c.o


The Arduino core compilation for C++ file :
Code: [Select]
command:C:\ARM\arduino-1.5.1r2\hardware\tools\g++_arm_none_eabi\bin\arm-none-eabi-g++
-c -g -Os -w
-ffunction-sections
-fdata-sections
-nostdlib
--param max-inline-insns-single=500
-fno-rtti
-fno-exceptions
-Dprintf=iprintf
-mcpu=cortex-m3
-DF_CPU=84000000L
-DARDUINO=151
-D__SAM3X8E__
-mthumb
-DUSB_PID=0x003e                                                                             
-DUSB_VID=0x2341
-DUSBCON
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\system/libsam
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\system/CMSIS/CMSIS/Include/
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\system/CMSIS/Device/ATMEL/
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\cores\arduino
-IC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\variants\arduino_due_x
C:\ARM\arduino-1.5.1r2\hardware\arduino\sam\cores\arduino\cxxabi-compat.cpp -o cxxabi-compat.cpp.o


Lib building :
Code: [Select]
command:C:\ARM\arduino-1.5.1r2\hardware\tools\g++_arm_none_eabi\bin\arm-none-eabi-ar
rcs
C:\Users\XXX\AppData\Local\Temp\build3490308093235427635.tmp/core.a
cortex_handlers.c.o


Link :
Code: [Select]
command:C:\ARM\arduino-1.5.1r2\hardware\tools\g++_arm_none_eabi\bin\arm-none-eabi-g++
-Os
-Wl,--gc-sections
-mcpu=cortex-m3
-TC:\ARM\arduino-1.5.1r2\hardware\arduino\sam\variants\arduino_due_x/linker_scripts/gcc/flash.ld
-Wl,-Map,C:\Users\XXX\AppData\Local\Temp\build3490308093235427635.tmp/Blink.cpp.map
-o C:\Users\XXX\AppData\Local\Temp\build3490308093235427635.tmp/Blink.cpp.elf
-LC:\Users\XXX\AppData\Local\Temp\build3490308093235427635.tmp
-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
C:\Users\XXX\AppData\Local\Temp\build3490308093235427635.tmp/syscalls_sam3.c.o
Blink.cpp.o
C:\ARM\arduino-1.5.1r2\hardware\arduino\sam\variants\arduino_due_x/libsam_sam3x8e_gcc_rel.a
C:\Users\XXX\AppData\Local\Temp\build3490308093235427635.tmp/core.a -Wl,--end-group


Binary file :
Code: [Select]
command:C:\ARM\arduino-1.5.1r2\hardware\tools\g++_arm_none_eabi\bin\arm-none-eabi-objcopy
-O binary
C:\Users\XXX\AppData\Local\Temp\build3490308093235427635.tmp/Blink.cpp.elf
C:\Users\XXX\AppData\Local\Temp\build3490308093235427635.tmp/Blink.cpp.bin


This is a command line used by ArduinoDue IDE.

Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: zad80 on Jan 09, 2013, 11:46 pm
Next challenge is integrating additional libraries like Servo and company.
Cheers
   Zad
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: zad80 on Jan 10, 2013, 11:31 am

Hi Zad,

What file .h .c .cpp the ARDUINO define is it used, I don't found it ?

I resolved my Bossac problem last night in this topic : http://arduino.cc/forum/index.php/topic,141628.0.html (http://arduino.cc/forum/index.php/topic,141628.0.html)

I used the terminal to erase the memory of the MCU :
- I open the terminal from eclipse.
- I close the terminal from eslipse.
- I launch the Bossac command line from eclipse.

The software upload running...

Thanks very much Zad.

Nassa.



About the bossac problem , It seems that in the Arduino due main page, the figure displaying the arduino shows a wrong indication of the native port.
I've tried to open and close the programming port, the one  near the power jack , using the Target Terminal plugin without be able to run the bossac. it works instead when the serial port is opened and closed  at a rate of 1200, which shall be the behavior of the native port http://arduino.cc/en/Guide/ArduinoDue  .


BTW to upload the arduinoDue without have to press the erase button I've made a little java program wich uses RXTX library. This because I don't know how automatically use the "Target Terminal Management" plugin in eclipse, if someone knows how to open and close a serial connection in eclipse using external tool configuration please let me know.
So using this little program which open the serial at 1200 , I've created a run configuration, with two external tool configurations:

First download the file in attach
and expand it inside the AduinoDueLibrary
A new directory called tools is expanded.

Create a new external tool : Run->External Tool -> External tool configurations...
Create a new program and name it as you wish , mine is ArduinoDue_eraseViaSerial
Then in Location: /usr/bin/java   (Put your specific path to java)
in Working directory : the path to the expanded zip : ${workspace_loc:/ArduinoDueLib/tools/}
in Args:
Code: [Select]

-jar
${workspace_loc:/ArduinoDueLib/tools/openSerial_fat.jar}
usbmodemfd121

In place of usbmodemfd121 the specific name of the arduino port shall be used.

in the Build tab uncheck "Build before launch"
then Save.

in Eclipse menu : Run -> Run Configurations
Create a new launch groups and  choose a name , I used Arduino_upload.
In the Launches tab press add and select Program->"NameYouGaveToTheReaseProcedure" and as Post Launch action select "wait until terminated"
Then add the other Program , which is the one that uses bossac.
In Common Tab is possible to show the run configuration in the preferite, I have checked it.

Save it .
It shall appear on the eclipse play icon , pushing the down arrow near it.

The java program has been tested in a OSX 1.6.0 intel 64 bit, let me know if it works also in windows, in the zip are contained dll for win32 bit , libraries and dll has been downloaded from her
http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins/
Unfortunately aren't provided 64 bit dll library , you can search them on the net if you need.
Cheers
   Zad
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: zad80 on Jan 10, 2013, 05:27 pm

Next challenge is integrating additional libraries like Servo and company.
Cheers
   Zad

Library Used successfully , just import from filesystem , choose the library you want to import and check the "create top level directory" just to keep the project clean.
Add the new directory inside the include
"${workspace_loc:/${ProjName}/uOLED}"
and compile.

I've try the uOLED library and here the result in attach.

Ok the image quality isn't so good, I'm sorry.

  Cheers
    Zad

Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Jan 10, 2013, 09:26 pm
Hi Zad,

It is not necessary to use a JAVA program to request the flash erasing.

Here's a batch for Windows to send erase flash request and upload program :
Code: [Select]
@mode com5:1200,n,8,1
@sleep 1
@C:\arduino-1.5.1r2\hardware\tools\bossac.exe %*


Copy this MS-DOS program in the "upload.bat" file and replace bossac.exe by upload.bat in your Eclipse External Tools.
(Here, it is the com5 is used, change the value and the bossac path if necessary)

You can find the equivalent for OSX / Linux.

Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Jan 10, 2013, 10:18 pm

Oops : you can use this simplified command line :
Code: [Select]
@mode com5:1200
@sleep 1
@C:\arduino-1.5.1r2\hardware\tools\bossac.exe %*


Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Nassarane on Jan 10, 2013, 10:43 pm

Not necessary to set your com port with this script :

Code: [Select]
@mode %2:1200
@sleep 1
@C:\arduino-1.5.1r2\hardware\tools\bossac.exe %*


Nassa.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: bonfire on May 17, 2013, 12:46 am
Well, first sorry to bump this post but since my problem came using the guide posted here, I think this is the best choice.

I've followed the guide on OSX tweaking all the differences between the original Windows config to mine, and I got Eclipse to successfully build the library and the Blink project. I also followed a tip from Zad to generate a .bin file although it didn't solve my problem.
The thing is that despite the file is compiled (I think) correctly, and flashed without errors to the DUE, it doesn't work. The .hex file is 126kb and the .bin is 45kb. Any idea what can be wrong or any way I can debug it?

Anyway, thank you Nassarane for the guide, it's the only one I've found around and it's pretty straight forward.


And now my two cents:

One of the differences I encountered between Windows and OSX was the external tools part. The first tweak to Nassa's code is to change the way arguments are passed to Bossac inside the script. The unix command is $@ in stead of %*.
Then, the main change is how to erase the flash memory. If you run $ stty -f /dev/tty.usbmodemxxx 1200 from terminal it works perfectly, but it doesn't work from a script. To make it work this way you have to tweak ".Profile" file and I didn't feel like changing system files. So I came up with another solution, using a very simple Python script. You need to install Pyserial library to get it to work.

So now I have two script files: arduinoDueFlash.sh in bash, and eraseDueFlash.py in python. Here's the code:
arduinoDueFlash.sh
Code: [Select]
#!/bin/sh

python /Path/to/eraseDueFlash.py

sleep 1

/Path/to/bossac $@


eraseDueFlash.py
Code: [Select]
import serial

s = serial.Serial(port='/dev/tty.usbmodemXXX', baudrate=1200)
s.close()


It may also work a solution like Nassa's using the very argument to set the port and not to hardcode it. I'll try it eventually.

You must also check the path in the arguments you put in Eclipse:
--port=tty.usbmodem411 -U false -e -w -v -b ${workspace_loc}${project_path}/Release/${project_name}.bin -R

This works for OSX, I guess it works as well on any linux but I don't know if there's a simpler solution to open the port.

Cheers
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: renjith_rohin on Jun 12, 2013, 07:39 am
Thanks for the good work Nassa & Zad,.
I am new to this and I followed your notes to start my work with my Arduino Due in Ubuntu 12.04,,I could build the ArduinoDueCoreLibrary with some warnings.I could build the ## ArduinoDue Blink example without errors ( I guess this [\code] at the end of the command line pattern came by mistake${COMMAND} ${FLAGS} ${OUTPUT_FLAG}  ${OUTPUT_PREFIX}${OUTPUT} -Wl,--start-group ${INPUTS} -Wl,--end-group[\code]. I tried with that command line pattern, got some errors and then I removed[\code] and now it is building without errors., ) and without problems I can load the .hex to the board, but the LED is not blinking.What can be the problem?Please help me to solve this.I am waiting for your reply.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: renjith_rohin on Jun 13, 2013, 04:15 am
What should be the size for ArduinoDueCoreLibrary?? I am getting a lib.a file with 141.6kb size.
I can build the ArduinoDueCoreLibrary without errors,5 warnings.But after that if i try to open some files say Arduino.h it is giving semantic errors like Type 'uint32_t' could not be resolved.I did something wrong???? Please help, I am struggling with this..
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: noblepepper on Aug 31, 2013, 03:19 pm
I just noticed your questions did you ever get things straightened out?

I have eclipse working great on Ubuntu 13.04, I'll be glad to help if you still need any.

My libarduinoDueCore.a is 115,096  bytes.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: bonfire on Dec 22, 2013, 06:19 pm
Nope, still not working. I've been using a Teensy3 on Eclipse with Nassarane's guide on PJRC forums, very similar to this one.

This time I followed exactly step by step Zad's guide, as I am also using OSX, with the same result as before.
My libArduinoDuoCore.a is 121.846 bytes (pretty similar to yours) and the Blink.bin 42.340 bytes.
It compiles well, flashes it as Arduino IDE would do, but the LED is not flashing. I don't know what else to try.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: noblepepper on Dec 22, 2013, 07:13 pm
I started a web tutorial that never got finished, then didn't update it to reflect the new library format. I'll try to get it completed and post a link in the next few days.

If I remember correctly when mine looked like it was good but the sketch didn't run there were some undefined symbols in the linking stage that eclipse didn't flag as errors, I found them in the console output.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: bonfire on Jan 10, 2014, 12:39 am
I definitely have to subscribe to this thread :P

Here's the console output for the library:
Code: [Select]
00:27:34 **** Incremental Build of configuration Debug for project ArduinoDueLib ****
make all
Building file: ../variants/arduino_due_x/variant.cpp
Invoking: ARM Sourcery Mac OS X GCC C++ Compiler
arm-none-eabi-g++ -Dprintf=iprintf -DF_CPU=84000000L -DARDUINO=151 -D__SAM3X8E__ -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/ -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib/USB" -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib" -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib/variants/arduino_due_x" -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/ -Os -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="variants/arduino_due_x/variant.o.lst" -fno-exceptions -fno-rtti -c --param max-inline-insns-single=500 -nostdlib -MMD -MP -MF"variants/arduino_due_x/variant.d" -MT"variants/arduino_due_x/variant.d" -mcpu=cortex-m3 -mthumb -o "variants/arduino_due_x/variant.o" "../variants/arduino_due_x/variant.cpp"
../variants/arduino_due_x/variant.cpp: In function 'void init()':
../variants/arduino_due_x/variant.cpp:383: warning: comparison between signed and unsigned integer expressions
Finished building: ../variants/arduino_due_x/variant.cpp

Building file: ../avr/dtostrf.c
Invoking: ARM Sourcery Mac OS X GCC C Compiler
arm-none-eabi-gcc -Dprintf=iprintf -DF_CPU=84000000L -DARDUINO=151 -D__SAM3X8E__ -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/ -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib/USB" -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib" -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib/variants/arduino_due_x" -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/ -Os -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="avr/dtostrf.o.lst" -c --param max-inline-insns-single=500 -nostdlib -MMD -MP -MF"avr/dtostrf.d" -MT"avr/dtostrf.d" -mcpu=cortex-m3 -mthumb -o "avr/dtostrf.o" "../avr/dtostrf.c"
../avr/dtostrf.c: In function 'dtostrf':
../avr/dtostrf.c:23: warning: implicit declaration of function 'sprintf'
../avr/dtostrf.c:23: warning: incompatible implicit declaration of built-in function 'sprintf'
In file included from ../IPAddress.cpp:3:
/Users/X/Documents/arduino-workspace/ArduinoDueLib/IPAddress.h: In member function 'IPAddress::operator uint32_t()':
/Users/X/Documents/arduino-workspace/ArduinoDueLib/IPAddress.h:51: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/X/Documents/arduino-workspace/ArduinoDueLib/IPAddress.h: In member function 'bool IPAddress::operator==(const IPAddress&)':
/Users/X/Documents/arduino-workspace/ArduinoDueLib/IPAddress.h:52: warning: dereferencing type-punned pointer will break strict-aliasing rules
/Users/X/Documents/arduino-workspace/ArduinoDueLib/IPAddress.h:52: warning: dereferencing type-punned pointer will break strict-aliasing rules
Finished building: ../avr/dtostrf.c

Building file: ../main.cpp
Invoking: ARM Sourcery Mac OS X GCC C++ Compiler
arm-none-eabi-g++ -Dprintf=iprintf -DF_CPU=84000000L -DARDUINO=151 -D__SAM3X8E__ -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/ -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib/USB" -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib" -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib/variants/arduino_due_x" -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/ -Os -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="main.o.lst" -fno-exceptions -fno-rtti -c --param max-inline-insns-single=500 -nostdlib -MMD -MP -MF"main.d" -MT"main.d" -mcpu=cortex-m3 -mthumb -o "main.o" "../main.cpp"
Finished building: ../main.cpp

Building file: ../wiring_shift.c
Invoking: ARM Sourcery Mac OS X GCC C Compiler
arm-none-eabi-gcc -Dprintf=iprintf -DF_CPU=84000000L -DARDUINO=151 -D__SAM3X8E__ -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/ -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib/USB" -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib" -I"/Users/X/Documents/arduino-workspace/ArduinoDueLib/variants/arduino_due_x" -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -I/Applications/Arduino-due.app/Contents/Resources/Java/hardware/arduino/sam/system/libsam/ -Os -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="wiring_shift.o.lst" -c --param max-inline-insns-single=500 -nostdlib -MMD -MP -MF"wiring_shift.d" -MT"wiring_shift.d" -mcpu=cortex-m3 -mthumb -o "wiring_shift.o" "../wiring_shift.c"
Finished building: ../wiring_shift.c

Building target: libArduinoDueLib.a
Invoking: ARM Sourcery Mac OS X GCC Archiver
arm-none-eabi-ar -r  "libArduinoDueLib.a"  ./variants/arduino_due_x/variant.o  ./avr/dtostrf.o  ./USB/CDC.o ./USB/HID.o ./USB/USBCore.o  ./IPAddress.o ./Print.o ./Reset.o ./RingBuffer.o ./Stream.o ./UARTClass.o ./USARTClass.o ./WInterrupts.o ./WMath.o ./WString.o ./cortex_handlers.o ./cxxabi-compat.o ./hooks.o ./iar_calls_sam3.o ./itoa.o ./main.o ./syscalls_sam3.o ./wiring.o ./wiring_analog.o ./wiring_digital.o ./wiring_pulse.o ./wiring_shift.o  
Finished building target: libArduinoDueLib.a


00:28:05 Build Finished (took 31s.474ms)


I had to delete some stuff to meet the max characters limitation on the post
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: bonfire on Jan 10, 2014, 12:39 am
And here's console output for the published Blink.cpp:
Code: [Select]
00:39:07 **** Incremental Build of configuration Debug for project ArduinoTemplate ****
make all
Building target: ArduinoTemplate.elf
Invoking: ARM Sourcery Mac OS X GCC C++ Linker
arm-none-eabi-g++ -L"/Users/victor/Documents/arduino-workspace/ArduinoDueLib/Debug" -L"/Users/victor/Documents/arduino-workspace/ArduinoDueLib/variants/arduino_due_x" -Wl,-Map,ArduinoTemplate.map -lm -lgcc  -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 -mcpu=cortex-m3 -mthumb -o  "ArduinoTemplate.elf" -Wl,--start-group  ./Blink.o ./main.o  /Users/victor/Documents/arduino-workspace/ArduinoDueLib/Debug/syscalls_sam3.o -lArduinoDueLib -lsam_sam3x8e_gcc_rel -Wl,--end-group
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .fini by 2 bytes
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .fini by 2 bytes
Finished building target: ArduinoTemplate.elf

/Applications/Arduino-due.app/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi/bin/../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/bin/ld: warning: changing start of section .fini by 2 bytes
/Users/victor/Documents/arduino-workspace/ArduinoDueLib/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a(startup_sam3xa.o): In function `Reset_Handler':
startup_sam3xa.c:(.text.Reset_Handler+0x54): warning: undefined reference to `_srelocate'
startup_sam3xa.c:(.text.Reset_Handler+0x58): warning: undefined reference to `_szero'
/Applications/Xcode.app/Contents/Developer/usr/bin/make --no-print-directory post-build
/Applications/Arduino-due.app/Contents/Resources/Java/hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-objcopy -O binary ArduinoTemplate.elf ArduinoTemplate.bin

Invoking: ARM Sourcery Mac OS X GNU Create Flash Image
arm-none-eabi-objcopy -O ihex ArduinoTemplate.elf  "ArduinoTemplate.hex"
Finished building: ArduinoTemplate.hex

Invoking: ARM Sourcery Mac OS X GNU Create Listing
arm-none-eabi-objdump -h -S ArduinoTemplate.elf > "ArduinoTemplate.lst"
Finished building: ArduinoTemplate.lst
startup_sam3xa.c:(.text.Reset_Handler+0x5c): warning: undefined reference to `_erelocate'
startup_sam3xa.c:(.text.Reset_Handler+0x60): warning: undefined reference to `_ezero'

Invoking: ARM Sourcery Mac OS X GNU Print Size
arm-none-eabi-size  --format=berkeley ArduinoTemplate.elf
  text   data    bss    dec    hex filename
  4078     16    424   4518   11a6 ArduinoTemplate.elf
Finished building: ArduinoTemplate.siz

startup_sam3xa.c:(.text.Reset_Handler+0x64): warning: undefined reference to `_sfixed'

00:39:08 Build Finished (took 942ms)


Aand it's not working. I don't see anything weird except for some Warnings and the fact that something inside Eclipse is using XCode's make, but I don't know if this is usual or not
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: noblepepper on Jan 10, 2014, 10:39 pm
The lines in your output that show this are the undefined symbols I was talking about.
Code: [Select]
startup_sam3xa.c:(.text.Reset_Handler+0x5c): warning: undefined reference to `_erelocate'
startup_sam3xa.c:(.text.Reset_Handler+0x60): warning: undefined reference to `_ezero'

These should be marked as errors but they aren't I'm sure it is related to some of the options in the linking command but as long as my set up works I'm not going to spend much effort to find it.

In any case, you are missing the linker script, for me it is:
Code: [Select]
${workspace_loc:}/arduinosource/hardware/arduino/sam/variants/arduino_due_x/linker_scripts/gcc/flash.ld
This is in the box at the top of the dialog under Properties->C/C++ Build->Settings->ARM Sourcery Linux GCC C++ Linker->General

Your link process should look like:
Code: [Select]
Building target: blink.elf
Invoking: ARM Sourcery Linux GCC C++ Linker
arm-none-eabi-g++ -T"workspace/arduinosource/hardware/arduino/sam/variants/arduino_due_x/linker_scripts/gcc/flash.ld" -L"workspace/arduinoDueCore/Release" -L"arduinoDueCore/arduino_due_x" -Wl,-Map,blink.map -lm -lgcc  -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 -mcpu=cortex-m3 -mthumb -o  "blink.elf" -Wl,--start-group  ./src/Blink.o  workspace/arduinoDueCore/Release/syscalls_sam3.o -larduinoDueCore -lsam_sam3x8e_gcc_rel -Wl,--end-group
Finished building target: blink.elf

make --no-print-directory post-build
workspace/arduinosource/hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-objcopy -O binary blink.elf blink.bin

Invoking: ARM Sourcery Linux GNU Create Flash Image
arm-none-eabi-objcopy -O ihex blink.elf  "blink.hex"
Finished building: blink.hex

Invoking: ARM Sourcery Linux GNU Create Listing
arm-none-eabi-objdump -h -S blink.elf > "blink.lst"
Finished building: blink.lst


Of course your paths will be different, but the only thing I see missing is the -T ...linker_scripts/gcc/flash.ld

If you still don't get a blinking led, do a make clean before you make debug. You have the default debug and release make targets, I use only release which is also changing the paths a bit, shouldn't make any difference though.
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: bonfire on Jan 11, 2014, 12:27 am
Thank you very much! that finally solved the problem  :D  I don't know why I forgot that, but I finally can focus on coding

Cheers
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: SwissJavaKnife on Feb 09, 2014, 05:10 am
My program also compiles and downloads "successfully", but it does not run, meaning the LED does not blink. I do not have the undefined reference warnings though.

Here is some information about my development environment:
32 bit eclipse juno cdt
arduino 1.5.1r2 beta
windows 8 64bit

My compile output is too big for this post, I will break it up in the posts below.

Any help would be greatly appreciated.

Program:
Code: [Select]

#include "Arduino.h"

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;


// the setup routine runs once when you press reset:
void setup() {
 // initialize the digital pin as an output.
 pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
 digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(1000);               // wait for a second
 digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
 delay(1000);               // wait for a second
}


Download Output:
Code: [Select]

Status for device COM5:
-----------------------
   Baud:            1200
   Parity:          None
   Data Bits:       8
   Stop Bits:       1
   Timeout:         ON
   XON/XOFF:        OFF
   CTS handshaking: OFF
   DSR handshaking: OFF
   DSR sensitivity: OFF
   DTR circuit:     ON
   RTS circuit:     ON

     1 [main] sleep 7652 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Erase flash
Write 27477 bytes to flash

[                              ] 0% (0/108 pages)
[==                            ] 9% (10/108 pages)
[=====                         ] 18% (20/108 pages)
[========                      ] 27% (30/108 pages)
[===========                   ] 37% (40/108 pages)
[=============                 ] 46% (50/108 pages)
[================              ] 55% (60/108 pages)
[===================           ] 64% (70/108 pages)
[======================        ] 74% (80/108 pages)
[=========================     ] 83% (90/108 pages)
[===========================   ] 92% (100/108 pages)
[==============================] 100% (108/108 pages)
Verify 27477 bytes of flash

[                              ] 0% (0/108 pages)
[==                            ] 9% (10/108 pages)
[=====                         ] 18% (20/108 pages)
[========                      ] 27% (30/108 pages)
[===========                   ] 37% (40/108 pages)
[=============                 ] 46% (50/108 pages)
[================              ] 55% (60/108 pages)
[===================           ] 64% (70/108 pages)
[======================        ] 74% (80/108 pages)
[=========================     ] 83% (90/108 pages)
[===========================   ] 92% (100/108 pages)
[==============================] 100% (108/108 pages)
Verify successful
Set boot flash true
CPU reset.


-Madison
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: SwissJavaKnife on Feb 09, 2014, 05:13 am
Here is the first part of my compile output:
Code: [Select]

22:00:54 **** Build of configuration Debug for project ArduinoDueBlinkExample ****
cs-make all
      1 [main] echo 9464 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Building file: ../blink.cpp
the public mailing list cygwin@cygwin.com
      0 [main] echo 7448 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Invoking: ARM Sourcery Windows GCC C++ Compiler
arm-none-eabi-g++ -Dprintf=iprintf -DF_CPU=84000000L -DARDUINO=151 -D__SAM3X8E__ -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON -I"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\variants\arduino_due_x" -I"D:\EclipsePortable\Data\workspace\ArduinoDueBlinkExample" -I"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\USB" -I"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary" -ID:/arduino-1.5.1r2/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -ID:/arduino-1.5.1r2/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -ID:/arduino-1.5.1r2/hardware/arduino/sam/system/libsam/ -Os -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="blink.o.lst" -fno-exceptions -fno-rtti -c -fmessage-length=0 --param max-inline-insns-single=500 -nostdlib -MMD -MP -MF"blink.d" -MT"blink.d" -mcpu=cortex-m3 -mthumb -o "blink.o" "../blink.cpp"
      1 [main] sh 908 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Finished building: ../blink.cpp

Building target: ArduinoDueBlinkExample.elf
the public mailing list cygwin@cygwin.com
      1 [main] echo 2316 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Invoking: ARM Sourcery Windows GCC C++ Linker
the public mailing list cygwin@cygwin.com
arm-none-eabi-g++ -T"D:\arduino-1.5.1r2\hardware\arduino\sam\variants\arduino_due_x\linker_scripts\gcc\flash.ld" -L"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\variants\arduino_due_x" -L"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\Release" -Wl,-Map,ArduinoDueBlinkExample.map -lm -lgcc  -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 -mcpu=cortex-m3 -mthumb -o  "ArduinoDueBlinkExample.elf" -Wl,--start-group  ./blink.o  D:/EclipsePortable/Data/workspace/ArduinoDueCoreLibrary/Release/syscalls_sam3.o -lArduinoDueCoreLibrary -lsam_sam3x8e_gcc_rel -Wl,--end-group
      0 [main] echo 9024 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Finished building target: ArduinoDueBlinkExample.elf

D:/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/cs-make.exe --no-print-directory post-build
D:\arduino-1.5.1r2\hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-objcopy -O binary ArduinoDueBlinkExample.elf ArduinoDueBlinkExample.bin
the public mailing list cygwin@cygwin.com
      0 [main] echo 9576 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      0 [main] echo 1028 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] sh 9768 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to

the public mailing list cygwin@cygwin.com
      1 [main] echo 1388 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      0 [main] echo 7028 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Invoking: ARM Sourcery Windows GNU Create Flash Image
the public mailing list cygwin@cygwin.com
      0 [main] echo 10060 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
arm-none-eabi-objcopy -O ihex ArduinoDueBlinkExample.elf  "ArduinoDueBlinkExample.hex"
the public mailing list cygwin@cygwin.com
      1 [main] echo 8812 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] sh 5032 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      0 [main] echo 6900 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Finished building: ArduinoDueBlinkExample.hex
      1 [main] echo 5672 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to

the public mailing list cygwin@cygwin.com
      1 [main] echo 7340 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Invoking: ARM Sourcery Windows GNU Create Listing
the public mailing list cygwin@cygwin.com
arm-none-eabi-objdump -h -S ArduinoDueBlinkExample.elf > "ArduinoDueBlinkExample.lst"
      1 [main] sh 9488 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      0 [main] echo 9256 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Finished building: ArduinoDueBlinkExample.lst
      1 [main] echo 6908 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com

      1 [main] echo 8004 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Invoking: ARM Sourcery Windows GNU Print Size
arm-none-eabi-size  --format=berkeley -t ArduinoDueBlinkExample.elf
   text    data     bss     dec     hex filename
   5364       0     504    5868    16ec ArduinoDueBlinkExample.elf
   5364       0     504    5868    16ec (TOTALS)
      1 [main] echo 3672 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Finished building: ArduinoDueBlinkExample.siz
      1 [main] echo 36 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to

the public mailing list cygwin@cygwin.com

22:00:55 Build Finished (took 1s.353ms)


-Madison
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: SwissJavaKnife on Feb 09, 2014, 05:14 am
2nd part:
Code: [Select]

22:01:01 **** Incremental Build of configuration Debug for project ArduinoDueBlinkExample ****
cs-make all
      0 [main] echo 7396 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Invoking: ARM Sourcery Windows GNU Print Size
the public mailing list cygwin@cygwin.com
arm-none-eabi-size  --format=berkeley -t ArduinoDueBlinkExample.elf
   text    data     bss     dec     hex filename
   5364       0     504    5868    16ec ArduinoDueBlinkExample.elf
   5364       0     504    5868    16ec (TOTALS)
      1 [main] echo 10204 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Finished building: ArduinoDueBlinkExample.siz
the public mailing list cygwin@cygwin.com
      1 [main] echo 7604 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com


22:01:02 Build Finished (took 202ms)

22:01:02 **** Incremental Build of configuration Release for project ArduinoDueCoreLibrary ****
cs-make all
cs-make: Nothing to be done for `all'.

22:01:03 Build Finished (took 229ms)

22:04:29 **** Incremental Build of configuration Debug for project ArduinoDueBlinkExample ****
cs-make all
      0 [main] echo 7708 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Building file: ../blink.cpp
the public mailing list cygwin@cygwin.com
      0 [main] echo 8508 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Invoking: ARM Sourcery Windows GCC C++ Compiler
arm-none-eabi-g++ -Dprintf=iprintf -DF_CPU=84000000L -DARDUINO=151 -D__SAM3X8E__ -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON -I"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\variants\arduino_due_x" -I"D:\EclipsePortable\Data\workspace\ArduinoDueBlinkExample" -I"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\USB" -I"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary" -ID:/arduino-1.5.1r2/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -ID:/arduino-1.5.1r2/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -ID:/arduino-1.5.1r2/hardware/arduino/sam/system/libsam/ -Os -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="blink.o.lst" -fno-exceptions -fno-rtti -c -fmessage-length=0 --param max-inline-insns-single=500 -nostdlib -MMD -MP -MF"blink.d" -MT"blink.d" -mcpu=cortex-m3 -mthumb -o "blink.o" "../blink.cpp"
      1 [main] sh 5464 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Finished building: ../blink.cpp

the public mailing list cygwin@cygwin.com
Building target: ArduinoDueBlinkExample.elf
      1 [main] echo 6260 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Invoking: ARM Sourcery Windows GCC C++ Linker
the public mailing list cygwin@cygwin.com
      1 [main] echo 2844 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] echo 6932 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] echo 5392 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
arm-none-eabi-g++ -T"D:\arduino-1.5.1r2\hardware\arduino\sam\variants\arduino_due_x\linker_scripts\gcc\flash.ld" -L"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\variants\arduino_due_x" -L"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\Release" -Wl,-Map,ArduinoDueBlinkExample.map -lm -lgcc  -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 -mcpu=cortex-m3 -mthumb -o  "ArduinoDueBlinkExample.elf" -Wl,--start-group  ./blink.o  D:/EclipsePortable/Data/workspace/ArduinoDueCoreLibrary/Release/syscalls_sam3.o -lArduinoDueCoreLibrary -lsam_sam3x8e_gcc_rel -Wl,--end-group
the public mailing list cygwin@cygwin.com
Finished building target: ArduinoDueBlinkExample.elf

D:/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/cs-make.exe --no-print-directory post-build
D:\arduino-1.5.1r2\hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-objcopy -O binary ArduinoDueBlinkExample.elf ArduinoDueBlinkExample.bin
      2 [main] sh 5512 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to

the public mailing list cygwin@cygwin.com
Invoking: ARM Sourcery Windows GNU Create Flash Image
      1 [main] echo 8016 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
arm-none-eabi-objcopy -O ihex ArduinoDueBlinkExample.elf  "ArduinoDueBlinkExample.hex"
the public mailing list cygwin@cygwin.com
      1 [main] echo 6072 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] echo 6516 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] echo 5100 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] sh 5836 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Finished building: ArduinoDueBlinkExample.hex
the public mailing list cygwin@cygwin.com
      1 [main] echo 9044 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to

the public mailing list cygwin@cygwin.com
      1 [main] echo 6272 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] echo 4924 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Invoking: ARM Sourcery Windows GNU Create Listing
the public mailing list cygwin@cygwin.com
arm-none-eabi-objdump -h -S ArduinoDueBlinkExample.elf > "ArduinoDueBlinkExample.lst"
      1 [main] sh 8880 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      0 [main] echo 4144 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Finished building: ArduinoDueBlinkExample.lst


-Madison
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: SwissJavaKnife on Feb 09, 2014, 05:15 am
3rd part:
Code: [Select]

1 [main] echo 8680 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com

      1 [main] echo 8760 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Invoking: ARM Sourcery Windows GNU Print Size
arm-none-eabi-size  --format=berkeley -t ArduinoDueBlinkExample.elf
   text    data     bss     dec     hex filename
   9748       0    1184   10932    2ab4 ArduinoDueBlinkExample.elf
   9748       0    1184   10932    2ab4 (TOTALS)
      1 [main] echo 3788 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Finished building: ArduinoDueBlinkExample.siz
the public mailing list cygwin@cygwin.com
      1 [main] echo 6764 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com


22:04:30 Build Finished (took 1s.385ms)

22:04:31 **** Incremental Build of configuration Release for project ArduinoDueCoreLibrary ****
cs-make all
cs-make: Nothing to be done for `all'.

22:04:31 Build Finished (took 231ms)

22:09:18 **** Incremental Build of configuration Debug for project ArduinoDueBlinkExample ****
cs-make all
      1 [main] echo 7852 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Building file: ../blink.cpp
the public mailing list cygwin@cygwin.com
      1 [main] echo 8140 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Invoking: ARM Sourcery Windows GCC C++ Compiler
the public mailing list cygwin@cygwin.com
arm-none-eabi-g++ -Dprintf=iprintf -DF_CPU=84000000L -DARDUINO=151 -D__SAM3X8E__ -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON -I"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\variants\arduino_due_x" -I"D:\EclipsePortable\Data\workspace\ArduinoDueBlinkExample" -I"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\USB" -I"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary" -ID:/arduino-1.5.1r2/hardware/arduino/sam/system/CMSIS/CMSIS/Include/ -ID:/arduino-1.5.1r2/hardware/arduino/sam/system/CMSIS/Device/ATMEL/ -ID:/arduino-1.5.1r2/hardware/arduino/sam/system/libsam/ -Os -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="blink.o.lst" -fno-exceptions -fno-rtti -c -fmessage-length=0 --param max-inline-insns-single=500 -nostdlib -MMD -MP -MF"blink.d" -MT"blink.d" -mcpu=cortex-m3 -mthumb -o "blink.o" "../blink.cpp"
      0 [main] sh 4408 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Finished building: ../blink.cpp

Building target: ArduinoDueBlinkExample.elf
the public mailing list cygwin@cygwin.com
      0 [main] echo 9000 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Invoking: ARM Sourcery Windows GCC C++ Linker
the public mailing list cygwin@cygwin.com
      1 [main] echo 4008 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] echo 156 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
arm-none-eabi-g++ -T"D:\arduino-1.5.1r2\hardware\arduino\sam\variants\arduino_due_x\linker_scripts\gcc\flash.ld" -L"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\variants\arduino_due_x" -L"D:\EclipsePortable\Data\workspace\ArduinoDueCoreLibrary\Release" -Wl,-Map,ArduinoDueBlinkExample.map -lm -lgcc  -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 -mcpu=cortex-m3 -mthumb -o  "ArduinoDueBlinkExample.elf" -Wl,--start-group  ./blink.o  D:/EclipsePortable/Data/workspace/ArduinoDueCoreLibrary/Release/syscalls_sam3.o -lArduinoDueCoreLibrary -lsam_sam3x8e_gcc_rel -Wl,--end-group
the public mailing list cygwin@cygwin.com
      1 [main] echo 9500 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Finished building target: ArduinoDueBlinkExample.elf

D:/arduino-1.5.1r2/hardware/tools/g++_arm_none_eabi/bin/cs-make.exe --no-print-directory post-build
D:\arduino-1.5.1r2\hardware/tools/g++_arm_none_eabi/bin/arm-none-eabi-objcopy -O binary ArduinoDueBlinkExample.elf ArduinoDueBlinkExample.bin
      1 [main] sh 8568 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to

the public mailing list cygwin@cygwin.com
      1 [main] echo 4332 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Invoking: ARM Sourcery Windows GNU Create Flash Image
the public mailing list cygwin@cygwin.com
      1 [main] echo 3712 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      0 [main] echo 2124 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
arm-none-eabi-objcopy -O ihex ArduinoDueBlinkExample.elf  "ArduinoDueBlinkExample.hex"
      1 [main] echo 8144 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] sh 4164 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Finished building: ArduinoDueBlinkExample.hex
the public mailing list cygwin@cygwin.com
      1 [main] echo 9512 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] echo 4196 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to

the public mailing list cygwin@cygwin.com
      0 [main] echo 5796 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
Invoking: ARM Sourcery Windows GNU Create Listing
the public mailing list cygwin@cygwin.com
arm-none-eabi-objdump -h -S ArduinoDueBlinkExample.elf > "ArduinoDueBlinkExample.lst"
      1 [main] sh 7412 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] echo 2116 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Finished building: ArduinoDueBlinkExample.lst
      1 [main] echo 9972 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to

the public mailing list cygwin@cygwin.com
      0 [main] echo 4368 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Invoking: ARM Sourcery Windows GNU Print Size
arm-none-eabi-size  --format=berkeley -t ArduinoDueBlinkExample.elf
   text    data     bss     dec     hex filename
   9748       0    1184   10932    2ab4 ArduinoDueBlinkExample.elf
   9748       0    1184   10932    2ab4 (TOTALS)
      0 [main] echo 6704 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com
Finished building: ArduinoDueBlinkExample.siz
      1 [main] echo 1936 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to
the public mailing list cygwin@cygwin.com


22:09:19 Build Finished (took 1s.408ms)

22:09:20 **** Incremental Build of configuration Release for project ArduinoDueCoreLibrary ****
cs-make all
cs-make: Nothing to be done for `all'.

22:09:20 Build Finished (took 230ms)


-Madison
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: ubgen on Mar 24, 2014, 01:14 pm
Hello, I am trying to tailor eclipse for Due on ArchLinux, but I cannot download RXTX because I cannot reach the address site "rxtx.qbang.org/eclipse/", which seems out of work. Can anyone help me?

Another issue: I have Arch64 installed, so I could run only the 64-bit version of eclips, is there a workaround that could make me run eclipse 32 on my 64-bit OS?

Finally, last question: do I have to use eclipse Juno SR1 downloadint it from the url or can I install eclipse 4.3.2 from my repo?
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Sondre on Apr 19, 2014, 01:16 am
I have followed your guides above, and successfully compiled it. That was, however, using Arduino 1.5.1. I have now set it up with the latest (Arduino 1.5.6-r2) library. It compiles and uploads fine but it doesn't run. The code doesn't execute. After uploading, it is not possible to open a serial connection to the port (Ubuntu Linux).

Has anybody else got this issue? Has anyone even got it working with Arduino 1.5.6-r2?
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: ArtificialDemon on May 14, 2014, 10:28 pm
Any news on using Arduino 1.5.6-r2?

I'm running Linux Mint and am very interested in using Eclipse to create projects. It seems very cumbersome to do it...
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: msteam on May 25, 2014, 08:01 pm
Hi,

as i had the same issue regarding 1.5.6-r2 not working within eclipse build environment, i felt like having to dig deeper into it.
I used my Segger JLink + free WinIDEA debugging environment from iSystem to see whats going wrong there.

It was pretty obvious whats going wrong there -> it hung in Default_Handler function after entering main and polling a few times for the next SysTick gettin passed.

By comparing the differences in the baselines 1.5.1 vs. 1.5.6 i found the following relevant commit:
https://github.com/arduino/Arduino/commit/65f00a69c74ca0def8d7f1d7597327945a04a33f
which seems to address already a weak symbol definition problem.

Unfortunately this fixture rendered the build in eclipse useless. IMHO it seems like the eclipse build env. does building + linking in another 'order' as it is done by arduino ide.

There are two times weak symbol declarations ( or in case of i.e. the SysTick_Handler even function definitions ) which appear overwriting each others weak alias depending on the link time usage of the objects. So it happens that all declarations (not only the failing SysTick_Hanlder) from cortex_handler.c gettin overwritten by weak symbol redeclaration inside startup_sam3xa.c.

My dirty solution is to just comment out the part in startup_sam3xa.c with the weak symbol declaration regarding the vectors (lines 53 including 128).

It worked also by removing the unchanged startup_sam3xa.c from static library archive build to the project build.
It may also be ok to just remove the files completely (startup handler code + vector map provided by gcc arm built-in libraries is used instead).
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: goranj on Jul 12, 2014, 10:48 am

Hi Ricky !

I wrote a procedure to use Eclipse with Arduino Due board.
This procedure is written for Winwdows, but you can adapt it to Linux if you want.
But the problem is that I don't now what software to use to uplaod the program in Arduino Due board ...
I can't do test because I don't have Arduino Due board.

Eclipse installation for Arduino Due on Windows

Introduction
This manual is written for Arduino Due IDE.
This manual will allow you install an Eclipse environment to edit and compile your programs but also to communicate with your Arduino Due Board with USB (serial) and a terminal.
This is not a definitive solution, but works very well.

#1. You must first download the following elements:
-   Arduino Due IDE : http://arduino.cc/en/Main/SoftwareDue
-   Elicpe IDE for C/C++ Developers Juno SR1 32 bits (64 bits is not compatible with RXTX plug-in) : http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/junosr1
-   GNU ARM Eclipse Plug-in : http://sourceforge.net/projects/gnuarmeclipse/files/Current%20Releases/0.5.4/
-   TM-terminal 3.4.1 : http://www.eclipse.org/downloads/download.php?file=/tm/downloads/drops/R-3.4.1-201209191030/TM-terminal-3.4.1.zip

#2. Installation:
-   Unzip Arduino Due IDE, for example: "C:\arduino-1.5.1r2".
-   Unzip Eclipse IDE for C/C++, for example: "C:\ArduinoDue\eclipse".
-   Add Arduino tool chain path in the Windows Path: "C:\arduino-1.5.1r2\hardware\tools\g++_arm_none_eabi\bin".

#3. Configuration:
-   Start Eclipse and install the GNU ARM Eclipse Plug-in, click on menu "Help/Install New Software…"
-   In the dialog box "Install", click on "Add" button.
-   In the "Add Repository" dialog box, click on "Archive…" button.
-   In the this dialog box, select the downloaded plug-in file : "org.eclipse.cdt.cross.arm.gnu_0.5.4.201202210114.zip"
-   In the dialog box "Install", click on "Add" button.
-   In the "Add Repository" dialog box, type "RXTX" in the "Name" field and type http://rxtx.qbang.org/eclipse/ in the "Location" field and click on the "Ok" button.
-   With Windows Explorer, create a new folder "TM" in the "C:\ArduinoDue\eclipse\dropins" folder.
-   Copy "TM-trminal-3.4.1.zip" file in the "TM" folder, and unzip this file in this folder. Restart Eclipse.



Hi,
For some reason Eclipse cannot install GNU ARM Eclipse Plug-in and TM-terminal:

GNU ARM Eclipse Plug-in
Cannot complete the install because one or more required items could not be found.
  Software being installed: GNU ARM C/C++ Generic Cortex-M Project Template 1.1.1.201407120554 (ilg.gnuarmeclipse.templates.cortexm.feature.group 1.1.1.201407120554)

TM-terminal
Could not find jar

I have Vista Business, Eclipse Juno SR1.

Any idea?
Thanks for your  help.
Regards
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: Johndue on Aug 22, 2014, 08:00 pm
Hello.
I downloaded the win64.2014-08-20_02-06-59.tar.gz from http://www.baeyens.it/eclipse/download.php and set the windows -> preferences -> Arduino IDE path to the IDE folder. When I pressed build all this came up in eclipse, how do i set the path correctly.

Quote
19:56:37 **** Incremental Build of configuration Release for project New ****
make all
Cannot run program "make": Launching failed

Error: Program "make" not found in PATH
PATH=[D:/Program Files/Arduino/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/;D:/Program Files/Arduino/hardware/tools/g++_arm_none_eabi/arm-none-eabi/bin;D:/Program Files/Arduino/hardware/tools/avr/utils/bin;C:/Program Files/Java/jre1.8.0_20/bin/server;C:/Program Files/Java/jre1.8.0_20/bin;C:/Program Files/Java/jre1.8.0_20/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\LTH\AA\eclipseArduino]

19:56:37 Build Finished (took 86ms)
Title: Re: [Q]: Tailoring the Due to Eclipse..
Post by: ansumsingh on Nov 08, 2014, 01:42 pm
Hi all,

When I try to build ArduinoDueCore library I get following error message.
Code: [Select]

Error: Program "cs-make" not found in PATH
PATH=[C:\Programs Files\Cross Build Tools\]



 Can anyone suggest me a solution?

Thanks in advance