Skip to content

Commit

Permalink
Init repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
SayCV committed Aug 23, 2014
0 parents commit 8bacd23
Show file tree
Hide file tree
Showing 99 changed files with 21,962 additions and 0 deletions.
69 changes: 69 additions & 0 deletions 1553/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# RTEMS SPARC Compiler (4.10)
CC=/opt/rtems-4.10/bin/sparc-rtems-gcc

# Location of Driver-Manager Configuration Files
CFGDIR=..

# Build flags
CFLAGS=-g3 -O0 -Wall
LIBS=

# CPU Dependent compiler config
LEON2= -qleon2
LEON3=

.PHONY:all rtems-gr1553bm rtems-gr1553bcbm rtems-gr1553rtbm linux_client test1
all: rtems-gr1553bm rtems-gr1553bcbm rtems-gr1553rtbm

# BC and BM
rtems-gr1553bcbm:
$(CC) $(CFLAGS) -c time.c
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON3) -DSOFT_EXTTRIG_ENABLE rtems-gr1553bcbm.c -o rtems-gr1553bcbm time.o $(LIBS)
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON3) rtems-gr1553bcbm.c -o rtems-gr1553bcbm-exttrig time.o $(LIBS)
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON2) -DSOFT_EXTTRIG_ENABLE -DAMBA_OVER_PCI rtems-gr1553bcbm.c -o rtems-gr1553bcbm-leon2 time.o $(LIBS)
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON2) -DAMBA_OVER_PCI rtems-gr1553bcbm.c -o rtems-gr1553bcbm-leon2-exttrig time.o $(LIBS)

# Linux TCP/IP client talking with BM in rtems-gr1553bcbm example
#
# Note that if only builds when the rtems-gr1553bcbm example has been configured
# to support TCP/IP server. See config_bm.h
linux_client:
gcc -Wall -g3 -O0 linux_client.c -o linux_client

# RT and BM
rtems-gr1553rtbm:
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON3) rtems-gr1553rtbm.c -o rtems-gr1553rtbm $(LIBS)
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON2) -DAMBA_OVER_PCI rtems-gr1553rtbm.c -o rtems-gr1553rtbm-leon2 $(LIBS)

# BM only
rtems-gr1553bm:
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON3) rtems-gr1553bm.c -o rtems-gr1553bm $(LIBS)
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON2) -DAMBA_OVER_PCI rtems-gr1553bm.c -o rtems-gr1553bm-leon2 $(LIBS)

# A AT697+GR-RASTA-IO (BC) TimeMaster distibuting time via SpaceWire to
# A LEON3 GR-RASTA-105 TimeSlave (BC). The GR1553B BC core distributes time onto a 1553 bus to
# A Standard LEON3 with GR1553B RT core acting as a RT Time Slave
test1:
# The Two BC Apps
mkdir -p test1
$(CC) $(CFLAGS) -c time.c
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON3) -DTIME_SYNC_MANAGEMENT \
rtems-gr1553bcbm.c -o test1/rtems-gr1553bcbm-test1-leon3 time.o $(LIBS)
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON2) -DAMBA_OVER_PCI -DTIME_SYNC_MANAGEMENT -DTIME_SYNC_MASTER \
rtems-gr1553bcbm.c -o test1/rtems-gr1553bcbm-test1-leon2 time.o $(LIBS)
# The RT Application
$(CC) $(CFLAGS) -I$(CFGDIR) $(LEON3) rtems-gr1553rtbm.c -o test1/rtems-gr1553rtbm-test1-leon3 $(LIBS)


clean:
rm -rf \
*.o \
rtems-gr1553bm \
rtems-gr1553bm-leon2 \
rtems-gr1553rtbm \
rtems-gr1553rtbm-leon2 \
rtems-gr1553bcbm \
rtems-gr1553bcbm-exttrig \
rtems-gr1553bcbm-leon2 \
rtems-gr1553bcbm-leon2-exttrig \
linux_client
101 changes: 101 additions & 0 deletions 1553/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
OVERVIEW
========

This directory contains three examples:
� BM Example
� Combined BC & BM Example
� Combined RT & BM Example

The BC example can be used together with the RT example. The RT has RT address
5. The BC will set up a transfer list with startup and shutdown sequence of
major frames, and a communication sequence of 8 Majorframes with TimeSync and
communication frame Sync.

The BC and RT examples can be run separately, however the BC and RT will be
stuck in the initialization procedure of the 1553.

The BM part of the BC&BM/RT&BM example monitors the 1553 bus. The BM DMA area log is
copied to a larger "non-DMA" area which may be compressed and copied to a Linux
PC using a TCP/IP socket. An example Linux TCP/IP application is included which
stores the 1553 log to a file for custom proccessing.

FILES
=====

� BM example
- bm_logger.c - BM Logger
- config_bm.h - 1553 BM Log Config for RTEMS & Linux app
- ethsrv.c & .h - 1553 BM Log Ethernet Server
- rtems-gr1553bm.c - RTEMS 1553 BM example application

� Combined BC & BM example
- bc_list.c - 1553 BC Transfer List creation/handling
- bm_logger.c - BM Logger
- config_bm.h - 1553 BM Log Config for RTEMS & Linux app
- ethsrv.c & .h - 1553 BM Log Ethernet Server
- rtems-gr1553bcbm.c - RTEMS BC & BM example application
- linux_client.c - Linux TCP/IP 1553 BM Log to file application

� Combined BC & BM example
- bm_logger.c - BM Logger
- config_bm.h - 1553 BM Log Config for RTEMS & Linux app
- ethsrv.c & .h - 1553 BM Log Ethernet Server
- rtems-gr1553rtbm.c - RTEMS 1553 RT & BM example application


� Driver Manager Configuration Files used in all examples:
- config.c - Major Configuration, included from project
- config_gr_rasta_io.c - GR-RASTA-IO PCI Board Configuration
- config_leon2_drvmgr.c - Used in LEON2 non-PnP Systems (AT697 similar)
- config_leon2_grlib_drvmgr.c - Used in LEON2 GRLIB PnP Systems
- config_leon3_drvmgr.c - Used in LEON3 GRLIB PnP Systems

� BM Linux example client
- linux_client.c - Linux TCP/IP 1553 BM Log to file application
- log-bc-rt-exttrig.txt - BM LOG produced by BCBM and RTBM example viewed
from BC. Note format is different from raw BM
LOG.

1553 Driver sources used
========================

The 1553 BC/BM/RT sources used by the examples:

- gr1553.c - BC, BM and RT device allocation driver
- gr1553.h
- gr1553bc.c - BC Device driver
- gr1553bc.h
- gr1553bc_list.c - BC List processing driver
- gr1553bc_list.h
- gr1553bm.c - BM Device Driver
- gr1553bm.h
- gr1553rt.c - RT Device Driver
- gr1553rt.h


BUILDING EXAMPLES
=================
1. Install Free RTEMS-4.10 toolchain from Aeroflex Gaisler web site.
2. Install it to /opt/ and add /opt/rtems-4.10/bin to PATH
3. run 'make' in this directory


TEST1 SETUP
===========
Test1 is an example setup with three boards:
- A AT697+GR-RASTA-IO (BC) TimeMaster distibuting time via SpaceWire to
- A LEON3 GR-RASTA-105 TimeSlave (BC). The GR1553B BC core distributes time onto a 1553 bus to
- A Standard LEON3 with GR1553B RT core acting as a RT Time Slave

Test1 is a configuration of the 1553 examples, see test1 in Makefile.

The SpaceWire connector 0 on the GR-RASTA-IO must be connected to the
GR-RASTA-105 SpaceWire connector 0. It is needed for sending/receiving timecodes
generated by SPWCUC/GRCTM and Time-Packets generated by Software.

Note that ONLY the first Time-Packet send has the INIT bit set.

Build example by doing 'make test1', the binaries are found in the test1
subdirectory:
$ make test1
$ ls -l test1/
Loading

0 comments on commit 8bacd23

Please sign in to comment.