rce platform technology (rpt) jim panetta ([email protected]) tool installation
TRANSCRIPT
2
Overview: What you should get from this talk
• Supported systems (host and target)
• Suggested software
• Software Development Kit (SDK) concepts
• SDK installation on host and target
• Cross development tools installation
• Host tools in the SDK
• Communication between the host and the SDK
• The RTEMS shell
• Serial console
3
Supported Systems
Linux Host Systems• Red Hat Enterprise Linux 5 & 6
• Scientific Linux 5 & 6
• 32-bit (i86) and 64-bit (x86_64)
• telnet, ssh, git, expect, bash
Target System• RCE Platform
• RTEMS kernel or Bare Metal- RPT Core Enhancements
• ARM Cortex-A9
• (Future) Arch Linux
4
SDK Core Concepts
Software Development Kit
• Support host-side development- Compile on host, deploy on target
• Self contained – Small footprint
• Multiple SDKs – As many or as few as needed
Contents
• Tools for building code for host and target
• Tools for host-side maintenance of targets
• APIs and Example code (afternoon session)
5
SDK Core Concepts (cont.)
Software Development Kits are not:
• Build Systems- Tools to add to your build system
• Compilers, Linkers and Debuggers- RPT group points to suggested set
Versioning: VM-m-p – Major-minor-patch
• Major: New Interfaces. May be backward incompatible
• Minor: New code. Backward compatible
• Patch: Bug fixes
• For the workshop: V0.7.1-WS
Read the RELEASE_NOTES on the web or in the SDK
6
SDK Installation
All SDKs are accessible via the Net
• Currently distributed with git:git clone -q \
http://www.slac.stanford.edu/projects/CTK/SDK/arm-rtems-rceCA9.git
cd arm-rtems-rceCA9; git checkout –q V0.7.2-WS
• Install the cross compilation tools if needed (RTEMS only)
• Finalize the install by fetching libraries, includes and
compiling the template code:arm-rtems-rceCA9/tools/install-sdk.sh
• Add the RPT environment to yours:source arm-rtems-rceCA9/tools/envs.{csh,sh}
7
SDK Installation (continued)
SDKs install in minutes
• 10 to 50 MiB in size, depending on architecture
Contents:
• Bootstrap support• Bootable Image• RPT Core• Configuration Database
• Host-side tools• Shared libraries• Include files• Example code• README, TAG
Items in blue are only in the RTEMS SDK
8
Cross Compiler Installation (RTEMS)
• To Install cross compilers:sudo <install_location>/tools/install-devtools.sh
• Provided by RTEMS community
• RPM format
• arm-rtems4.11-*
• gcc, g++, ld, objdump, etc.
• Script installs via yum in /opt/rtems-4.11/
• May be installed wherever
• Need to be in $PATH
• Wrapper scripts in $SDK_RTEMS/bin
• rtems-gcc, rtems-g++, rtems-ld
• rtems-task, rtems-svt
9
Host Tools for Administration – Communications
Most host tools use a pub/sub
mechanism:
• All servers are listening for
messages.
• Client broadcasts query.
• If a server matches the
query, it sends a direct
response to client
• Host/target type doesn't
matter.
s
Client?
!
c
Server
c
s
?
!
10
Host Tools – Addressing
Addressing of RCEs is based on physical or ATCA location
shelf/slot/bay/element
• shelf – The shelf name (i.e. snowbird)
• slot – The physical slot number (1 – 16)
• bay – The bay number (0 – 4)
• element – The specific RCE on the DPM (0, 2)
For shelf manager commands, this changes to:
shelfmanager/slot/bay/element
• shelfmanager – The shelf manager IP info
(i.e. snowbird-sm)
11
Host Tools for Administration
Map ATCA space (shelf/slot/bay/element) to IP info
• atca_dump: dump the ATCA info to a terminal
• Useful if you just want a printout.$ atca_dump tinker/1/4/0 --ifname eth1.202
Mapped tinker/1/4/0 to this location... Layer 3 Port: 0 (decimal)
Layer 3 Address: 192.168.202.254 Layer 2 Address: 08:00:56:00:43:F2
• atca_ip: return the formatted IP address inline$ ping $(atca_ip tinker/1/4/0 --ifname eth1.202)
PING 192.168.202.254 (192.168.202.254) 56(84) bytes of data.
64 bytes from 192.168.202.254: icmp_seq=1 ttl=64 time=2.22 ms
• atca_mac: return the formatted MAC address inline
12
Host Tools for Administration (continued)
• dsl_identify address_wc [--ifname ifname]Determine running OS on RCEs.
• dsl_reboot address_wc [--ifname ifname ] [--os os]Remotely reboot one or more RCEs, optionally to another OS
(linux|rtems|ramdisk)
• Both dsl_identify and dsl_reboot use an address form
that allows wild cards: shelf[/slot[/bay[/rce]]]
• Everything after shelf is optional. slot may contain ALL. bay
may also be one of ALL, DPM, DTM. rce may be ALL.
• These commands require that the RCE be "alive."
Note: it is an error to dsl_reboot bay ALL to rtems.
13
Host Tools for Administration (continued)
Sometimes in an embedded environment, the system
crashes hard. For these circumstances, you need a way to
reset the system from outside. • cob_rce_reset shelfmanager_ip[/slot[/bay[/rce]]]
Send a soft reset to the RCE.
• cob_cold_data_reset shelfmanager_ip[/slot[/bay[/rce]]]Send a reset on the RCE and re-read the cold data store.
Equivalent to removing the board from the shelf.
• These commands use a similar wildcard form to
dsl_identify. The main difference is that
shelfmanager_ip is not a shelf name. It is the IP
address (or network name) of the shelf manager.
14
Terminal Shell / Direct interaction
In development, the preferred way to interact with the RCE
is through the shell. From bash or tcsh:• $ telnet $(atca_ip $shelf/$slot/$bay/$element)
• $ telnet `atca_ip $shelf/$slot/$bay/$element`Trying 192.168.202.7...
Connected to 192.168.202.7.
Escape character is '^]'.
RTEMS SHELL (Ver.1.0-FRC):/dev/pty0. Feb 16 2014. 'help' to list commands.
[/] #
• RTEMS shell is not bash or tcsh!
• There is no pipe or redirect
15
Terminal Shell Commands (RTEMS)
Standard RTEMS commands:
• help [topic]The most important command.
• mdump/wdump/ldump [address [length]]Examine memory by byte, word and longword
• ifconfigDump the network interface statistics
• taskShow what tasks are running.
• cpuuseShow what tasks are using CPU.
16
Terminal Shell / Direct interaction (continued)
Standard RTEMS commands:
• ls, cd, mv, rm
• mkdir path
• mount -t nfs a.b.c.d:/export/path pathMount an NFS drive
• unmount pathUnmount a directory. (Note: Linux uses umount)
17
Terminal Shell / Direct interaction (continued)
RPT added RTEMS commands:
• syslog [-c]Dump the system log. (-c clears the log)
• sysinfoDump the system information, including firmware
versions, serial numbers, and shelf address.
• reboot [-t rtems|linux|ramdisk]Cleanly reboot the system, unmounting all disks,
optionally to another OS.
• suspend/resume [<ID>|<name>]Suspend or resume a task by ID or name.
18
Terminal Shell / Direct interaction (continued)
RPT added RTEMS commands for code development: [*]
• ns_assign namespace pathAssign a namespace to a path.
• ns_rename namespace pathSet an existing namespace to a new path.
• ns_map namespace:imagePrint the path to an image in a namespace.
• ns_remove namespace
• load namespace:imageLoad a shared library.
• run namespace:imageLoad and run a task. [*] see software dev talk
19
Serial Console
There are rare times when the only way to get to a system
is through a serial console. Each RCE has one.
• Connect to the DTM via ssh.
• DTM is in bay 4, element 0.
• User/pw is root/root. [*]
• Use minicom on the DTM
• minicom bay0.2
During a crash, there is a micro-shell
• examine memory and registers and syslog & reboot
[*] (embedded system, don't put it on the WAN)
20
SD Card Partition Structure (32 GB µSD)
• BOOT – Bootstrap, FPGA bit file (not mounted RTEMS)
• SCRATCH – User writable partition (r/w)
(largest partition ~ 16 GB, not mounted by default)
• RTEMSAPP – Application and configuration files (r/w)
• RTEMS – RPT RTEMS kernel files
(mounted read-only)
• ArchLinux – System files for ARM Linux
(not mountable on RTEMS)
• LinuxKernel – Linux kernel files
(not mountable on RTEMS)
21
Updating RPT Software on Target
To update the RPT with a new SDK, use the i86 SDK:• tools/packageSDK arm_sdk_path tarfile.tar• tools/updateRCE rce_address tarfile.tar
[ifname]
• bash scripts using ssh & expect
• (Better mechanism in development)
For user software:• mkdir /mnt/scratch• mount -t dosfs /dev/sdA2 /mnt/scratch
• Then copy from an NFS mounted directory.