Commit 0f29c48e authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Initialize watchdog when running on Mynewt

On Mynewt some flash drivers on very slow devices tickle the watchdog to
avoid possible hangs; those were also trying to tickle the watchdog in
mcuboot when performing an upgrade or serial boot, without initializing
the watchdog, causing an invalid memory write and reset issue.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 6400f0bf
Loading
Loading
Loading
Loading
+5
Changes for boot/mynewt/src/main.c: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -213,6 +213,11 @@ main(void)

    hal_bsp_init();

#if !MYNEWT_VAL(OS_SCHEDULING) && MYNEWT_VAL(WATCHDOG_INTERVAL)
    rc = hal_watchdog_init(MYNEWT_VAL(WATCHDOG_INTERVAL));
    assert(rc == 0);
#endif

#if defined(MCUBOOT_SERIAL) || defined(MCUBOOT_HAVE_LOGGING)
    /* initialize uart without os */
    os_dev_initialize_all(OS_DEV_INIT_PRIMARY);