launch-master-page
In addition to the Qt5 QML language for scripting used for flashing the demos, most common SAM-BA action can be done using SAM-BA command line.
For browsing information on the SAM-BA command line usage, please see the Command Line Documentation that is available in the SAM-BA installation directory: doc/index.html or doc/cmdline.html .
SAM-BA includes command line interface that provides support for the most common actions:
- reading / writing to arbitrary memory addresses and/or peripherals
- uploading applets and using them to erase/read/write external memories
The command line interface is designed to be self-documenting.
The main commands can be listed using the "sam-ba --help" command:
Copyright 2025 Microchip Technology
Usage: sam-ba [options]
Options:
-v, --version Displays version information.
-h, --help Displays this help.
-l, --loglevel <log_level[:options:...]> Set verbose log 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>.
-t, --tracelevel <trace_level> Set applet trace level to
<trace_level>.
-L, --applet-buffer-limit <SIZE> Set applet buffer limit to <SIZE>
bytes (default 131072).
-w, --working-directory <DIR> Set working directory to <DIR>.
-u, --utils <tool[:args:...]> Launch a tool <tool> .
If you get the following error, it indicates a symbol mismatch or unresolved symbol when the sam-ba executable is being loaded
sam-ba: symbol lookup error: sam-ba: undefined symbol: _ZdlPvm, version Qt_5
Check for Qt libraries inside the extracted SAM-BA directory.
$ export LD_LIBRARY_PATH=$(pwd)/lib:$LD_LIBRARY_PATH
Additional help can be obtained for most commands by supplying a "help" parameter that will display their usage.
For example "sam-ba --port help" will display:
Command that take an argument with options (port, monitor, applet) will display even more documentation when called with "help" as option value.
For example "sam-ba --port serial:help" will display:
serial:[<port>]:[<baudrate>]
Examples:
serial serial port (will use first AT91 USB if found otherwise first serial port)
serial:COM80 serial port on COM80
serial:ttyUSB0:57600 serial port on /dev/ttyUSB0, baudrate 57600