Watchdog reset skips bootloader and starts at application

Hi

I am making a Atmega2560 device that can download firmware and update it self via a GSM modem.
It works well on one prototype but not on another.

Here is how it should work:
After the device has downloaded the firmware .bin file to the local SD-card, the device should reboot so that the bootloader can update the firmware.

Rebooting is done by letting the watchdog timeout after 8 s. The problem is that when it reboots it simply skips the bootloader. I have checked that the high fuse is 0xD8 meaning that BOOTRST fuse is programmed.

As mentioned it works well in another prototype so it is a little strange
any ideas what could be wrong? :confused:

Please see attached bootloader source files

br.
Allan

main.c (3.62 KB)

mmc_fat.c (8.17 KB)

Which boot loader and core are you using?