SEARCH
TOOLBOX
LANGUAGES
modified on 5 April 2012 at 15:30 ••• 192,236 views

Eagle-50 Manual/Getting Started

From Manuals

(Difference between revisions)
Jump to: navigation, search
(Choose a Compiler and IDE (Integrated Development Environment))
(Installing the GNU Compiler and IDE)
Line 141: Line 141:
[[Image:IAR_CD.png|center|frame|alt=IAR KickStart CD|Figure 2.4: IAR Kickstart Main Menu]]
[[Image:IAR_CD.png|center|frame|alt=IAR KickStart CD|Figure 2.4: IAR Kickstart Main Menu]]
-
===Installing the GNU Compiler and IDE ===
+
===Installing a GNU Compiler and IDE ===
====Installing the Sourcery CodeBench Lite Edition for ARM EABI GNU Compiler====
====Installing the Sourcery CodeBench Lite Edition for ARM EABI GNU Compiler====

Revision as of 20:38, 1 March 2012


Getting started with the Eagle 50/50E can be done in just 6 steps.

  • 1. Run the Preloaded Application
  • 2. Install the Eagle Code Examples
  • 3. Choose a Compiler and IDE (Integrated Development Environment)
  • 4. Install the Chosen Compiler and IDE
  • 5. Compile a Code Example
  • 6. Download the Code Example to the Eagle 50/50E

Contents

Run the Preloaded Application

The Eagle 50E and Eagle 50 come from the factory preloaded with applications. The Eagle 50E has an Ethernet application called enet_io that demonstrates web-based I/O control. The Eagle 50 has a micro SD card application called sd_card that demonstrates accessing a micro SD card through a serial command line. The preloaded applications should be run to test the board after receiving it. The full source code for both applications is provided on the Eagle's Wiki. http://wiki.micromint.com/index.php/Eagle_Documentation

Eagle 50E enet_io Application

The Eagle 50E SBC is shipped with the enet_io example application from the TI Stellarisware Library. This example application demonstrates web-based I/O control using the Ethernet controller and the lwIP TCP/IP Stack. DHCP is used to obtain an Ethernet address. If DHCP times out without obtaining an address, a static IP address will be chosen using AutoIP. The address that is selected will be shown on COM1, allowing access to the internal web pages served by the application via a normal web browser. Figure 2.1 shows the web page that will first be displayed.

Web interface
Figure 2.1: Web interface for the enet_io application

In order to demonstrate this application on an Eagle 50E without the optional USB Debug Port you will need the following software and equipment:

  • 1. A Personal Computer (PC) with a serial port or a USB to serial port adapter
  • 2. A DB9 to 2x5 adapter cable
  • 3. A null modem cable
  • 4. A terminal program such as Putty, HyperTerminal, or TeraTerm
  • 5. A web browser
  • 6. One Ethernet cable
  • 7. One +5V power supply

Please follow these steps to run the enet_io application on an Eagle 50E without the optional USB Debug Port:

  • 1. Connect the Eagle 50Es COM1 port to the PC by using the 2x5 adapter cable and the null modem cable.
  • 2. Connect the Eagle 50Es Ethernet port to an Ethernet Network.
  • 3. Start and set-up the terminal program with the following settings.
    • a. Baudrate – 115200
    • b. Data Bits – 8
    • c. Parity – None
    • d. Stop Bits – 1
    • e. Flow Control – None
  • 4. Apply power to the board.
  • 5. The Eagle 50E will transmit the boards IP address to the terminal
  • 6. Open a web browser.
  • 7. Type the IP address into the web browsers address bar and the web page in Figure 2.1 should load.
  • 8. Click on “I/O Control Demo 1 (HTTP Requests)”.
  • 9. Click on the “Toggle LED” button to turn the User LED on.

In order to demonstrate the enet_io application on an Eagle 50E with the optional USB Debug Port you will need the following software and equipment:

  • 1. A Personal Computer (PC) with a USB port
  • 2. A terminal program such as Putty, HyperTerminal, or TeraTerm
  • 3. A web browser
  • 4. One USB A to micro USB cable (Supplied with Eagle 50E with USB Debug Port)
  • 5. One Ethernet cable

Please follow these steps to run the enet_io application on an Eagle 50E with the optional USB Debug Port:

  • 1. Make sure there are jumpers on JP1(below micro USB connector) and JP6 (below micor SD connector) on the Eagle 50E.
  • 2. Connect the Eagle 50Es Ethernet port to an Ethernet Network.
  • 3. Connect the Eagle 50E to the PC by using the USB A to micro USB cable.
  • 4. Wait until the USB drivers have been installed. The USB drivers can be found in the Software Updates section on the Eagle's Wiki. http://wiki.micromint.com/index.php/Eagle_Documentation
  • 5. Find out what COM port the Eagle 50E is by looking in Windows Device Manager’s PORTS (COM & LPT). The Eagle 50Es COM port is the one that says Stellaris Virtual COM Port.
  • 6. Start and set-up the terminal program for the COM port that the Eagle 50E is on and with the following settings.
    • a. Baudrate – 115200
    • b. Data Bits – 8
    • c. Parity – None
    • d. Stop Bits – 1
    • e. Flow Control – None
  • 7. Press the Reset button.
  • 8. The Eagle 50E will transmit the boards IP address to the terminal.
  • 9. Open a web browser.
  • 10. Type the IP address into the web browsers address bar and the web page in Figure 2.1 should load.
  • 11. Click on “I/O Control Demo 1 (HTTP Requests)”.
  • 12. Click on the “Toggle LED” button to turn the User LED on.

Eagle 50 sd_card Application

The Eagle 50 SBC is shipped with the sd_card example application from the TI Stellarisware Library. This example application demonstrates reading a file system from a micro SD card. It makes use of FatFs, a FAT file system driver. The application provides a simple command console via the Eagle 50’s COM1 serial port for issuing commands to view and navigate the file system on the SD card. Figure 2.2 shows what is displayed on a terminal program when the application is run.

Serial interface
Figure 2.2: Serial interface for the sd_card application

In order to demonstrate the sd_card application on an Eagle 50 without the optional USB Debug Port you will need the following software and equipment:

  • 1. A Personal Computer (PC) with a serial port or a USB to serial port adapter
  • 2. A DB9 to 2x5 adapter cable
  • 3. A null modem cable
  • 4. A terminal program such as Putty, HyperTerminal, or TeraTerm
  • 5. One micro SD card
  • 6. One +5V power supply

Please follow these steps to run the sd_card application on an Eagle 50 without the optional USB Debug Port:

  • 1. Connect the Eagle 50s COM1 port to the PC by using the 2x5 adapter cable and the null modem cable.
  • 2. Start and set-up the terminal program with the following settings.
    • a. Baudrate – 115200
    • b. Data Bits – 8
    • c. Parity – None
    • d. Stop Bits – 1
    • e. Flow Control – None
  • 3. Insert the micro SD card into the micro SD socket on the Eagle 50.
  • 4. Apply power to the board.
  • 5. Please refer to Figure 2.2 to see what the Eagle 50 will transmit the terminal.
  • 6. Type “?” then press enter for the command list.

In order to demonstrate the sd_card application on an Eagle 50 with the optional USB Debug Port you will need the following software and equipment:

  • 1. A Personal Computer (PC) with a USB port
  • 2. A terminal program such as Putty, HyperTerminal, or TeraTerm
  • 3. One USB A to micro USB cable (Supplied with Eagle 50E with USB Debug Port)
  • 4. One micro SD card

Please follow these steps to run the sd_card application on an Eagle 50 with the optional USB Debug Port:

  • 1. Make sure there are jumpers on JP1(below micro USB connector) and JP6 (below micor SD connector) on the Eagle 50.
  • 2. Connect the Eagle 50 to the PC by using the USB A to micro USB cable.
  • 3. Wait until the USB drivers have been installed. The USB drivers can be found in the Software Updates section on the Eagle's Wiki. http://wiki.micromint.com/index.php/Eagle_Documentation
  • 4. Find out what COM port the Eagle 50 is by looking in Windows Device Manager’s PORTS (COM & LPT). The Eagle 50Es COM port is the one that says Stellaris Virtual COM Port.
  • 5. Start and set-up the terminal program for the COM port that the Eagle 50 is on and with the following settings.
    • a. Baudrate – 115200
    • b. Data Bits – 8
    • c. Parity – None
    • d. Stop Bits – 1
    • e. Flow Control – None
  • 6. Press the Reset button.
  • 7. Please refer to Figure 2.2 to see what the Eagle 50 will transmit the terminal.
  • 8. Type “?” then press enter for the command list.

Install the Eagle Code Examples

Choose a Compiler and IDE (Integrated Development Environment)

Choosing a Compiler

Choosing an IDE

Install the Chosen Compiler and IDE

Installing EWARM

The IAR EWARM Kickstart Edition is a 32 KB code-sized limited version of the IAR C/C++ compiler and debugger. The IAR compiler generally produces the smallest code sizes for ARM targets and has excellent debugging capabilities. It can be downloaded from IAR's website.

After downloading the EWARM-KS-CD click on the application to install the IAR Embedded Workbench for ARM. Select the “Install IAR Embedded Workbench” option from the CDs main menu as shown in Figure 2.4. Follow the instructions in the installation application. We suggest that you use the default directories, and the “Full” installation option.

IAR KickStart CD
Figure 2.4: IAR Kickstart Main Menu

Installing a GNU Compiler and IDE

Installing the Sourcery CodeBench Lite Edition for ARM EABI GNU Compiler

Installing the devkitARM GNU Compiler

Installing the Eclipse IDE

Installing the CodeBlocks IDE

Compile a Code Example Application

Compiling Applications with EWARM

To load the StellarisWare workspace in the IAR IDE, select Programs> Micromint Eagle> IAR> StellarisWare examples from the Windows Start menu. The IAR Embedded Workbench for ARM will start and you will see a screen similar to that in Figure 2.5. Select the Blinky project by clicking on the drop down menu circled red in Figure 2.5. Be sure to select the board that you are using. In the case of Figure 2.5 the Eagle 50E was being used. To rebuild the project select the “Make” button on the toolbar. You can also right click on the project name to select “Make” or “Rebuild”. This will build a binary (.BIN) image file in the “board type\ewarm\Exe\” directory of the project. For example the binary for the blinky project using the Eagle 50E is in the “C:\Program Files\Micromint\Eagle\StellarisWare\boards\eagle\blinky\eagle-50e\ewarm\Exe” directory if the Eagle BSP was installed in the default directory. To load the application on the board please see the Firmware Download Procedures section in this manual. If the build and download is successful, the user LED on the Eagle SBC will start blinking.

IAR EWARM IDE
Figure 2.5: Using StellarisWare projects with the IAR EWARM IDE

Compiling Applications with the GNU Toolchain

Compiling Applications with the CodeBlocks IDE

To load the StellarisWare workspace in the CodeBlocks IDE, select Programs> Micromint Eagle> CodeBlocks> StrellarisEare examples from your Windows Start menu. The CodeBLocks IDE will start and you will see a screen similar to that on Figure 2.6. Select the Blinky project by right clicking the project name and selecting “Activate project”. Select the appropriate board using the dropdown menu circled red in figure 2.6. To rebuild the project select the “Rebuild” button on the toolbar. You can also right click on the project name to select “Build” or “Rebuild”. This will build a binary (.BIN) image file in the “board type\gcc\” directory of the project. For example the binary for the blinky project using the Eagle 50E is in the “C:\Program Files\Micromint\Eagle\StellarisWare\boards\eagle\blinky\eagle-50e\gcc” directory if the Eagle BSP was installed in the default directory. To load the application on the board please see the Firmware Download Procedures section in this manual. If the build and download is successful, the user LED on the Eagle SBC will start blinking.

CodeBlocks IDE
Figure 2.6: Using the StellarisWare projects with the CodeBlocks IDE

Compiling Applications with the Eclipse IDE

Compiling Applications with the GNU Toolchain from the Command Line

All example programs include a Makefile that allows you to build binary images from the command line using the GNU toolchain. The GNU “make” utility is installed as part of the GNU toolchain on the Eagle Setup CD. To build an image using the command line, just change to the project directory and execute “make”. To build the image for blinky you would perform the following:

  • 1. Open a command prompt.
  • 2. Type “CD\Program Files\Micromint\Eagle\StellarisWare\boards\eagle\blinky”.
  • 3. Press “Enter”.
  • 4. Type “make”.
  • 5. Press “Enter”.

Download the Example Program

There are many options to download firmware to the Eagle SBC. This section covers firmware downloads using a J-Link debugger, USB Debugger, Ethernet Bootloader, and Serial Bootloader. The method used to download firmware will depend on what hardware is being used.

Downloading Firmware using EWARM

To use the J-Link debugger with IAR EWARM, select Projects> Options> Debugger with the project name selected in the workspace. On the “Setup” tab select “J-Link/J-Trace” as the driver and “main” as the location to run to. On the Download tab make sure that “Use flash loader(s) is checked. Click OK to save the settings. Then select the “Download and debug” button on the toolbar and then the “Go” button to execute. To use the USB debugger with IAR EWARM, select Projects> Options> Debugger with the project name selected in the workspace. On the “Setup” tab select “LMI FTDI” as the driver and “main” as the location to run to. On the Download tab make sure that “Use flash loader(s)” is checked. Click OK to save the settings. Then select the “Download and debug” button on the toolbar and then the “Go” button to execute.

Downloading Firmware using the LM Flash Programmer and USB Debugger

The USB Debugger option for the Eagle 50 and Eagle 50E can be used with the LM Flash Programmer software to program the board. To load the flash programmer, select Programs> Micromint Eagle> LM Flash Programmer> LM Flash Programmer from your Windows Start menu. Go to the “Setup” tab to see a screen similar to that in Figure 2.7. On “Interface” select “ICDI (Eval Board)”. The bootloader uses the first 8 KB of the flash address space (0x00000000 to 0x00001fff). If you wish to keep the bootloader then applications should be linked to start at address 0x00002000. That is done automatically if you use the “ewarm/application.icf” or “gcc/application.ld” linker scripts used in the examples. The application should then be downloaded by setting up the LM Flash Programmers “Program” tab like Figure 2.8. You can overwrite the bootloader if you so desire by using the ewarm/standalone.icf” or “gcc/ standalone.ld” linker scripts and downloading your binary image at address 0x0.

USB flash configuration
Figure 2.7: USB debug port flash programmer configuration
USB download
Figure 2.8: USB debug port flash programmer download

Downloading Firmware using the Ethernet Bootloader

The Eagle 50E is shipped with an Ethernet bootloader that can be used to update the firmware on the board from an Ethernet connection. The bootloader uses the BOOTP and TFTP protocols to temporarily acquire an IP address and copy the binary image to the board. The LM Flash Programmer implements a small BOOTP and TFTP server to do this.

The bootloader uses the first 8 KB of the flash address space (0x00000000 to 0x00001fff). Programs loaded with the bootloader should be linked to start at address 0x00002000. That is done automatically if you use the “ewarm/application.icf” or “gcc/application.ld” linker scripts used in the examples.

You can overwrite the bootloader if you so desire by using the “ewarm/standalone.icf” or “gcc/ standalone.ld” linker scripts and downloading your binary image via the JTAG. Currently the bootloader cannot be overwritten via the Ethernet port.

Follow the below steps to use the LM Flash Programmer and the Ethernet bootloader:

  • 1. Connect the Eagle 50E’s Ethernet port to the network.
  • 2. Apply power to the Eagle 50E.
  • 3. Press and hold the Eagle 50E’s “USER” button.
  • 4. Press and release the Eagle 50E’s “RESET” button.
  • 5. Release the “USER” button. The Eagle 50E’s “USER LED” should now be blinking approximately once a second.
  • 6. Open the LM Flash Programmer
  • 7. Select the "Setup" tab and you will see a screen similar to Figure 2.9
  • 8. For "Interface" select "Ethernet"
  • 9. For "Ethernet Adapter:" select the adapter that is connected to the computers network.
  • 10. For “Client IP Address:” enter an IP address that is on the same subnet as your Ethernet adapter. The last octet must be different than the Ethernet Adapters.
  • 11. For “Client MAC Address:” enter the Eagle 50E’s serial number. It can be found on the bottom of the board and should start with 0021A3. Make sure to separate the octets with dashes (00-21-A3).
  • 12. Select the "Program" tab on the LM Flash Programmer software and you will see a screen similar to Figure 2.10.
  • 13. Click the “Browse” button and locate the application to be downloaded.
  • 14. Click on the “Program” button. It generally takes several seconds for the program to start downloading.
Ethernet configuration
Figure 2.9: Ethernet Bootloader Flash programmer configuration
Ethernet download
Figure 2.10: Ethernet Bootloader flash programmer download

Ethernet bootloader troubleshooting guide:

  • 1. Temporarily turn off the computers firewall. If this works add the LM Flash programmer to the Firewalls Exceptions list.
  • 2. Try bypassing the network by connecting the Eagle 50E directly to the computer Ethernet port. A regular CAT5 cable will work. Make sure to close the LM Flash Programmer software and start at step 2 in the above procedure.

Downloading Firmware using the Serial Bootloader

The Eagle 50 is shipped with a Serial bootloader that can be used to update the firmware on the board from a Serial connection. To place the bootloader in update mode you need to press and hold the user button while the board is starting up, e.g. via power up or when pressing the reset button. After the board starts up release the user button and you will see the user LED blinking approximately once per second. That indicates the board is ready to receive a firmware update via a Serial connection.

Programs loaded with the bootloader should be linked to start at address 0x00002000. That is done automatically if you use the “ewarm/application.icf” or “gcc/application.ld” linker scripts used in the examples. You can overwrite the bootloader if you so desire by using the “ewarm/standalone.icf” or “gcc/ standalone.ld” linker scripts and downloading your binary image via the JTAG. Currently the bootloader cannot be overwritten via the Serial port.

Follow the below steps to set up the LM Flash Loader:

  • 1. Open the LM Flash Programmer
  • 2. Select the "Setup" tab and you will see a screen similar to Figure 2.11
  • 3. For "Interface" select "Serial Interface"
  • 4. For "COM Port:" select the COM port that is assigned to "Stellaris Virtual COM Port" in the "Device Manager" for the Optioanl USB Debugger or the COM port that you will be using
  • 5. The baudrate should be set to 115200
  • 6. Set the transfer size to 76
  • 7. Select the "Program" tab and you will see a screen similar to Figure 2.12
  • 8. Set the "Program Address Offset" to 2000
  • 9. Click the "Browse" button and locate the application to be downloaded
Serial configuration
Figure 2.11: Serial bootloader flash programmer configuration
Serial download
Figure 2.12: Serial bootloader flash programmer download

The application can be downloaded using the LM Flash Programmer and the optional USB Debugger by following these steps:

  • 1. If you are powering the board via USB put a jumper on JP1
  • 2. Make sure there is a jumper on JP6
  • 3. Connect the USB cable to the computer and the board
  • 4. Press and hold the "USER" pushbutton on the board
  • 5. Press and release the "RESET" pushbutton on the board and the LED should start blinking around once a second
  • 6. Release the "USER" pushbutton
  • 7. Click on the "Program" button

The application can be downloaded using the LM Flash Programmer and COM1 by following these steps:

  • 1. If you have an optional USB debugger make sure there is NOT a jumper on JP6
  • 2. Connect the serial cable to COM1 (J3)
  • 3. Power the board
  • 4. Press and hold the "USER" pushbutton on the board
  • 5. Press and release the "RESET" pushbutton on the board and the LED should start blinking around once a second
  • 6. Release the "USER" pushbutton
  • 7. Click on the "Program" button

Downloading Firmware from the Command Line

The TI Flash Programmer can also be invoked from the command line. The command line allows you to program the Eagle SBC though Ethernet Bootloader, Serial Bootloader, or FTDI JTAG. This section provides a step by step procedure for each programming method. Follow these steps to program the board using the command line and the Ethernet Bootloader. The Eagle 50E and Eagle 100 comes with the Ethernet Bootloader.

  • 1. Put the board in bootload mode by hold the user pushbutton while pressing and releasing the reset pushbutton. The user LED will blink when it is in bootload mode.
  • 2. Enter the following command line example with your own parameters. Where 192.168.1.201 is the IP address of the computers Ethernet Port and 192.168.1.210 is a free IP address of the network the Eagle SBC is on. 00-21-A3-00-01-02 is the MAC address of the Eagle SBC. The MAC address is also the board’s serial number which is on the bottom of the board.
lmflash -i ethernet -n 192.168.1.201,192.168.1.210,00-21-A3-00-01-02 blinky.bin
  • 3. The command line will give you status while the board is programming.

Follow these steps to program the board using the command line and the Serial Bootloader. The Eagle 50 comes with the Ethernet Bootloader.

  • 1. Put the board in bootload mode by hold the user pushbutton while pressing and releasing the reset pushbutton. The user LED will blink when it is in bootload mode.
  • 2. Enter the following command line example with your own parameters. Where COM7 is the COM port that is connected to the Eagle 50 SBC
lmflash -i serial -d -p COM7 -b 115200 -o 0x2000 -r blinky.bin
  • 3. The command line will give you status while the board is programming.

Follow these steps to program the board using the command line and the USB Debug Port

  • 1. Connect the USB Debug Port to the computers USB port.
  • 2. Enter the following command line example with your own parameters

lmflash –I ftdi –r –o 0x2000 blinky.bin 3. The command line will give you status while the board is programming.

To see all options available from the command line, use “lmflash –h”. To see other examples of command lines, use “lmflash –examples”.

Optional USB Debug Port Unlock Procedure

The Eagle 50 SBC's JTAG port is multiplexed with GPIO pins PB7, PC0, PC1, PC2, and PC3. Somtimes the debug port becomes locked and needs to be reset. Please follow the below steps to unlock the JTAG port.

  • 1. Make sure there is a jumper on JP1.
  • 2. Make sure there is not a jumper on JP8.
  • 3. Connect the USB cable to the computer and the board.
  • 4. Open the LM Flash Programmer software
  • 5. Set-up the "Configuration" tab according to Figure 2.13
USB flash configuration
Figure 2.13: USB debug port flash programmer configuration
  • 6. Select the "Other Utilities" tab
  • 7. In the "Debug Port Unlock" section select "Fury and DustDevil Classes"
  • 8. Click the "Unlock" button and follow the directions that pop up.

Restoring the Factory Default Firmware

Restoring the Bootloader

  • 1. Download the Eagle Factory Binaries file and unzip the files
  • 2. Make sure there is a jumper on JP1
  • 3. Connect the board to the computer using the USB Debugger
  • 4. Open the LM Flash programmer
  • 5. Make sure that the LM Flash programmer is configured like Figure 2.14
USB flash configuration
Figure 2.14: USB debug port flash programmer configuration
  • 6. Click on the Program tab
  • 7. Configure the options so that "Erase Entire Flash" is selected, "Verify After Program" and "Reset MCU After Program" should have checks next to it and the "Program Address Offset" should be 0
  • 8. Click the browse button to and browse to the directory where you unzipped the eagle-factory-binaries-2011.02.zip file and select boot_eth.bin for the Eagle 50E or boot_serial.bin for the Eagle 50
  • 9. Click on the "Program" button on the LM Flash Programmer

Restoring the Factory Default Application

  • 1. If you are not sure if the bootloader has been overwritten then please follow the "Restoring the Bootloader" instructions before proceeding
  • 2. Make sure there is a jumper on JP1
  • 3. Connect the board to the computer using the USB Debugger
  • 4. Open the LM Flash programmer
  • 5. Make sure that the LM Flash programmer is configured like Figure 2.15
USB flash configuration
Figure 2.15: USB debug port flash programmer configuration
  • 6. Click on the Program tab
  • 7. Configure the options so that "Erase Entire Flash" is selected, "Verify After Program" and "Reset MCU After Program" should have checks next to it and the "Program Address Offset" should be 2000
  • 8. Click the browse button to and browse to the directory where you unzipped the eagle-factory-binaries-2011.02.zip file and select enet_io.bin for the Eagle 50E or sd_card.bin for the Eagle 50
  • 9. Click on the "Program" button on the LM Flash Programmer

NEXT: Hardware

PREVIOUS: Introduction