OOM and watchdog

I can easilly get the WP76XX to get stuck using this script:


: > bigfile
while true; do
echo “Adding more data to the file…”
dd if=/dev/zero bs=1M count=10 >> bigfile 2>/dev/null

how can I activate by default watchdog that will reset on such case

I am building Yocto from sccratch so all options are open

Why will it get stuck?
Is it because the file is too big?

its a loop that eventually will consume all memory

I managed to resolve by adding “watchdog” to build in Yocto

since adding that system does not gets stuck