From edcb41373afe8faf92225d8fe473bc97872855f7 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sat, 23 Oct 2021 22:53:14 +0200 Subject: Add manual pages Manual pages are built using scdoc. This is marked as optional. --- README | 4 ++++ doc/fwexec.1.scd | 28 ++++++++++++++++++++++++++++ doc/fwflash.1.scd | 43 +++++++++++++++++++++++++++++++++++++++++++ doc/meson.build | 23 +++++++++++++++++++++++ meson.build | 2 ++ meson_options.txt | 2 ++ 6 files changed, 102 insertions(+) create mode 100644 doc/fwexec.1.scd create mode 100644 doc/fwflash.1.scd create mode 100644 doc/meson.build create mode 100644 meson_options.txt 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 . + +Originally written by David Anderson 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 . + +Originally written by David Anderson . 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') -- cgit v1.2.3