Introduction
Control of the SAM-BA® host application program is from the command line. If you are using Windows®, open a command prompt. If you are using Linux®, open a terminal window.
As a best practice, be sure to add the SAM-BA directory to the PATH of your environment variables so that you can execute SAM-BA commands from your project directories.
Command line options are subject to change between versions of the SAM-BA host application program.
Help
The-h, --help option will print out the available commands specific to the version of the SAM-BA host application program.
$sam-ba –-help
SAM-BA Command Line Tool v3.3.1Copyright 2018 Microchip TechnologyUsage: sam-ba [options]Options: -v, --version Displays version information. -h, --help Displays this help. -t, --tracelevel <trace_level> Set trace level to <trace_level>. -x, --execute <script.qml> Execute script <script.qml>. -p, --port <port[:options:...]> Communicate with device using <port>. -d, --device <device[:options:...]> Connected device is <device>. -b, --board <board[:options:...]> Connected board is <board>. -m, --monitor <command[:options:...]> Run monitor command <command>. -a, --applet <applet[:options:...]> Load and initialize applet <applet>. -c, --command <command[:args:...]> Run command <command>. -w, --working-directory <DIR> Set working directory to <DIR>.The SAM-BA host application program communicates with the target device which has the SAM-BA monitor program embedded in its ROM boot code. Setup of the host to monitor serial communications is performed with the-p, --port option. For additional information, see"SAM-BA Host to Monitor Serial Communications".
The SAM-BA host application program is configured to communicate with specific targets using the-d, --device and-b, --board options. For additional information, see"Supported Devices and Evaluation Kits".
SAM-BA monitor commands can be executed from the SAM-BA host application program using the-m, --monitor option. For additional information, see"SAM-BA Monitor Commands".
The SAM-BA host application program can load and execute binary Applet programs in the target device RAM to provide additional features and capabilities using the-a, --applet option. For more information, see"SAM-BA Applets".
SAM-BA Applet programs can provide status and logging information through the Target Console. The verbosity can be set with the-t, --tracelevel options. For more information, see"Target Console Serial Communications".
The SAM-BA host can executeQt Modeling Language (QML) scripts to combine many low-level commands to simplify development and debugging using the-x, --execute and-c, --command options. For more information, see"SAM-BA Host QML Scripts".
Additional help information can be found for each of the individual options adding thehelp argument. For example:
$sam-ba —port help
Known ports: serial, j-link, secure


