Go Down

Topic: Due software reset (Read 3818 times) previous topic - next topic


Hello All,

I have a need to perform a software reset via code.  This was nice and easy on all other boards besides the Due as you would just do this:
Code: [Select]
#include <avr/wdt.h>

void software_Reboot()

Then, all you had to do was call the method software_Reboot and the Arduino would reset.  This was perfect and exactly what I am looking for.  However, this does not work on the Due.  First of all, it appears that avr/wdt.h does not exist for the Due.

Anybody have a quick and easy way to reset the Due from code, similar to above, but that works for the Due?




I have a need to perform a software reset via code.
That is extremely unlikely. More likely, you need to fix the real problem with your code.
The art of getting good answers lies in asking good questions.


Sep 01, 2015, 01:32 pm Last Edit: Sep 01, 2015, 01:33 pm by AWOL
it appears that avr/wdt.h does not exist for the Due.
(my emphasis)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.


More likely, you need to fix the real problem with your code.
PaulS, how can you make that snide remark when you have no clue why I would need to do a reset?  There are some good reasons why one might need to do a reset even with perfect code.

Very unproductive.....thanks for nothing.


check out section of the SAM3X/A manual: http://www.keil.com/dd/docs/datashts/atmel/sam3xa/doc11057.pdf

this describes the software reset procedure.


Hi all,

Not sure if this helps, but it helped me. I was looking for a way to properly reset the Due without using a pin, the WDT, or the jump to 0. After lots of searching the web and pouring over the SAM datasheet, the following is code should will work on any ARMv7-M architecture such as the SAM3X used on the DUE.

Add these defines to the start of your code;
Code: [Select]
//Defines so the device can do a self reset
#define SYSRESETREQ    (1<<2)
#define VECTKEY        (0x05fa0000UL)
#define VECTKEY_MASK   (0x0000ffffUL)
#define AIRCR          (*(uint32_t*)0xe000ed0cUL) // fixed arch-defined address

The SYSRESETREQ is bit 2 in the AIRCR register and needs to be set to request a reset. Before this can be done, 0x05FA needs to be put into AIRCR register VECTKEY bits16:31 or the write to SYSRESETREQ will be ignored.
The final line simply puts it all together to create the actual command to reset REQUEST_EXTERNAL_RESET and could be renamed as you desire.

Use this command when you want to reset the DUE.
Code: [Select]

This worked for me, but I did need to add some delay (I used 1000mS) after a Serial.println("Something to print"); as it reset before the data got out to the terminal.

Hope this helps some of you.


This Due reset code worked perfectly, thank you!


Hi gjt211,

I tried your method to write to AIRCR Register like what you showed.

But I am not able to get the RESET. By RESET, I am expecting that the setup() function will be re-executed.

I am using your code with the Native USB Port.

Please do let me know if I am doing anything wrongly.

Awaiting your reply.




I use ntp server to update clock (RTC).

Reset works fine but my connection to ftp server not work.. it's possible to reset ethernet shield with this code ?



Mar 20, 2017, 12:00 am Last Edit: Mar 20, 2017, 12:05 am by alarmsiren
I've found a dead simple method for resetting the Arudino Due:

Code: [Select]
RSTC->RSTC_CR = 0xA5000005; // Reset processor and internal peripherals

Seriously, that's it.

If you want the external reset pin to also get pulled low (e.g. to reset external peripherals, like jot4p's ethernet shield) just change it to:

Code: [Select]
RSTC->RSTC_MR = 0xA5000801; // Set RST pin to go low for 256 clock cycles on reset
RSTC->RSTC_CR = 0xA5000013; // Reset processor, internal peripherals, and pull external RST pin low.

The relevant section of the datasheet is pages 223-233.

Go Up