Auto rearming watchdog

Example Description:

Triggers an auto rearming watchdog, and then loops on the FC to keep the app alive. In background, the watchdog will rearm itself every seconds.

Warning

Due to the watchdog sensitive nature with respect to timing, please only use UART printfs. Semihosting is too variable and potentially slow for that example to be reliable.

Few command examples:

Generate build files (Ninja generator is optional - requires installation of ninja-build package):

CMAKE_GENERATOR=Ninja cmake -S . -B build

Build

cmake --build build

Run

# Without traces
cmake --build build --target run
# with fc traces (for other traces, read gvsoc documentation)
runner_args="--trace=fc/insn"  cmake --build . --target run

Expected output:

# Without traces
Still alive 0
Still alive 1
Still alive 2
Still alive 3
Still alive 4
Still alive 5
Still alive 6
(etc)
Still alive 27
Still alive 28
Still alive 29

Cleanup

rm -rf build