Setting DFU mode after unit tests are run

Hey,
I’m writing some automation for unit tests and it seems like the information for setting DFU mode from firmware is out of date.

I’ve attempted using the two approaches:

System.bootloader();

and

SYSTEM_FLAG(FLASH_OTA_Update_SysFlag) = 0x0000;
Save_SystemFlags();
BKP_WriteBackupRegister(BKP_DR10, 0x0000);
USB_Cable_Config(DISABLE);
NVIC_SystemReset();

Neither compiles into firmware 0.5.3 (using a local build). We are unable to upgrade the system firmware (something we’re working on).
What is the best way to reboot the device into DFU mode after running my test suite?
Thanks!

System.dfu()?

https://docs.particle.io/reference/firmware/#dfu-

It looks like it exists in 0.5.3.

3 Likes

Thanks!

That solved my problem.
I think the unit test framework I’m using was built for an older firmware than 0.5.3.