Frequently used commands
This document summarizes a number of frequently-used commands that can be run using the command line.
XCC
To compile a program for your development board, enter the following commands:
- xcc -print-targets
XCC displays a list of supported development boards.
- xcc <file> -target=<board> -o <binary>
XCC compiles the file, generating an executable binary for your target board.
XRUN
To load a compiled program onto your development board, enter the following commands:
- xrun -l
XRUN prints an enumerated list of all JTAG adapters connected to your PC and the devices on each JTAG chain, in the form:
ID Name Adapter ID Devices
-- ---- ---------- -------
- xrun –id <n> –io <binary>
XRUN loads your binary onto the hardware connected to the adapter with the specified ID.
The --io option causes XRUN to remain connected to the adapter, providing the standard output stream from your hardware to the terminal.
XGDB
To compile and debug your program, enter the following commands:
- xcc <file> -target=<board> -o <binary> -g
XCC compiles your file with debugging information enabled.
- xgdb bin.xe
GDB loads with a prompt.
- list-devices
GDB prints an enumerated list of all JTAG adapters connected to your PC and the devices on each JTAG chain, in the form:
ID Name Adapter ID Devices
-- ---- ---------- -------
- connect –id <id>
GDB connects to your target hardware.
- load
GDB loads your binary.
- break main
GDB adds a breakpoint to the function main.
- continue
GDB runs the program until it reaches main.
XSIM
To run your program on the simulator, enter the following command:
xsim <binary>
To launch the simulator from within the debugger, at the GDB prompt enter the command:
connect -s
You can then load your program onto the simulator in the same way as if using a development board.