aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2021-10-23 22:53:14 +0200
committerNicolas Schodet2021-10-23 23:12:32 +0200
commitedcb41373afe8faf92225d8fe473bc97872855f7 (patch)
tree2ee129d56fd7817bb0b8a5384aeb5aeaffbde7d9
parentfe25b27fa63da8a4b30a008c224b3d305190fa49 (diff)
Add manual pages
Manual pages are built using scdoc. This is marked as optional.
-rw-r--r--README4
-rw-r--r--doc/fwexec.1.scd28
-rw-r--r--doc/fwflash.1.scd43
-rw-r--r--doc/meson.build23
-rw-r--r--meson.build2
-rw-r--r--meson_options.txt2
6 files changed, 102 insertions, 0 deletions
diff --git a/README b/README
index c7b7fb8..fe71af3 100644
--- a/README
+++ b/README
@@ -62,6 +62,10 @@ If you are running a debian based system, you can install them using:
sudo apt install build-essential libusb-1.0-0-dev meson gcc-arm-none-eabi
+To build the optional manual pages, you also need scdoc:
+
+ sudo apt install scdoc
+
When you have all that, build with:
meson build
diff --git a/doc/fwexec.1.scd b/doc/fwexec.1.scd
new file mode 100644
index 0000000..a0af3b3
--- /dev/null
+++ b/doc/fwexec.1.scd
@@ -0,0 +1,28 @@
+fwexec(1)
+
+# NAME
+
+fwexec - upload firmware image to a connected NXT device and run it from RAM
+
+# SYNOPSIS
+
+*fwflash* _file_ [_load_address_ [_jump_address_]]
+
+# DESCRIPTION
+
+The *fwexec* utility is similar to *fwflash*(1), but the firmware image is
+uploaded to NXT RAM and executed from there. The image must have been compiled
+specially to handle this.
+
+The *fwexec* utility is part of LibNXT.
+
+# SEE ALSO
+
+*fwflash*(1)
+
+# AUTHOR
+
+Maintained by Nicolas Schodet <nico@ni.fr.eu.org>.
+
+Originally written by David Anderson <dave@natulte.net> based on first initial
+version by Lawrie Griffiths.
diff --git a/doc/fwflash.1.scd b/doc/fwflash.1.scd
new file mode 100644
index 0000000..eb83455
--- /dev/null
+++ b/doc/fwflash.1.scd
@@ -0,0 +1,43 @@
+fwflash(1)
+
+# NAME
+
+fwflash - flash firmware image to a connected NXT device
+
+# SYNOPSIS
+
+*fwflash* _file_
+
+# DESCRIPTION
+
+The *fwflash* utility takes a firmware image file and sends it to a connected
+NXT device through USB. It takes only one parameter which is the firmware file
+to send. This file usually has the .bin or .rfw extension and a size of
+262144 octets.
+
+Connect the NXT using a USB cable. Make sure it is detected by the computer
+when powered on. If you run *fwflash* now, it should report that the NXT is
+found, but not running in reset mode.
+
+*The next step will erase the current firmware image!*
+
+Press and hold, for at least five seconds, the reset button which is hidden in
+the pin hole under the USB port. The brick should make a clicking noise and be
+detected by the computer in SAM-BA mode.
+
+You can then use *fwflash* to send the firmware. After a few seconds, it
+should announce successful flashing.
+
+In case of problem, check your USB cable, and your device permissions.
+
+The *fwflash* utility is part of LibNXT.
+
+# SEE ALSO
+
+*fwexec*(1)
+
+# AUTHOR
+
+Maintained by Nicolas Schodet <nico@ni.fr.eu.org>.
+
+Originally written by David Anderson <dave@natulte.net>.
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 0000000..92cc033
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,23 @@
+scdoc = find_program('scdoc', required : get_option('build_doc'))
+if scdoc.found()
+ # Need to feed the input on standard input, so use the shell.
+ sh = find_program('sh')
+ custom_target(
+ 'fwflash.1',
+ output : 'fwflash.1',
+ input : 'fwflash.1.scd',
+ command : [sh, '-c', scdoc.full_path() + ' < @INPUT@'],
+ capture : true,
+ install : true,
+ install_dir : join_paths(get_option('mandir'), 'man1'),
+ )
+ custom_target(
+ 'fwexec.1',
+ output : 'fwexec.1',
+ input : 'fwexec.1.scd',
+ command : [sh, '-c', scdoc.full_path() + ' < @INPUT@'],
+ capture : true,
+ install : true,
+ install_dir : join_paths(get_option('mandir'), 'man1'),
+ )
+endif
diff --git a/meson.build b/meson.build
index ede64ff..8bad3d8 100644
--- a/meson.build
+++ b/meson.build
@@ -1,10 +1,12 @@
project('libnxt', 'c',
default_options : 'warning_level=3',
+ meson_version : '>=0.55.0',
version : '0.4.1')
usbdep = dependency('libusb-1.0')
subdir('flash_write')
+subdir('doc')
prog_python = import('python').find_installation('python3')
flash_routine_h = custom_target(
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..dc6bc8c
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,2 @@
+option('build_doc', type : 'feature', value : 'auto',
+ description : 'Build man pages')