You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am updating firmware from wireless so I download file in sd card and change eeprom byte and doing watchdog set as per example.
wdt_enable(WDTO_500MS); // have the wdt reset the chip
// if 500ms passes without a reset
Serial.println("rebooting and flashing with firmware.bin on sdcard");
EEPROM.write(0xFA2, 0xF0); //changed firmware location in both main and bootloader
wdt_reset();
delay(600);
My issue is that after reset using watchdog timer it starts the main app again and not able to update firmware from sd card. it starts the main app because of the below condition in bootloader code stk500boot.c
Is there any way to restart micro without watchdog or Is it safe to remove the above condition from the bootloader?
I am using atmega2560, 3.3V, and 8Mhz atmega revision.
Thank you,
Jignesh
The text was updated successfully, but these errors were encountered:
jigneshpatel47
changed the title
Main app start after chaning EEprom byte
Main app start on watchdog reset during update firmware
Apr 6, 2021
Hi,
I am updating firmware from wireless so I download file in sd card and change eeprom byte and doing watchdog set as per example.
wdt_enable(WDTO_500MS); // have the wdt reset the chip
// if 500ms passes without a reset
Serial.println("rebooting and flashing with firmware.bin on sdcard");
EEPROM.write(0xFA2, 0xF0); //changed firmware location in both main and bootloader
wdt_reset();
delay(600);
My issue is that after reset using watchdog timer it starts the main app again and not able to update firmware from sd card. it starts the main app because of the below condition in bootloader code stk500boot.c
https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560/blob/master/hardware/microbridge/avr/bootloaders/microbridge/stk500boot.c#L591
// check if WDT generated the reset, if so, go straight to app
if (mcuStatusReg & _BV(WDRF))
{
app_start();
}
Is there any way to restart micro without watchdog or Is it safe to remove the above condition from the bootloader?
I am using atmega2560, 3.3V, and 8Mhz atmega revision.
Thank you,
Jignesh
The text was updated successfully, but these errors were encountered: