cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
josephwsamson
Visitor
Visitor
902 Views
Registered: ‎05-04-2018

Restart Zynq From Watchdog

Jump to solution

I am transitioning a design from Artix to Zynq, and I have everything working except for the watchdog timer. I am running Vivado 2018.3 on Windows 10.

To help me understand it, I built a simple Zynq PS on my ZedBoard and I am running the xscuwdt_polled_example.c.

My only modification is to have the watchdog reset CPU0 only.

  Xil_Out32(0xF8000008, 0x0000DF0D);  // SLCR_UNLOCK Unlock SLCR
  Xil_Out32(0xF800024C, 0x00000001);  // RS_AWDT_CTRL - Watchdog resets CPU0 only
  Xil_Out32(0xF8000004, 0x0000767B);  // SLCR_LOCK Lock SLCR

 I created a boot image and programmed it into the ZedBoard SPI.  After the program runs, the watchdog expires and the system reboots. This is the behavior I want.

However, if I put the same boot.bin into an SD card and boot from that, the program runs but does not reboot the system after the watchdog expires. How do I get the watchdog to reboot from SD?

 

---

Joe Samson

Tags (2)
0 Kudos
Reply
1 Solution

Accepted Solutions
josephsamson
Explorer
Explorer
807 Views
Registered: ‎10-05-2010

I was trying to just reset CPU0, but I have better luck now by resetting the whole system.

I've got it working now on 2 different platforms: from flash on the zedboard and from SD card on the snickerdoodle.

Every time I make a new bitstream I check to make sure it still works. If it keeps working I'll mark a solution next week.

 

---

Joe

View solution in original post

0 Kudos
Reply
7 Replies
denist
Xilinx Employee
Xilinx Employee
813 Views
Registered: ‎10-11-2011

Are you only resetting the CPU or the whole system?

Use XSDB to connect to the target after the failure and read the REBOOT_REGISTER or see where the PC is.

It should give you an error for the failed boot. Hopefully a clue.

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Reply
josephsamson
Explorer
Explorer
808 Views
Registered: ‎10-05-2010

I was trying to just reset CPU0, but I have better luck now by resetting the whole system.

I've got it working now on 2 different platforms: from flash on the zedboard and from SD card on the snickerdoodle.

Every time I make a new bitstream I check to make sure it still works. If it keeps working I'll mark a solution next week.

 

---

Joe

View solution in original post

0 Kudos
Reply
denist
Xilinx Employee
Xilinx Employee
727 Views
Registered: ‎10-11-2011

Any update?

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Reply
josephwsamson
Visitor
Visitor
723 Views
Registered: ‎05-04-2018

Thank you for the reminder. It looks like switching to resetting both processors does what I want, so I'll close the case.

 

---

Joe

0 Kudos
Reply
dylancob
Contributor
Contributor
136 Views
Registered: ‎07-22-2020

Hey @josephwsamson , I'm doing essentially the same thing with the scuwdt, and I have a question for the reset: what steps are you taking after the timer expires to get it to successfully reset? I seem to be having trouble with reinitializing the CPU at this part -- what I'm aiming for is just restarting my code, I'm going to go ahead and guess that's what your desired result was too?

0 Kudos
Reply
josephsamson
Explorer
Explorer
94 Views
Registered: ‎10-05-2010

I looked back at my notes and code. The only thing that worked for me was having the watchdog reset the PL, CPU0 and CPU1.

Xil_Out32(0xF800024C, 0x00000000); // RS_AWDT_CTRL - total watchdog reset

This will cause the Zynq to reload from flash or SD.

 

---

Joe

dylancob
Contributor
Contributor
76 Views
Registered: ‎07-22-2020

Turns out I had a corrupted platform file that was causing it to not boot properly from the SD card, so when I ran it in debug mode it would just not reboot. Got a new platform file and it worked just fine! Thanks for looking though!

0 Kudos
Reply