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?
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
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
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)
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)
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:
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).
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, 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)
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.
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.
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.
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
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:
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!!
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.
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
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
'__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
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