Difference between revisions of "Setting up Development Environment"

From ATI public wiki
Jump to: navigation, search
(initial publish)
 
(Getting the Software Stack)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
Dresden Elektronik radio modules are designed to work with a special software stack developed by Dresden Elektronik and Atmel. In order to use this stack, the working environment and the toolchain need to be configured properly.
+
Dresden Elektronik radio modules are designed to work with a special software stack developed by Dresden Elektronik and Atmel. In order to use this stack, first the working environment and the toolchain need to be configured properly.
  
 
This section tries to provide some information on how to set up the environment in order to work with the modules.
 
This section tries to provide some information on how to set up the environment in order to work with the modules.
  
 
==Setting up Toolchain==
 
==Setting up Toolchain==
In order to work with the modules, two toolchains are needed - one for compiling and flashing AVR modules and one for ARM modules.
+
The Dresden Elektronik software stack uses makefile based approach for compilation of the source code. Makefiles, originating from Unix based systems, use modified Bash like syntax. Thus it is necessary for the operating system to be able to run some Unix commands. While this is not a problem in GNU/Linux, Windows needs some additional tools to be installed in order to be able to execute the commands found in the makefiles.
  
===AVR===
+
The software stack expects the GNU C cross-compiler (GCC) to be used for compilation. Since two different platforms are used (AVR and ARM), also two different cross-compiler toolchains, on for each platform, are needed to be installed on the development system.
The AVR toolchain consists of following components:
+
* '''avr-binutils:''' linker, assembler, etc for the AVR platform
+
* '''avr-gcc:''' the GNU C cross-compiler for the AVR platform
+
* '''avr-libc:''' C libraries and header files for the AVR platform
+
* '''avrdude:''' for uploading the code to the chip
+
  
====Microsoft Windows====
+
Last, but not least, some software for uploading the code to the microcontrollers is also needed.
In Windows installing of the AVR toolchain is quite easy. All that is needed is to download and install [http://winavr.sourceforge.net/download.html WinAVR] (or [http://www.atmel.com/tools/atmelstudio.aspx Atmel Studio]).
+
  
'''Note:''' Atmel stopped developing WinAVR as a separate entity in 2010 and it is now distributed as a component of the Atmel Studio package. Although the last (2010) seperate version is still available for download, it does not support the newer ATmega256RFR2 controller. For users who do not want to download and install the entire Atmel Studio package, a newer, seperate WinAVR, extracted from the Atmel Studio package is available [https://strudel.pld.ttu.ee/owncloud/public.php?service=files&t=ad6e40949ec8e6ffc63d8ab077e99f26 here].
+
The following subsections try to give some information about installing the tools necessary for working with the Dresden Elektronik radio/MCU modules.
  
 +
===Microsoft Windows===
 +
In order to work with the modules in Windows, some additional tools need to be installed. Usually, the path where they are installed, does not matter, but needs to be specified in the system path variable. Table below describes the tools, gives download links and shows the correct path that is needed to be added to the system path variable. [inst_root] means the root installation directory for the software.
 +
{| class="wikitable" style="margin: left;"
 +
| '''Tool'''
 +
| '''Link'''
 +
| '''Latest version <br> at the time of writing'''
 +
| '''System path variable'''
 +
| '''Description'''
 +
| '''Notes'''
 +
|-
 +
| Yagarto tools
 +
| [https://code.google.com/p/csud/downloads/detail?name=yagarto-tools-20121018-setup.exe&can=2&q= Download]
 +
| 20121018
 +
| [isnt_root]\bin
 +
| Make command + tools for minimal Unix-like environment
 +
| Run the installer, then manually add the path
 +
|-
 +
| AVR toolchain
 +
| [http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORWINDOWS.aspx Download]
 +
| 3.4.5
 +
| [isnt_root]\bin
 +
| AVR compiler toolchain (avr-gcc)
 +
| Run the installer, then manually add the path
 +
|-
 +
| Yagarto
 +
| [http://sourceforge.net/projects/yagarto/ Download]
 +
| 4.7.2
 +
| [isnt_root]\bin
 +
| ARM compiler toolchain (arm-gcc)
 +
| Run the installer, then manually add the path
 +
|-
 +
| libusb-win32
 +
| [http://sourceforge.net/projects/libusb-win32/ Download]
 +
| 1.2.6.0
 +
| Not needed
 +
| libusb USB library implementation for Windows
 +
| Download the .exe file and run it.  When asked, do not run the filter installer wizard.
 +
|-
 +
| avrdude
 +
| [http://download.savannah.gnu.org/releases/avrdude/ Download]
 +
| 6.1
 +
| [isnt_root]
 +
| AVR programming software
 +
| Download the avrdude-#.#-mingw32.zip file. (# = 0...9) Unpack it. Modify the system path according to the unpacking directory.
 +
|-
 +
| AVRDragon driver
 +
| [http://ati.ttu.ee/wiki/index.php/File:Avrdragon-driver-windows.zip Download]
 +
| N/A
 +
| Not needed
 +
| Windows driver for AVR Dragon AVR programmer
 +
| Download the driver. Unpack it. Plug in AVR Dragon. Use Device Manager to install the driver.
 +
|-
 +
| J-link
 +
| [https://www.segger.com/jlink-software.html Download]
 +
| 5.00h
 +
| [isnt_root]
 +
| Windows driver for Atmel SAM-ICE ARM programmer, J-link programming software
 +
| Download Software and documentation pack from the webpage. Unpack. Install. Make modifications to the system path.
 +
|-
 +
| deRFnode/deRFgateway USB serial driver
 +
| [https://www.dresden-elektronik.de/funktechnik/service/download/driver/?L=1#c3944 Download]
 +
| 1.05
 +
| Not needed
 +
| Driver for deRFnode/deRFgateway USB serial port
 +
| Download the file deRFusb V#_## (# = 0...9). Unpack it. Connect the board. Use Device Manager to install the driver. <br> '''Note:''' As of July 2015, there was no official Windows 8.1 support for this driver.
 +
|-
 +
| Sniffer
 +
| [http://www.luxoft.com/embedded-systems-development/bitcatcher/#files Download]
 +
| 1.0.1
 +
| Not needed
 +
| Bitcatcher driver and PC sniffing software
 +
| Download by clicking on the bitcatcher link. Unpack. Install driver usingdevice manager from driver/deRFusb folder. Install PC software from pc folder.
 +
|}
 +
 +
===GNU/Linux===
 +
See [[GNU/Linux related material]] (under construction).
 +
 +
==Getting the Software Stack==
 +
The software stack is based on Atmel's IEEE 802.15.4 MAC stack, with some additions from Dresden Elektronik.
 +
 +
<span style="color:red"> '''Note: </span> When installing the stack, it is recommended to install it directly into a folder that is located in the root of a drive.''' Otherwise, as the stack's directory structure is quite complex, OS's maximal path length can be hit while compiling. This will result in failure of the compilation process. (Default location (C:\Atmel) is OK)
 +
 +
===Downloading the stack===
 +
If the stack from Dresden Elektronik is desired for some reason, it can be downloaded from their website.
 +
The downloading / installation is a 3 step process:
 +
 +
# The Atmel MAC stack needs to be downloaded and installed from [https://www.dresden-elektronik.de/funktechnik/products/software/sources-stacks-firmware/mac-stack/?L=1 here]
 +
# Dresden Elektronik MAC additions need to be downloaded from [https://www.dresden-elektronik.de/funktechnik/products/software/sources-stacks-firmware/mac-stack/?L=1 here]. After download,  the Dresden Elektronik additions need to be installed on top of the Atmel MAC stack, into the same folder, overwriting files when asked.
 +
# The Dresden Elektronik 6LoWPAN addition needs to be installed on top of the stack in similar fashion as the MAC addition. It can be downloaded from [https://www.dresden-elektronik.de/funktechnik/products/software/sources-stacks-firmware/6lowpan/?L=1 here].
 +
 +
'''Note:''' There is not any support for deRFmega256 chip and PWM in ARM controllers included in the stack, it has to be added manually.
  
 
==Setting up IDE==
 
==Setting up IDE==
Line 25: Line 110:
 
# File -> New -> Makefile Project with Existing Code
 
# File -> New -> Makefile Project with Existing Code
 
# For Existing Code Location, select the path to the toplevel folder of the stack, leave other settings to default and click Finish.
 
# For Existing Code Location, select the path to the toplevel folder of the stack, leave other settings to default and click Finish.
 +
<br>
 +
Compiling and flashing the code is done using makefiles. More information on using the stack can be found on [[Using the MAC / 6LoWPAN stack]] page.

Latest revision as of 19:23, 23 November 2015

Dresden Elektronik radio modules are designed to work with a special software stack developed by Dresden Elektronik and Atmel. In order to use this stack, first the working environment and the toolchain need to be configured properly.

This section tries to provide some information on how to set up the environment in order to work with the modules.

Setting up Toolchain

The Dresden Elektronik software stack uses makefile based approach for compilation of the source code. Makefiles, originating from Unix based systems, use modified Bash like syntax. Thus it is necessary for the operating system to be able to run some Unix commands. While this is not a problem in GNU/Linux, Windows needs some additional tools to be installed in order to be able to execute the commands found in the makefiles.

The software stack expects the GNU C cross-compiler (GCC) to be used for compilation. Since two different platforms are used (AVR and ARM), also two different cross-compiler toolchains, on for each platform, are needed to be installed on the development system.

Last, but not least, some software for uploading the code to the microcontrollers is also needed.

The following subsections try to give some information about installing the tools necessary for working with the Dresden Elektronik radio/MCU modules.

Microsoft Windows

In order to work with the modules in Windows, some additional tools need to be installed. Usually, the path where they are installed, does not matter, but needs to be specified in the system path variable. Table below describes the tools, gives download links and shows the correct path that is needed to be added to the system path variable. [inst_root] means the root installation directory for the software.

Tool Link Latest version
at the time of writing
System path variable Description Notes
Yagarto tools Download 20121018 [isnt_root]\bin Make command + tools for minimal Unix-like environment Run the installer, then manually add the path
AVR toolchain Download 3.4.5 [isnt_root]\bin AVR compiler toolchain (avr-gcc) Run the installer, then manually add the path
Yagarto Download 4.7.2 [isnt_root]\bin ARM compiler toolchain (arm-gcc) Run the installer, then manually add the path
libusb-win32 Download 1.2.6.0 Not needed libusb USB library implementation for Windows Download the .exe file and run it. When asked, do not run the filter installer wizard.
avrdude Download 6.1 [isnt_root] AVR programming software Download the avrdude-#.#-mingw32.zip file. (# = 0...9) Unpack it. Modify the system path according to the unpacking directory.
AVRDragon driver Download N/A Not needed Windows driver for AVR Dragon AVR programmer Download the driver. Unpack it. Plug in AVR Dragon. Use Device Manager to install the driver.
J-link Download 5.00h [isnt_root] Windows driver for Atmel SAM-ICE ARM programmer, J-link programming software Download Software and documentation pack from the webpage. Unpack. Install. Make modifications to the system path.
deRFnode/deRFgateway USB serial driver Download 1.05 Not needed Driver for deRFnode/deRFgateway USB serial port Download the file deRFusb V#_## (# = 0...9). Unpack it. Connect the board. Use Device Manager to install the driver.
Note: As of July 2015, there was no official Windows 8.1 support for this driver.
Sniffer Download 1.0.1 Not needed Bitcatcher driver and PC sniffing software Download by clicking on the bitcatcher link. Unpack. Install driver usingdevice manager from driver/deRFusb folder. Install PC software from pc folder.

GNU/Linux

See GNU/Linux related material (under construction).

Getting the Software Stack

The software stack is based on Atmel's IEEE 802.15.4 MAC stack, with some additions from Dresden Elektronik.

Note: When installing the stack, it is recommended to install it directly into a folder that is located in the root of a drive. Otherwise, as the stack's directory structure is quite complex, OS's maximal path length can be hit while compiling. This will result in failure of the compilation process. (Default location (C:\Atmel) is OK)

Downloading the stack

If the stack from Dresden Elektronik is desired for some reason, it can be downloaded from their website. The downloading / installation is a 3 step process:

  1. The Atmel MAC stack needs to be downloaded and installed from here
  2. Dresden Elektronik MAC additions need to be downloaded from here. After download, the Dresden Elektronik additions need to be installed on top of the Atmel MAC stack, into the same folder, overwriting files when asked.
  3. The Dresden Elektronik 6LoWPAN addition needs to be installed on top of the stack in similar fashion as the MAC addition. It can be downloaded from here.

Note: There is not any support for deRFmega256 chip and PWM in ARM controllers included in the stack, it has to be added manually.

Setting up IDE

The recommended IDE for usage with the Dresden Elektronik software stack is Eclipse for C/C++ Developers. It can be downloaded for free from here.

After installing Eclipse, a new project containing the Dresden Elektronik communication stack can be created by following the next steps:

  1. File -> New -> Makefile Project with Existing Code
  2. For Existing Code Location, select the path to the toplevel folder of the stack, leave other settings to default and click Finish.


Compiling and flashing the code is done using makefiles. More information on using the stack can be found on Using the MAC / 6LoWPAN stack page.