STR710_DCC_DEMO_STMicro

所属分类:嵌入式/单片机/硬件编程
开发工具:Windows_Unix
文件大小:24KB
下载次数:1
上传日期:2018-03-22 22:37:43
上 传 者lsccls
说明:  使用DCCIO_Read函数从DCC寄存器读取数据,之后使用DCCIO_Write写回数据。参考价值在于用eclipse和Keil环境进行不同设置。 程序开发使用GNU环境可参考面比较广,易于开发周期短。是个不错的经典例子。
(Uses DCCIO_Read() to read packet (a byte_count value, followed by (byte_count/4) data words) from the DCC which it buffers. It then uses DCCIO_Write() to send a packet (byte_count value followed by the (byte_count/4) data words) back to the host via DCC.)

文件列表:
STMicro_STR710_DCC_DEMO\Org\.cproject (12576, 2017-11-03)
STMicro_STR710_DCC_DEMO\Org\.project (2259, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\.settings\org.eclipse.wst.validation.prefs (392, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\Clean.CMD (129, 2018-03-01)
STMicro_STR710_DCC_DEMO\Org\commregs.s (2079, 2018-02-28)
STMicro_STR710_DCC_DEMO\Org\crt0.S (1052, 2018-03-01)
STMicro_STR710_DCC_DEMO\Org\dccio.c (3591, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\dccio.h (1844, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\DccTerminal.launch (757, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\gdbinit (1854, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\info.txt (1549, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\int.ini (15, 2017-12-22)
STMicro_STR710_DCC_DEMO\Org\JTAGScanChainAnalyzer.launch (702, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\ldscript (533, 2017-12-22)
STMicro_STR710_DCC_DEMO\Org\Makefile (1457, 2018-02-28)
STMicro_STR710_DCC_DEMO\Org\OcdCommander.launch (588, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\SizedReadWriteBuffer.mac (780, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\STMicro_STR710_DCC_DEMO.launch (5142, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\STMicro_STR710_DCC_DEMO_ocdremote.launch (714, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\STMicro_STR710_DCC_DEMO_ocdremoteServer.launch (720, 2012-08-04)
STMicro_STR710_DCC_DEMO\Org\test.c (2120, 2018-02-28)
STMicro_STR710_DCC_DEMO\Org\UsbDemonFinder.launch (695, 2012-08-04)
STMicro_STR710_DCC_DEMO\Proj\Clean.CMD (114, 2018-02-28)
STMicro_STR710_DCC_DEMO\Proj\int.ini (15, 2017-12-22)
STMicro_STR710_DCC_DEMO\Proj\ldscript (533, 2018-03-01)
STMicro_STR710_DCC_DEMO\Proj\STR710_DCC_DEMO.Opt (2361, 2018-03-01)
STMicro_STR710_DCC_DEMO\Proj\STR710_DCC_DEMO.plg (1862, 2018-03-01)
STMicro_STR710_DCC_DEMO\Proj\STR710_DCC_DEMO.Uv2 (2749, 2018-02-28)
STMicro_STR710_DCC_DEMO\Proj\STR710_DCC_DEMO_Target 1.dep (730, 2018-03-01)
STMicro_STR710_DCC_DEMO\Org\.settings (0, 2017-11-03)
STMicro_STR710_DCC_DEMO\Org (0, 2018-03-01)
STMicro_STR710_DCC_DEMO\Proj (0, 2018-03-01)
STMicro_STR710_DCC_DEMO (0, 2018-02-28)

STMicroelectonics STR710-EVAL board Debug Communications Channel ARM7TDMI processor demo This directory contains an example Debug Communcations Channel I/O ARM program that can be run on a remote ARM7TDMI CPU target using: 1) DccTerminal.jar - a Debug Communcations Channel Terminal emulator 2) Eclipse and/or GDB 3) Macraigor Wiggler/Raven/Usb2Demon/Usb2Sprite/UsbWiggler/mpDemon JTAG interface device. (The Wiggler in not supported under linux.) This program demonstates a simple echoing The following files are provided: test.c C source for example that echo packets received from DccTerminal.jar or the OcdCommander armdcc window dccio.c C source for DCCIO_Read/DCCIO_Write subroutines dccio.h C header file for DCCIO_Read/Write commregs.s Assembly source for DCC register read/write routines crt0.S Assembly source for C initialization code. ldscript Linker script for the FreeScale iMX21 Eval board gdbinit Initialization script for GDB info.txt board information and test log Makefile Will build test.elf using gcc cross compiler for ARM. .project,.cproject Elipse project files .launch _ocdremote.launch _ocdremoteServer.launch DccTerminal.launch .settings/org.eclipse.core.prefs ============================================================================= To Run the Debug Communications Channel example on the STMicroelectonics STR710-EVAL board you need to: STEP 1 ----------------------------------------------------------------------------- 1a) Construct an example application in a Cygwin/Linux window: ----------------------------------------------------------------------------- If Linux enter the following command : If Windows, enter a cygwin "bash shell" then type : > cd .../arm/STMicro_STR710EVAL Verify that the: 1) section address values in ldscript 2) "target remote 127.0.0.1:8888" command in gdbinit 3) monitor endian little/big 4) set endian little/big 5) register setup values in gdbinit are correct for your board, then type : > make test or ------------------------------------------------------------------------------ 1b) Import the example project, then build under Eclipse ------------------------------------------------------------------------------ 1) Start Eclipse 2) Select File -> Import ... -> Existing Projects into Workspace 3) In the Import Projects Window : click the Select root directory radio button and then browse into and select .../Arm/STMicro_STR710EVAL then hit OK. 4) In the Import Projects window, the Projects: list should now show a checked STMicro_STR710EVAL Click the Finish button 5) In the C/C++ Perspective, highlight the STMicro_STR710EVAL project then right click and select Clean. This will clean then make the application. STEP 2 : ------------------------------------------------------------------------------ 2a) Start ocdremote or ocdremoteServer in a Cygwin/Linux window (Wiggler/Raven/Usb devices): ----------------------------------------------------------------------------- Prior to running GDB you must first start ocdremote or ocdremoteServer. These stand alone utilities listen to a TCP/IP port and convert incoming GDB commands to JTAG signals. I.e.: --TCP/IP port----LPTx--JTAG-- --USBx- --COMx- ocdremote has to be started before each gdb starts and teminates once the gdb session ends ocdremoteServer only has to be started once. It runs contineously after it has been started and waits on the TCPIP ports for the next gdb connection after the current gdb session ends If started as an Eclipse "external tool" ocdremoteServer will exit when you exit Eclipse. To stop ocdremoteServer started from a linux or cygwin shell enter the CTRL-c key combination in its parent shell window. If ocdremoteServer is running in the background it can be stopped using the kill command in a shell window by 1)Getting its process id ps -e | grep ocdremoteServer 2)Issuing a kill command on that process kill -9 Use the following command to start ocdremote or ocdremoteServer using a RAVEN interconnection device on LPT1 and using TCP/IP port 8888 to receive commands from GDB. In Linux it can either be run in the background or from a second shell window. Under Windows it must be run from a second Cygwin "bash" shell window: /usr/local/bin/ocdremote -c ARM7TDMI -d USB -s 4 -i ***88 /usr/local/bin/ocdremoteServer ocdremote/ocdremoteServer takes additional OPTIONAL parameters that allow you to modify it's modes of operation: ocdremote[Server] -c [,],..] [-p ] [-d ] [- a ] [-s ] where: = ARM7TDMI ... (enter "/usr/local/bin/OcdRemote" for a complete CPU list) = tcp/ip port, default = 8888 = tcp/ip port used to send/receive packets via the targets Debug Communications Channel = WIGGLER, RAVEN,MPDEMON_SERIAL, MPDEMON_PARALLEL, MPDEMON_ETHERNET, USB, default = RAVEN = WIGGLER/RAVEN/MPDEMON_PARALLLEL: LPT number 1 - 4 MPDEMON_SERIAL : COM number : 1 - 4 MPDEMON_ETHERNET : tcp/ip address in the format : xxx.xxx.xxx.xxx USB : macraigor USB device number : 0 - 15 default = 1 = JTAG clock rate 1 - 8, default = 1 (fastest) (see GNU TOOLS FAQ page for a device speed vs jtag clock rate table) Some Examples : Wiggler(windows only) LPT2 at JTAG speed 1 (380 khz) : ocdremote[Server] -c ARM7TDMI -d WIGGLER -a 2 -s 1 -i ***88 Raven LPT1 at JTAG speed 1 (8 mhz) : ocdremote[Server] -c ARM7TDMI -d RAVEN -a 1 -s 1 -i ***88 mpDemon : ethernet - 192.168.1.30 at JTAG speed 2 (9 Mhz) : ocdremote[Server] -c ARM7TDMI -d MPDEMON_ETHERNET -a 192.168.1.30 -s 2 -i ***88 mpDemon: parallel - LPT1 at JTAG speed 3 (5 Mhz): ocdremote[Server] -c ARM7TDMI -d MPDEMON_PARALLEL -a 1 -s 3 -i ***88 Usb2Demon as USB device 0 at JTAG speed 1 (24 Mhz): ocdremote[Server] -c ARM7TDMI -d USB -a 0 -s 1 -i ***88 UsbSprite as USB device 2 at JTAG speed 3 (2 Mhz): ocdremote[Server] -c ARM7TDMI -d USB -a 2 -s 3 -i ***88 UsbWiggler as USB device 0 at JTAG speed 1 (6 Mhz): ocdremote[Server] -c ARM7TDMI -d USB -a 0 -s 1 -i ***88 or ---------------------------------------------------------------------------- 2b) Configure your mpDemon/WIFIDemon to interface directly to GDB without using a local OcdRemote : ((mpDemon/WIFIDemon devices)) ----------------------------------------------------------------------------- An mpDemon or WIFIDemon can communicate directly with one or more GDB sessions via ethernet to it's internal OcdRemote GDB interface. Initially, prior to starting the GDB session(s) on your host, you must first configure the WIFI/mpDemon's OcdRemote for your target board. OcdRemote converts GDB commands to JTAG/BDM signals that control your target board's CPU(s). IE : [GDB(s)]----[WIFI/mpDemon ocdremote]----[Target] Read your WIFIDemon or mpDemon manual or bring up "www.macraigor.com/gnu_faq.htm" in your web browser for more information on how to configure your mpDemon's or WIFIDemon ocdremote session If you are using a WIFIDemon or mpDemon your gdb session's gdbinit file should have the line : remote target : This tells GDB to send it's monitor commands to the on the WIFI/mpDemon. These commands will be routed by the WIFI/mpDemon to a single target CPU. Multiple GDB sessions can be run simulataneously each controlling a different CPU on the target board. or ---------------------------------------------------------------------------- 2c) Configure Eclipse's CDT external tools dialog to start ocdremote or ocdremoteServer ----------------------------------------------------------------------------- Prior to launching a debug session you must first launch OcdRemote. These stand alone utilities listen to a TCP/IP port and convert incoming GDB commands to JTAG signals. I.e.: --TCP/IP port--USBx--JTAG- -LPTx- 1) In the CDT c/c++ or Debug perspective right click on the arrow next to the External tools (arrow head w/ briefcase) Icon and select External Tools... 2) In the External Tools dialog click on Program - STMicro_STR710EVAL_ocdremote or Program - _ocdremoteServer The main tab should have the following values in its' fields Location : c:\cywgin\usr\local\bin\ocdremote /usr/local/bin/ocdremoteServer Working Directory : /usr/local/bin Arguments : -c ARM7TDMI -d USB -s 4 -i ***88 (for USB devices) or -c ARM7TDMI -d RAVEN -s 2 -i ***88 (for RAVEN) or -c ARM7TDMI -d WIGGLER -s 1 -i ***88 (for WIGGLER) (see step 2a for descriptions of these arguments) 3) Hit the Run Button to start ocdremote or ocdremoteServer STEP 3 : ----------------------------------------------------------------------------- 3a) Start DccTerminal in Windows/Linux window: ----------------------------------------------------------------------------- Open a new (cywin/Linux) window. Enter: cd /usr/local/bin java -jar DccTerminal.jar In the "Enter OcdRemote's TCP/IP
:" dialog that appears enter: 127.0.0.1: where is the same value as the one in the "-i " parameter on OcdRemote's command line Then click the OK button. Note: if you are connecting via ethernet to OcdRemote running on another PC or on the mpDemon you will need to specify the ethernet address in the Dialog. For example if your remote PC's/mpDemon's ethernet address was 192.168.1.55 and you specified it's DCC port number to be ***88 you would enter : 192.168.1.55:***88 or ---------------------------------------------------------------------------- 3b) Configure Eclipse's CDT external tools dialog to start DccTerminal ----------------------------------------------------------------------------- To open the DCC Terminal, creating the following DCC link with the target application : --DCC TCP/IP port--USBx--JTAG- from Eclipse you need to do the following : 1) In the CDT c/c++ or Debug perspective right click on the arrow next to the External tools (arrow head w/ briefcase) Icon and select External Tools... 2) In the External Tools dialog click on Program - DccTerminal or Program - _ocdremoteServer The main tab should have the following values in its' fields Location : ${system_path:java} /usr/local/bin/ocdremoteServer Working Directory : /usr/local/bin Arguments : -jar DccTerminal.jar Hit the Run Button to start DccTerminal 3) In the "Enter OcdRemote's TCP/IP
:" dialog that appears enter: 127.0.0.1: where is the same value as the one in the "-i " parameter on OcdRemote's command line Then click the OK button. Note: if you are connecting via ethernet to OcdRemote running on another PC or on the mpDemon you will need to specify the ethernet address in the Dialog. For example if your remote PC's/mpDemon's ethernet address was 192.168.1.55 and you specified it's DCC port number to be ***88, you would enter : 192.168.1.55:***88 STEP 4 : ----------------------------------------------------------------------------- 4a) Start GDB in Windows/Linux window: ----------------------------------------------------------------------------- In same directory that contains the test image file built by make and the gdbinit file, enter: /usr/local/bin/arm-elf-gdb --command=gdbinit GDB willcute initialization commands from the gdbinit file when it first starts. Each of the commands in the gdbinit file and it'scution status is shown. This can be useful when debugging a gdbinit file. The gdbinit file included in this demo set up GDB to control the board using ocdremote[Server] via TCP/IP port 127.0.0.1:8888. It resets the board to initialize its system configuration registers. Alternatively you couldcute a series of: monitor char/short/long
= and/or monitor reg = commands to setup the target CPU's configuration registers. It then loads "test" (the ELF format file created by make) into target RAM on the board, sets a breakpoint at main() and runs to main. or ------------------------------------------------------------------------- 4b) Enter Eclipse's Debug Perspective, Launch debug session ------------------------------------------------------------------------- 0) Highlight the project in the Project Explorer View Select the Window ->Preferences from the Eclipse main menu Expand Run/Debug Expand Launching Click on Default Launchers in the Dialog that appears Expand -C/C++ Application Click on -[Debug] In the Dialog screen that appears verify that the "prefered launcher" selected is GDB (DSP) Create Process Launcher Click OK to exit Preferences editor 1) Enter the debug perspective by clicking on the ">>" far right of the Icon list and select Debug.. 2) Click on the arrow next to the Debug (bug)Icon and select Debug Configurations... 3) In the Debug dialog click on : - C/C++ Local Application - STMicro_STR710_DCC_DEMO to bring up it's tabbed windows. 4) The tabbed windows should have the following : MAIN tab: Project : STMicro_STR710_DCC_DEMO C/C++ Application : test.elf ARGUMENTS tab: Program Arguments (table) : (no entries in table) Working Directory: ${workspace_loc:STMicro_STR710_DCC_DEMO} Use Defaults (check box): (unchecked) ENVIROMENT tab: Environment Variables (table) : (no entries in table) DEBUGGER tab: Debugger : gdbserver Debugger Stop on Startup at (check box) : (checked) Stop on Startup at : break_in_crt0 NOTE: Eclipse automatically tells GDB to start the target running at the beginning of a debug session. Checking this check box and selecting a label in your program for it to halt on, causes it to run until it reaches the label and then halt. crt0.s has a label "break_in_crt0" after the first opcode that can be used to immediately halt the CPU at the start of crt0.s. DEBUGGER OPTIONS: MAIN tab: GDB debugger : /usr/local/bin/arm-elf-gdb GDB command file: ./gdbinit Protocol : mi SHARED LIBRARIES tab: Directories (table) : (no entries in table) Load Shared Library Symbols Automatically (check box) : (checked) Stop on shared library events (checkbox) : (unchecked) CONNECTION tab: Type : TCP Host Name or IP Address : localhost Port Number : 8888 OR the port number assigned to this cpu by OcdRemote SOURCE tab: - Default - Path Mapping : found mappings COMMON tab: Shared File (radio box) selected Shared File : \STMicro_STR710_DCC_DEMO Display in Favorites Menu: DEBUG (checkbox) : (checked) Standard Input and output: Allocate Console (check box) : (checked) Launch in background (checkbox) : (checked) 5) Click the Debug button. GDB willcute initialization commands from the gdbinit file when it first starts. Each of the commands in the gdbinit file and it'scution status is shown. This can be useful when debugging a gdbinit file. The gdbinit files included in this demo set up GDB to control the board using ocdremote[Server] via TCP/IP port 127.0.0.1:8888. It resets the board to initialize its system configuration registers. Alternatively you couldcute a series of: monitor char/short/long
= and/or monitor reg = commands to setup the target CPU's configuration registers. It then loads "test" (the ELF format file created by make) into target RAM on the board. Click on the Debug Perspective's "Resume" icon (yellow rectangle with green arrow next to it) to start the program running. It will wait for a packet to arrive via DCC then echo it back to the sender 6) Sending/receiving text via DccTerminal On the DccTerminal screen: enter a line of text, then hit . The line of text just entered will be echoed back by the target program and displayed on the DccTerminal screen. ---------------------------------------------------------------------------- OCDREMOTE MONITOR COMMANDS --------------------------------------------------------------------------- Monitor commands implement various functions that are not available using GDB directly and vary from CPU type to CPU type. You can get the full list of "monitor" commands by issuing the command "monitor help" either from the command line or in Eclipse's console view after GDB has attached to OcdRemote. The commands : monitor help monitor allrun monitor allstop monitor char/short/long monitor char/short/long = monitor endian [] monitor halt monitor reg monitor reg = monitor reset monitor resetrun monitor runfrom monitor set memspace monitor set cpu monitor set/clear hbreak [
] monitor set regbufaddr
monitor sleep monitor softbkpts (off = all gdb operations done with hardware bkpts) monitor status monitor test endian monitor sync cpus are availble for all CPU types. They can becuted either from within a gdbinit file or from the GDB command line/Eclipse console view. ---------------------------------------------------------------------------- SOME USEFUL GDB CONSOLE COMMANDS ---------------------------------------------------------------------------- Some useful text mode commands to to use in the GDB command line or Eclipse console view: s Step, single step a C source code line. si Step Instruction, single step a machine code instruction. c Continue, run the processor after a step or breakpoint. b Breakpoint, set a breakpoint at specified location. hbreak Hardware Breakpoint - set a hardware breakpoint at specified location ^C Control C, stopcution from t ... ...

近期下载者

相关文件


收藏者