Top Banner

of 21

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 1/21

    Manual

    eCos on Zynq

    Evaluation Board

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    2

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 2/21

    eCos on Zynq Evaluation Board

    I. Write prebuild image to QSPI Flash

    1.Connect J-Link JTAG to J58on Zynq Evaluation Board.2.Set SW10switch to 1-1 position.3.Set QSPI boot mode on your Zynq Evaluation Board. (Jumper Settings from

    J21, J20, J22, J25, J26as follows or DIP Switch SW16Setting: 1,2,3 and 5 are

    switched to the right and 4 is switched to the left)

    4.Connect Mini USB cable to J17on Zynq Evaluation Board from one side and toPC from other side. (install CP2103 chip driver if necessary)

    5.Open COM port terminal (e.g. Putty) and open COM Port which is assigned tothis CP2103 driver.

    6.Start GDB Server and power on Zynq Evaluation Board. (Please use the GDBServer Version which support Cortex-A8 CPU, e.g. J-Link ARM V4.53e

    versoin).

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    3

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 3/21

    It should find Cortex-A8 target, set the necessary settings as figure:

    Uncheck Cache reads Check Init regs on start

    7.You can find following files in folder: .gdbinit boot.bin redboot.elf arm-none-eabi-gdb.exe

    Start arm-none-eabi-gdb.exe, you will see the next log:

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    4

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 4/21

    8.And the next log in terminal:

    9.With fconfig command to setup ip address, netmask, gateway, server ip andsave configuration to flash.

    User BOOTP for network configuration: false

    Update RedBoot non-volatile configuration - continue (y/n)? y

    10.Need to reboot Redboot, so close GDB Server and arm-none-eabi-gdb.exe,then repeat 6~8 steps.

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    5

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 5/21

    11.New ip address and server ip are already applied. So we can use TFTP todownload bootloader. Connect Ethernet cable to the Ethernet interface of the

    development board. launch TFTPServer (e.g. Tftpd32) and configure it.

    In SettingsMenu: on the GLOBALtab uncheck all options except for TFTP

    Server:

    on the TFTPtab select your Base Directory:

    12.Copy boot.bin to the TFTPBase Directory.13.Use RedBoot command to load boot.bin file

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    6

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 6/21

    RedBoot> load -r -b 0x01000000 boot.bin

    14.Need to prepare FIS tableRedBoot> fis init

    Press y when it prompts

    15.Write boot.bin file into QSPI flashRedBoot> fis write f 0x00000000 b 0x01000000 l 0x00040000

    16.Power off board and disconnect JTAG.17.Power on board and you will see RedBoot prompt in COM console.18.Also you can boot FPGA side with TFTP

    RedBoot> load -r -b 0x01000000 fpga.bin

    RedBoot> fpga_load b 0x01000000 l 0x3dbafc

    Please pay attention to the DDR3 address. Address should be accessible from all

    masters. Also for FPGA, this address should be aligned by 16MB boundary.

    Note:

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    7

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 7/21

    If you find error while starting arm-none-eabi-gdb.exe in step 7, that means theflash was written by somehow before, you need to erase it to run step 7 correctly.

    Insert SD Card which contains the pre-built images for the Xilinx ZC702platform and set the SD Card boot mode for board. (Jumper Settings: set J22

    the same as J25 or DIP Switch SW16 Setting: 1,2 and 5 are switched to the

    right and 3, 4 are switched to the left)

    Power on board and if you see any output in terminal then hit any key tostop autoboot, and you will see the pele-boot prompt.

    Use sf command to erase flashpele-boot> sf probe 0 0 0

    pele-boot> sf erase 0 0x200000

    After finish power off the board and repeat from step 6 to continue.Once boot.bin was written in QSPI flash and the IP was configured, you can

    power on the board to get redbootprompt. Then you can ignore from step 6 to

    step10 for updating new boot.binfile.

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    8/

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 8/21

    II. Build RedBoot for Zynq Eveluation Board

    Assumed eCosTools-install.exe was installed in host PC.

    1.Open eCos Configuration Tool:At the first time running eCos Configuration Toola message box will appear to

    let you set the repository path:

    Click Browse to find the eCos repository:

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    9/

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 9/21

    Click OK you can see the eCos Configuration Tools like below:

    2.Inside eCos Configuration Tool, open redboot_zynq.ecc in folder\Source\target.

    3.Make sure the Build Tools Path (Tools>Paths>Build Tools), User ToolsPath (Tools>Paths>User Tools) are configured correctly:

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 10/21

    4.Run Build> Generate build tree.5.Run Build > Libraryto build RedBoot.6.After finish, you will find redboot.elf in folder

    \Source\target\redboot_zynq_install\bin.

    7.In folder you can find the script file gen.bat for generating boot.binfile andthe prebuilt redboot.elffile.

    8.Copy your built redboot.elfto replace prebuilt redboot.elfand launch gen.batto build the new boot.binfile.

    9.Use the new boot.bin to rewrite QSPI flash. (See section I. Write prebuildimage to QSPI Flash).

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 11/21

    III. Build eCos internal tests, boot it and write it to flash memory

    1.Open eCos Configuration Tool and open zynq_eval_default_config.ecc infolder\Source\target.

    2.Run Build > Generate build tree.3.Run Build > Teststo build Tests.4.After finish, you will find tm_basic in folder

    \Source\target\zynq_eval_default_config_install\tests\kernel\current\tests.

    5.Connect Ethernet cable to the Ethernet interface of the development board.

    6.Launch Tftpd32and configure the TFTP-server. (see section I. Write prebuildimage to QSPI Flash step 11).

    7.Copy your built tm_basicto TFTP Base Directory.8.Power on board, In RedBoot prompt run the load command:

    RedBoot> load tm_basic

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 12/21

    9.Use go command to start tm_baisc application:RedBoot> go

    tm_basic needs about 30-40 sec for starting, because big BSS area (about 900 MB)in DDR3 SDRAM.

    If you want to write tm_basic into flash and let it runs by startup, please ignore

    step 9 and run step 10.

    10.To write tm_basic into flash, after step 8, use fis create command:

    RedBoot> fis create b 0x02000000 l 0x14000 f 0x00200000 e 0x02000040tm_basic

    11.After that run fconfig to set up run script:RedBoot> fconfig

    Run script at boot: true

    Enter script, terminate with empty line

    >> fis list

    >> fis load tm_basic

    >> go

    >>

    Boot script timeout

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 13/21

    12.After finish, reboot the board and it will run RedBoot and tm_basicautomatically.

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 14/21

    IV. Build eCos application, run it and debug it with IDE.

    1.Open eCos Configuration Tool and open zynq_eval_default_config.ecc infolder\Source\target.

    2.Run Build> Generate build tree.3.Run Build > Library to build eCos Library.

    Please wait while the eCos Configuration Tool builds eCos Library. This will

    take some minutes to complete.

    4.Open eclipse IDE.5.Create new eCos C project. First choose File>New> eCos C Project as

    shown in the picture:

    Choose Hello World ANSI C eCos Project in the Project type. The toolchainwe use is ARM GCC. Type the name of the project to the Project name fieldand select a location for the project:

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 15/21

    Click Next.

    In Basic Settingswizard, click on button Browseto find the eCos installation

    directory (from step 3):

    Click Next then Finishto complete creating a new project.

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 16/21

    6.Configure Build Environment.

    Highlight Project and Select Project > Properties > C/C++ Build >

    Environment:

    Modify the variable with the name ECOS_INSTDIR, which was created from

    step 3 (e.g. C:\eCos On Zynq\Source\target\zynq_eval_default_config_install,please use if the path has spaces). Click Apply and OK to save

    Configuration.

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 17/21

    7.To build or clean Project, use the corresponding commands as follows:

    8.Configure debugger. Select Window > Open Perspective > Debug, theconfiguration can be reached by clicking on the down arrow at the "insect"button. That brings up the pull-down menu:

    And select "Debug Configuration...":

    The next window will look like:

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 18/21

    Double click on "ARM eCos Debugger"to create a configuration of selected

    type. On the field Name keep Hello Debug. On the C/C++ Applicationfield keep Debug\Hello. On the Project field keep Hello to debug the

    test application.The Debug Configurationdialog will look like:

    Main tab:

    Debugger tab:

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    1

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 19/21

    Now move to the "Startup"tab. Select User Defined Hardwarein Hardware

    combo box, open .gdbinit file with editor and copy the bootscript content, pastethe copied bootscript in text field, remove the last two lines of the content:

    load redboot.elf

    continue

    click Apply to save settings.

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    2

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 20/21

    9.Connect J-Link JTAG to J58on Zynq Evaluation Board. Set SW10switch to1-1 position. Jumper Settings: set J21, J20, J22, J25, J26 down or DIP Switch

    SW16 Setting: 1, 2, 3, 4 and 5 are switched to the right. Open J-Link GDB

    Server via JTAG for debug connection, power on the board.

  • 5/22/2018 Quick Start ECos on Zynq ZC702 Evaluation Board

    2

    ITR GmbH Manual Development of eCos Applications using Eclipse Page 21/21

    10.After log output shows Waiting for GDB connection, click Debug onDebug Configuration window to run the debugger.

    Set breakpoint anywhere, Click Resume (F8) to start the debugging.