How to simulate a doubleclick on SAMD21G18A Arduino Nano 33 IOT

Hi!

How do I simulate a double click reset command from code on the Arduino Nano 33 IOT?

NVIC_SystemReset(); seems to only reset the mcu without going to bootloader.

Thanks
iKjetil

Ok I got it working.

Use:

#define HMCRAMC0_SIZE     0x8000UL 
#define HMCRAMC0_ADDR    (0x20000000U)
#define MAGIC_VALUE         0x07738135U

void ResetToBoot()
{
    *((volatile uint32_t *)(HMCRAMC0_ADDR + HMCRAMC0_SIZE - 4)) = MAGIC_VALUE;
    NVIC_SystemReset();
}

iKjetil

Thanks for taking the time to post an update with the solution iKjetil!

Out of curiosity, what are you using this for?

Mainly an update-able HID device.