[riot-users] MCU recover mode

Olivier Fauchon ofauchon2204 at gmail.com
Wed Dec 19 08:07:05 CET 2018


Hi,

I recently bricked a couple of MCUs playing with low power modes.
I'm still not sure what happened, but enabling LPM on my board makes JTAG
inoperant.

I spent a lot of time trying to save these dead MCUs.

To avoid this situation, I added some kind of recovery mode at boot :


board.c

void board_init(void)
...

    // Safeguard: Infinite loop if board started with buttons pushed
    gpio_init(BTN0_PIN, GPIO_IN_PU);
    gpio_init(BTN1_PIN, GPIO_IN_PU);
    if (!gpio_read(BTN0_PIN) ||  !gpio_read(BTN1_PIN) ) {
        gpio_set(LED0_PIN);
        gpio_set(LED1_PIN);
        while(1){}
    }

Did I reinvent the wheel ?
Do Riot have already mecanisms to delay boot , or other way to protect from
bad images ?

Thanks
Olivier Fauchon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/users/attachments/20181219/d0125c1d/attachment.html>


More information about the users mailing list