CEXP QuickStart
For CEXP details:
http://www.slac.stanford.edu/comp/unix/package/rtems/src/ssrlApps/cexp/README
Things to remember:
* arrow and backspace keys work (up/down-arrow for history since reboot)
* all commands need parenthesis even if the fcn has no arguments
Popular CEXP commands:
* Memory Access
Dump memory:
Cexp> md(
, , )
Inspect and modify memory:
Cexp> mm(, )
Type '.' to exit, '^' / 'v' to change directions.
can be entered using a standard prefix:
0x1234 -> hex
01234 -> octal
1234 -> decimal
can be 4, 2, or 1 bytes. Default is 4.
is total number of bytes.
Show VME and PCI memory map:
Cexp>BSP_VMEOutboundPortsShow(0)
* Rebooting
To see boot parameters stored in NVRAM:
Cexp> nvramConfigShow()
To see actual boot parameters (may differ from NVRAM if manually changed
from the command line without saving):
Cexp> bootConfigShow()
To update boot parameters:
Cexp> nvramConfig()
To reboot:
beatnik (4.7.1):
Cexp> rtemsReboot()
uC5282:
Cexp> bsp_reset(0)
beatnik, etc (4.9.1)
Cexp> bsp_reset()
* System Monitor
Cexp> memUsageDump(1)
4.7.1 CPU usage:
Cexp> CPU_usage_Reset()
Cexp> CPU_usage_Dump()
4.9.1 CPU usage::
Cexp> rtems_cpu_usage_reset()
Cexp> rtems_cpu_usage_report()
Cexp> rtemsMonitor()
monitor> help *** lists monitor queries ***
monitor> task *** task list ***
monitor> cpuUsageDump
monitor> cpuUsageReset
monitor> memUsageDump 1
monitor> exit
* Network Monitor
Cexp> rtems_bsdnet_show_if_stats()
Cexp> rtems_bsdnet_show_ip_stats()
Cexp> rtems_bsdnet_show_tcp_stats()
Cexp> rtems_bsdnet_show_udp_stats()
Cexp> rtems_bsdnet_show_mbuf_stats()
Cexp> rtems_bsdnet_show_icmp_stats()
Cexp> rtems_bsdnet_show_inet_routes()
4.9.1:
Cexp> rtems_bsdnet_show_socket_stats()
Find IF settings:
Cexp> mmm=0
Cexp> rtems_bsdnet_ifconfig(, SIOCGIFMEDIA, &mmm)
Cexp> rtems_ifmedia2str(mmm,0,0)
* NFS Monitor
Cexp> nfsMountsShow(FILE *f)
Cexp> rpcUdpStats(FILE *f)
stdout if f==NULL
* Status of NTP Daemons and Print NTP-Adjusted System Time
Cexp> rtemsNtpDumpStats()
Cexp> rtemsNtpPrintTime(0)
* Favorite EPICS Commands
Cexp> dbl() *** DB record list ***
Cexp> dbcar() *** CA link list ***
Cexp> dbior() *** Drv/Dev report ***
Cexp> casr() *** CAS report ***
Cexp> dbpr("",5) *** Full DB record dump ***
Cexp> scanppl() *** Scan DB record lists ***
Cexp> iocsh() *** Enter IOC shell ***
* Symbol (Function) Lookup:
Cexp> lkup("")
example:
Cexp> lkup("drv")
===== In module 'bin/multiUse.obj' (0x01d5ac68) =====:
0x019c47ac[ 12]: VOID void drvIpac
0x019c4930[ 12]: VOID void drvTip810
USER VARIABLES:
0x00000000 (0)
* Loading a Module:
Cexp> ld("/.obj")
cexpModuleLoad() (aliased to 'ld') searches PATH for loadable modules.
This may save you some chdir() acrobatics.
* Changing Directory and Invoking a Script:
Cexp> chdir("/boot//") *** Remember the final "/" ***
Cexp> cexp("")
example:
Cexp> chdir("/boot/g/spear/epics/app/spear/iocBoot/iocspear6/")
Cexp> cexp("st.cmd")
* Reprogramming Flash for MVME5500/MVME6100:
BSP_flashWriteFile(int bank_no, uint32_t offset, char *pathname)
will write a file byte-by-byte into flash. The 'pathname' can
conveniently point into a NFS mount.
E.g., to reprogram the flash with a new bootloader version:
Cexp> BSP_flashWriteEnable(0)
Cexp> BSP_flashWriteFile(0,0,"/boot/package/rtems//powerpc-rtems/beatnik/img/netboot.flashimg.bin")
Usually, we store the bootloader at offset 0 (the motload script looks
there) and it occupies < 1MB. Other regions of the flash can be used
for other purposes but it's recommended to reserve ~2MB at the beginning
in case the bootloader grows.
More info/API about the flash on the MVME5500/6100 boards is in