.\" Automatically generated by Pandoc 2.17.1.1 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "MBEDLS" "1" "December 2018" "1.6.2+dfsg" "User Commands" .hy .SH NAME .PP \f[B]mbedls\f[R] - detect and list Mbed Enabled devices connected to the host computer .SH SYNOPSIS .PP \f[B]mbedls\f[R] [\f[B]--simple\f[R]|\f[B]--json\f[R]] [\f[B]--debug\f[R]] .PP \f[B]mbedls\f[R] \f[B]--list\f[R] .PP \f[B]mbedls\f[R] \f[B]--mock\f[R] \f[I]ID:NAME\f[R] .PP \f[B]mbedls\f[R] \f[B]--help\f[R] .PP \f[B]mbedls\f[R] \f[B]--version\f[R] .SH DESCRIPTION .PP \f[B]mbedls\f[R] detects and lists ARM Mbed Enabled devices connected to the host computer. .PP It provides the following information for all connected boards in a console (terminal) output: .IP \[bu] 2 Mbed OS platform name .IP \[bu] 2 mount point (MSD or disk) .IP \[bu] 2 serial port .PP \f[B]mbedls\f[R] requires that an Mbed device be mounted before it shows up in the results. Many systems do not automatically mount USB devices. It is recommended that you use an automounter to manage this for you. .SH OPTIONS .TP -s, --simple list attached targets without column headers and borders .TP -j, --json list attached targets with detailed information in JSON format .TP -J, --json-by-target-id map attached targets from their target ID to their detailed information in JSON format .TP -p, --json-platforms list attached platform names in JSON format .TP -P, --json-platforms-ext map attached platform names to the number of attached boards in JSON format .TP -l, --list list all target IDs and their corresponding platform names understood by \f[B]mbedls\f[R] .TP -m, --mock \f[I]ID:NAME\f[R] substitute or create a target ID to platform name mapping used when invoking \f[B]mbedls\f[R] in the current directory .TP --skip-retarget skip parsing and interpretation of the re-target file, \f[V]./mbedls.json\f[R] .TP -u, --list-unmounted list mbeds, regardless of whether they are mounted or not .TP -d, --debug outputs extra debug information useful when creating issues! .TP --help print usage details and exit .TP --version print package version and exit .SH RESULT FORMATS .PP The \f[B]mbedls\f[R] command-line accepts a few arguments to change the format of the results. The default format is a table. You may pass \f[V]--simple\f[R] to simplify this table format, and \f[V]--json\f[R] to print the table as a JSON list of the rows. .SS Simple (no table formatting) .IP .nf \f[C] $ mbedls --simple K64F K64F[0] D: COM18 0240000032044e4500257009997b00386781000097969900 0244 \f[R] .fi .SS JSON .IP .nf \f[C] $ mbedls --json [ { \[dq]daplink_auto_reset\[dq]: \[dq]0\[dq], \[dq]daplink_automation_allowed\[dq]: \[dq]1\[dq], \[dq]daplink_bootloader_crc\[dq]: \[dq]0xa65218eb\[dq], \[dq]daplink_bootloader_version\[dq]: \[dq]0242\[dq], \[dq]daplink_daplink_mode\[dq]: \[dq]Interface\[dq], \[dq]daplink_git_sha\[dq]: \[dq]67f8727a030bcc585e982d899fb6382db56d673b\[dq], \[dq]daplink_hic_id\[dq]: \[dq]97969900\[dq], \[dq]daplink_interface_crc\[dq]: \[dq]0xe4422294\[dq], \[dq]daplink_interface_version\[dq]: \[dq]0244\[dq], \[dq]daplink_local_mods\[dq]: \[dq]0\[dq], \[dq]daplink_overflow_detection\[dq]: \[dq]1\[dq], \[dq]daplink_remount_count\[dq]: \[dq]0\[dq], \[dq]daplink_unique_id\[dq]: \[dq]0240000032044e4500257009997b00386781000097969900\[dq], \[dq]daplink_usb_interfaces\[dq]: \[dq]MSD, CDC, HID\[dq], \[dq]daplink_version\[dq]: \[dq]0244\[dq], \[dq]mount_point\[dq]: \[dq]D:\[dq], \[dq]platform_name\[dq]: \[dq]K64F\[dq], \[dq]platform_name_unique\[dq]: \[dq]K64F[0]\[dq], \[dq]product_id\[dq]: \[dq]0204\[dq], \[dq]serial_port\[dq]: \[dq]COM18\[dq], \[dq]target_id\[dq]: \[dq]0240000032044e4500257009997b00386781000097969900\[dq], \[dq]target_id_mbed_htm\[dq]: \[dq]0240000032044e4500257009997b00386781000097969900\[dq], \[dq]target_id_usb_id\[dq]: \[dq]0240000032044e4500257009997b00386781000097969900\[dq], \[dq]vendor_id\[dq]: \[dq]0d28\[dq] } ] \f[R] .fi .SH MOCKING (RENAMING) PLATFORMS .PP Override a platform\[cq]s name using the \f[V]--mock\f[R] parameter: .IP .nf \f[C] $ mbedls --mock 0240:MY_NEW_PLATFORM $ mbedls +-----------------+----------------------+-------------+-------------+--------------------------------------------------+-----------------+ | platform_name | platform_name_unique | mount_point | serial_port | target_id | daplink_version | +-----------------+----------------------+-------------+-------------+--------------------------------------------------+-----------------+ | MY_NEW_PLATFORM | MY_NEW_PLATFORM[0] | D: | COM18 | 0240000032044e4500257009997b00386781000097969900 | 0244 | +-----------------+----------------------+-------------+-------------+--------------------------------------------------+-----------------+ \f[R] .fi .PP The \f[V]--mock\f[R] parameter accepts a platform ID and a platform name, separated by the \f[V]:\f[R] character. The platform ID is the first 4 characters of the \f[V]target_id\f[R]. The platform name is the name you are temporarily assigning to this platform. .PP To remove a mocked platform, use the \f[V]--mock\f[R] parameter again. Continuing from the previous example, use \f[V]-\f[R] as the value: .IP .nf \f[C] $ mbedls --mock -0240 $ mbedls +---------------+----------------------+-------------+-------------+--------------------------------------------------+-----------------+ | platform_name | platform_name_unique | mount_point | serial_port | target_id | daplink_version | +---------------+----------------------+-------------+-------------+--------------------------------------------------+-----------------+ | K64F | K64F[0] | D: | COM18 | 0240000032044e4500257009997b00386781000097969900 | 0244 | +---------------+----------------------+-------------+-------------+--------------------------------------------------+-----------------+ \f[R] .fi .PP You can also remove all mocked platforms by supplying \f[V]*\f[R] as the \f[V]target_id\f[R]: .IP .nf \f[C] $ mbedls --mock=\[dq]-*\[dq] \f[R] .fi .PP \f[B]NOTE:\f[R] Due to a quirk in the parameter formatting, the command-line can interpret \f[V]-*\f[R] as another parameter instead of a value. It is necessary to use the complete \f[V]--mock=\[dq]-*\[dq]\f[R] syntax, so the command-line interprets each part of the command correctly. .SH RETARGETTING PLATFORMS .PP It is possible to change the returned results for certain platforms depending on the current directory. This is especially useful when developing new platforms. .PP The command-line tool and Python API check the current directory for a file named \f[V]mbedls.json\f[R]. When it is present, it overrides the returned values. The format of the \f[V]mbedls.json\f[R] file is: .IP .nf \f[C] { \[dq]\[dq]: { \[dq]\[dq]: \[dq]\[dq] } } \f[R] .fi .PP For example, to change the \f[V]serial_port\f[R] of the K64F with a \f[V]target_id\f[R] of \f[V]0240000032044e4500257009997b00386781000097969900\f[R], the \f[V]mbedls.json\f[R] file contains the following: .IP .nf \f[C] { \[dq]0240000032044e4500257009997b00386781000097969900\[dq]: { \[dq]serial_port\[dq]: \[dq]COM99\[dq] } } \f[R] .fi .PP This results in the following output from the command-line tool: .IP .nf \f[C] $ mbedls +---------------+----------------------+-------------+-------------+--------------------------------------------------+-----------------+ | platform_name | platform_name_unique | mount_point | serial_port | target_id | daplink_version | +---------------+----------------------+-------------+-------------+--------------------------------------------------+-----------------+ | K64F | K64F[0] | D: | COM99 | 0240000032044e4500257009997b00386781000097969900 | 0244 | +---------------+----------------------+-------------+-------------+--------------------------------------------------+-----------------+ \f[R] .fi .PP Note how the \f[V]serial_port\f[R] value changed from \f[V]COM18\f[R] to \f[V]COM99\f[R]. Deleting the \f[V]mbedls.json\f[R] or using the \f[V]--skip-retarget\f[R] parameter removes these changes. .SH FILES .TP \f[I]mbedls.json\f[R] Per-user re-target file .SH REPORTING BUGS .PP Upstream bug tracker: https://github.com/ARMmbed/mbed-ls/issues .SH COPYRIGHT .PP Copyright (c) 2011-2015 ARM Limited .SH AUTHOR .PP This manual page is based on the mbedls documentation. It was created by Nick Morrott for the Debian GNU/Linux system, but may be used by others .SH SEE ALSO .PP \f[B]yotta\f[R](1), \f[B]valinor\f[R](1)