Hey guys.
I'm working on my own bootloader and I'm having problems jumping from the bootloader to application properly. I'm able to flash the application properly (If I set the BOOTRST to APPLICATION it works), but when I run the app from bootloader, it just doesn't work.
I'm using TCC0 timer in my bootloader and I disable it before jumping to 0x0. Even if I don't use the timers altogether, it still doesn't work.
There are many suggestions over the internet, I tried them all, but none of them worked for me.
Currently, I have this for going into the app:
CCP = CCP_IOREG_gc;
PMIC.CTRL = 0;
TCC0.INTCTRLA = 0;
asm("jmp 0x0");
I also tried enabling the watchdog and then checking for the RST.STATUS & WD first thing after booting:
When I want to start the application:
CCP = CCP_IOREG_gc;
WDT.CTRL = WDT_ENABLE_bm | WDT_CEN_bm | WDT_PER_8CLK_gc;
while(WDT.STATUS & WDT_SYNCBUSY_bm);
And then, first thing in main():
if (RST.STATUS & RST_WDRF_bm)
{
asm("jmp 0x0");
}This is driving me crazy

Thanks