diff --git a/docs/Cli.md b/docs/Cli.md index 2e45ae138f..552bae8210 100644 --- a/docs/Cli.md +++ b/docs/Cli.md @@ -76,6 +76,7 @@ While connected to the CLI, all Logical Switches are temporarily disabled (5.1.0 | `bootlog` | Show boot events | | `color` | Configure colors | | `defaults` | Reset to defaults and reboot | +| `dmesg` | Show init logs from [serial_printf_debugging](./development/serial_printf_debugging.md) | | `dfu` | DFU mode on reboot | | `diff` | List configuration changes from default | | `dump` | Dump configuration | diff --git a/docs/development/serial_printf_debugging.md b/docs/development/serial_printf_debugging.md index 590bdb7e6b..0ede154db4 100644 --- a/docs/development/serial_printf_debugging.md +++ b/docs/development/serial_printf_debugging.md @@ -4,7 +4,9 @@ INAV offers a function to use serial `printf` style debugging. -This provides a simple and intuitive debugging facility. This facility is only available after the serial sub-system has been initialised, which should be adequate for all but the most hard-core debugging requirements. +This provides a simple and intuitive debugging facility. +This facility is only available after the serial sub-system has been initialised, but logs generated prior to serial +initialization can be obtained via the `dmesg` functionality. In order to use this feature, the source file must include `common/log.h`. @@ -137,3 +139,12 @@ The output will be formatted as follows: For the Configurator, debug messages are shown in the developer console log. Note: The numeric value in square brackets is the FC uptime in seconds. + +To see printf-style log messages generated prior serial initialization, reserve about 2KB-4KB RAM to buffer the +log) by defining DMESG_SIZE: +#define DMESG_SIZE 2048 + +Then `make clean` and `make`. + +Then in the CLI you can run `dmesg` to see the buffered log. +Note dmesg also requires that a serial port be defined for serial debugging.