Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2019-11-07,master
commit 1e2b7353b14b831f21fa317b3cff8e1c37b07d0b Author: Sven Eckelmann sven@narfation.org Date: Mon Oct 14 11:34:39 2019 +0000
doc: open-mesh/Kernel_debugging_with_kgdb
1e2b7353b14b831f21fa317b3cff8e1c37b07d0b open-mesh/Kernel_debugging_with_kgdb.textile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
diff --git a/open-mesh/Kernel_debugging_with_kgdb.textile b/open-mesh/Kernel_debugging_with_kgdb.textile index 3ecbb45..72d943b 100644 --- a/open-mesh/Kernel_debugging_with_kgdb.textile +++ b/open-mesh/Kernel_debugging_with_kgdb.textile @@ -314,3 +314,28 @@ index a7c6a79..c18f978 100644 modules endef </pre> + +h2. Working with external Watchdog over GPIO + +There are various boards on ar71xx which use external watchdogs chips via GPIO. They have to be triggered regularly (every minute or more) or otherwise the board will just suddenly reboot. This will of course not work when Linux is no longer in control and kgdb/gdb is the only way to interact with the system. + +But luckily, we can just write manually to the ar71xx registers (every n seconds). We have two possible ways: + +* write to the clear/set registers +** set bit n in register GPIO_SET (0x1804000C) to set output value to 1 +** set bit n in register GPIO_CLEAR (0x18040010) to set output value to 0 +* overwrite complete GPIO_OUT (0x18040008) register (which might modify more GPIO bits then required) + +We will only demonstrate this here for GPIO 12 with GPIO_SET/GPIO_CLEAR. + +<pre> +# check where 0x18040000 is mapped to +(gdb) display ath79_gpio_base +8: ath79_gpio_base = (void *) 0xb8040000 + +# set GPIO 12 to low +set {uint32_t}0xb8040010 = 0x00001000 + +# set GPIO 12 to high +set {uint32_t}0xb804000C = 0x00001000 +</pre> \ No newline at end of file