Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Man pages #464

Merged
merged 2 commits into from
Sep 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ set(STLINK_SOURCE
src/flash_loader.c
)

set(STLINK_MANPAGES
doc/man/stlink.1
)


if (WIN32 OR MSYS OR MINGW)
set (STLINK_SOURCE "${STLINK_SOURCE};src/mmap.c;src/mingw/mingw.c") # TODO
endif ()
Expand Down Expand Up @@ -224,6 +229,9 @@ install(FILES ${CMAKE_SOURCE_DIR}/include/stlink.h
install(FILES ${STLINK_HEADERS}
DESTINATION include/${CMAKE_LIBRARY_PATH}/stlink-${STLINK_PACKAGE_VERSION}/stlink)

install(FILES ${STLINK_MANPAGES}
DESTINATION share/man/man1)

if (NOT APPLE AND NOT WIN32)
set(PKG_CONFIG_LIBDIR
"\${prefix}/lib/\${deb_host_multiarch}"
Expand Down
1 change: 1 addition & 0 deletions doc/man/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.1
11 changes: 11 additions & 0 deletions doc/man/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
MAN1 =
MAN1 += st-util.md

all: $(patsubst %.md, %.1, $(MAN1))

%.1: %.md
pandoc -s -t man $< -o $@
tail --line=+3 $@ > tmp && mv tmp $@

clean:
rm *.1
68 changes: 68 additions & 0 deletions doc/man/st-util.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
% ST-UTIL(1) Open Source STMicroelectronics Stlink Tools | STLINK
%
% Sep 2016


# NAME
st-util - Run GDB server to interact with STM32 device


# SYNOPSIS
*st-util* \[\<ARGS>...]


# DESCRIPTION
Start a GDB server to interact with a STM32 device
Run the main binary of the local package (src/main.rs).

If a port number is not specified using the **--listen_port** option, the
default **4242** port will be used.

Stlink version 2 is used by default unless the option **--stlinkv1** is given.

The STLINKv2 device to use can be specified in the environment
variable STLINK_DEVICE on the format <USB_BUS>:<USB_ADDR>.


# OPTIONS

-h, --help
: Print this message.

-v *XX*, --verbose=XX
: Specify a specific verbosity level (0..99)

-v, --verbose
: Specify generally verbose logging

-s *X*, --stlink_version=X
: Choose what version of stlink to use, (defaults to 2)

-1, --stlinkv1
: Force stlink version 1

-p *4242*, --listen_port=1234
: Set the gdb server listen port. (default port: 4242)

-m, --multi
: Set gdb server to extended mode. st-util will continue listening for connections after disconnect.

-n, --no-reset
: Do not reset board on connection.


# EXAMPLES
Run GDB server on port 4500 and connect to it

$ st-util -p 4500
$ gdb
(gdb) target extended-remote localhost:4500


# SEE ALSO
st-flash(1), st-info(1), st-term(1)


# COPYRIGHT
This work is copyrighted. Stlink contributors.
See *LICENSE* file in the stlink source distribution.