Changes between Version 20 and Version 21 of TBR/BSP/Leon3


Ignore:
Timestamp:
Jan 14, 2015, 11:51:25 AM (5 years ago)
Author:
daniel.cederman
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TBR/BSP/Leon3

    v20 v21  
    2222}}}
    2323
    24 This BSP is for the [http://gaisler.com/index.php/products/processors LEON3/4 SPARC V8 processor] developed by [http://www.gaisler.com Cobham Gaisler]. LEON3/4 is available as a synthesizable VHDL model, allowing custom implementations on FPGA and/or ASIC. The LEON3/4 BSP probes AMBA Plug&Play information for basic peripherals such as interrupt controller, timer, and UART. Probing the Plug&Play makes it possible for the BSP to supports many LEON3/4 based controllers and boards. The basic peripherals supported:
     24This BSP is for the [http://gaisler.com/index.php/products/processors LEON3/4 SPARC V8 processor] developed by [http://www.gaisler.com Cobham Gaisler]. LEON3/4 is available as a synthesizable VHDL model, allowing custom implementations on FPGA and/or ASIC. The LEON3/4 BSP probes AMBA Plug&Play information for basic peripherals such as interrupt controller, timer, and UART. Probing the Plug&Play makes it possible for the BSP to supports many LEON3/4 based controllers and boards. The BSP supports both SMP and AMP configurations.
     25
     26The basic peripherals supported:
    2527
    2628 *  IRQMP, IRQAMP
     
    8183the network driver to work properly.
    8284
    83 = Console forwarding to GRMON =
    84 
    85 With the -u option to GRMON, GRMON will set one UART in "debug-mode" or loop-back (older hardware) mode in order to tunnel the UART output/input over the debug-link to the PC instead of at the physical UART connector of the PCB.
    86 
    87 Note that it is not possible to use the interrupt mode of the driver together with the "old" APBUART and -u to GRMON. However the new
     85= GRMON =
     86
     87[http://www.gaisler.com/index.php/products/debug-tools/grmon2 GRMON] is a general debug monitor for the LEON processor. It is used to download, execute, and debug applications for LEON-based systems.
     88This section gives a quick overview of some basic operations. For more information, see the [http://www.gaisler.com/doc/grmon2.pdf GRMON manual].
     89
     90== Loading an RTEMS Application ==
     91
     92Start GRMON with the flag corresponding to debug link you want to use (for example `-usb`). To tunnel console output (see below), use the `-u` flag.
     93
     94{{{
     95  GRMON2 LEON debug monitor
     96 
     97  Copyright (C) Aeroflex Gaisler - All rights reserved.
     98  For latest updates, go to http://www.gaisler.com/
     99  Comments or bug-reports to support@gaisler.com
     100
     101Parsing -usb
     102Parsing -u
     103
     104  Device ID:           0x281
     105  GRLIB build version: 4114
     106  Detected system:     NGMP FP
     107  Detected frequency:  150 MHz
     108 
     109  Component                            Vendor
     110  JTAG Debug Link                      Aeroflex Gaisler
     111  GRSPW2 SpaceWire Serial Link         Aeroflex Gaisler
     112  EDCL master interface                Aeroflex Gaisler
     113  EDCL master interface                Aeroflex Gaisler
     114  USB Debug Communication Link         Aeroflex Gaisler
     115  LEON4 SPARC V8 Processor             Aeroflex Gaisler
     116  LEON4 SPARC V8 Processor             Aeroflex Gaisler
     117  LEON4 SPARC V8 Processor             Aeroflex Gaisler
     118  LEON4 SPARC V8 Processor             Aeroflex Gaisler
     119  ...
     120  General Purpose Register Bank        Aeroflex Gaisler
     121 
     122  Use command 'info sys' to print a detailed report of attached cores
     123
     124grmon2>
     125}}}
     126
     127The application can then be loaded onto the LEON system by using the `load` command.
     128
     129{{{
     130grmon2> load testsuites/smptests/smp01/smp01.exe
     131  00000000 .text                    132.8kB / 132.8kB   [===============>] 100%
     132  00021320 .data                      1.5kB /   1.5kB   [===============>] 100%
     133  Total size: 134.25kB (24.99Mbit/s)
     134  Entry point 0x0
     135  Image testsuites/smptests/smp01/smp01.exe loaded
     136}}}
     137
     138Execute the application with the `run` command.
     139
     140{{{
     141grmon2> run
     142
     143*** BEGIN OF TEST SMP 1 ***
     144 CPU 3 start task TA0
     145 CPU 2 running Task TA0
     146 CPU 3 start task TA1
     147 CPU 1 running Task TA1
     148 CPU 3 start task TA2
     149 CPU 0 running Task TA2
     150*** END OF TEST SMP 1 ***
     151 
     152  CPU 0:  Power down mode
     153  CPU 1:  Power down mode
     154  CPU 2:  Power down mode
     155  CPU 3:  Program exited normally.
     156 
     157grmon2>
     158}}}
     159
     160Information about available RTEMS tasks can be listed using the `thread info` command.
     161
     162{{{
     163grmon2> thread info
     164    NAME  TYPE      ID          CPU  PRIO  TIME (h:m:s)     ENTRY POINT              PC                                            STATE
     165    IDLE  internal  0x09010001    -   255  0:0:0.000000000  pwdloop                  0x0000197c <pwdloop+0x0>                      READY
     166    IDLE  internal  0x09010002    -   255  0:0:0.000000000  pwdloop                  0x0000197c <pwdloop+0x0>                      READY
     167    IDLE  internal  0x09010003    -   255  0:0:0.000000000  pwdloop                  0x0000197c <pwdloop+0x0>                      READY
     168    IDLE  internal  0x09010004    -   255  0:0:0.000000000  pwdloop                  0x0000197c <pwdloop+0x0>                      READY
     169    UI1   classic   0x0a010001    3     1  0:0:0.000000000  Init                     0x00002ca0 <syscall+0x0>                      READY
     170    TA0   classic   0x0a010002    2     1  0:0:0.000000000  Test_task                0x0000197c <pwdloop+0x0>                      READY
     171    TA1   classic   0x0a010003    1     1  0:0:0.000000000  Test_task                0x0000197c <pwdloop+0x0>                      READY
     172  * TA2   classic   0x0a010004    0     1  0:0:0.000000000  Test_task                0x0000197c <pwdloop+0x0>                      READY
     173grmon2>
     174
     175}}}
     176
     177== Connecting GDB to GRMON ==
     178
     179GRMON can act as a remote target for GDB. To enable the GDB support, start GRMON with the `-gdb` flag or use the `gdb start` command inside GRMON.
     180
     181{{{
     182grmon2> gdb start
     183  Started GDB service on port 2222.
     184}}}
     185
     186Connect to the GDB service of GRMON by entering the following commands in GDB:
     187
     188{{{
     189(gdb) target extended-remote :2222
     190(gdb) symbol-file testsuites/smptests/smp01/smp01.exe
     191(gdb) set remote exec-file testsuites/smptests/smp01/smp01.exe
     192}}}
     193
     194GRMON commands can be entered in GDB by prepending them with `monitor`. For example:
     195
     196{{{
     197(gdb) monitor info reg greth0
     198GR Ethernet MAC
     199    0xff940000  Control register                        0x9e000000
     200    0xff940004  Status register                         0x00000000
     201    0xff940008  MAC address MSB                         0x00006010
     202    0xff94000c  MAC address LSB                         0x00000081
     203    0xff940010  MDIO register                           0x7949084a
     204    0xff940014  Tx descriptor register                  0x4de06000
     205    0xff940018  Rx descriptor register                  0x00000000
     206    0xff94001c  EDCL IP register                        0xc0a8001f
     207}}}
     208
     209== Console forwarding to GRMON ==
     210
     211Starting GRMON with the `-u` flag will set one UART in "debug-mode" or loop-back (older hardware) mode. UART output/input is then tunneled over the debug-link to the PC, instead of at the physical UART connector of the PCB,
     212and presented in GRMON.
     213
     214Note that it is not possible to use the interrupt mode of the driver together with the "old" APBUART and `-u` to GRMON. However the new
    88215APBUART core (from GRLIB 1.0.17-b2710) has the GRMON debug bit and can handle interrupts. Please see the [http://www.gaisler.com/doc/grmon2.pdf GRMON manual].
    89216