UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor dandan1
Visitor
560 Views
Registered: ‎05-04-2018

zynq processor reset not coming out of reset

Jump to solution

 

We are having problems asserting software reset but only when I involve our product firmware project?

 

I am using the following macros

#define SlcrUnlock()      Xil_Out32(XPS_SYS_CTRL_BASEADDR + 0x08, 0xDF0DDF0D)

#define SlcrLock()              Xil_Out32(XPS_SYS_CTRL_BASEADDR + 0x04, 0x767B767B)

#define Sys_Soft_Reset()     Xil_Out32(XPS_SYS_CTRL_BASEADDR + 0x00000200,0x00000001)

 

Which work fine in a hello world project i.e. with product fsbll + product fabric + hello world. Reset works and we get a nice clean restart when reset is asserted.

 

But if I slip in our product specific project instead of hello world the resets don’t work what seems to happen is we go into reset but then don’t restart.

 

Any ideas?

0 Kudos
1 Solution

Accepted Solutions
Visitor dandan1
Visitor
128 Views
Registered: ‎05-04-2018

Re: zynq processor reset not coming out of reset

Jump to solution

I coded up a soft reset for my Qspi flash chip (S25FL256S_256_MBIT_32_MBYTE_3.0V_SPI_FLASH_MEMORY).

This was called prior to issuing the soft reset and we now have a working soft reset in our product.

Thanks Michel and John for your help!

0 Kudos
14 Replies
Xilinx Employee
Xilinx Employee
491 Views
Registered: ‎02-01-2008

Re: zynq processor reset not coming out of reset

Jump to solution

It's hard to know what is going on here. My first thought is that you may have a re-entrant problem.

In other words, the cpu is coming out of reset but memory that is initialized when the elf is downloaded but modified during application run, will hold stale values. An example would be a global variable that is initialized to 0 then incremented by the app. After a cpu reset, that global variable will contain the incremented value.

FSBL on zynqMP is re-entrant so you could take a look at it for an example. In xfsbl_initialization.c, you will find functions XFsbl_SaveData() and XFsbl_RestoreData(). The idea is to make a backup of the .data section before running the first time, and on subsequent 'soft resets', restore the .data section of memory from this first time backup.

 

0 Kudos
Visitor dandan1
Visitor
475 Views
Registered: ‎05-04-2018

Re: zynq processor reset not coming out of reset

Jump to solution

Thanks for your ideas John.

The re-entrancy is certainly a possibe problem but it doesn't explain why hello fsbl + fabric + hello world

works but insert our app for hello world doesnt why is the fsbl not running ts as if it is trapped in reset.

0 Kudos
Xilinx Employee
Xilinx Employee
403 Views
Registered: ‎02-01-2008

Re: zynq processor reset not coming out of reset

Jump to solution

So to reiterate:

  1. fsbl loads (to low 3/4 of OCM including reset vector at 0x00000000), runs, downloads fabric, downloads your app, enables PS to PL level shifters, then jumps to start address of your app (presumably located in DDR)
  2. Your app starts running and programs the CPU to point to vector table located at the beginning of your app
  3. your app issues a reset via the SYS_CTRL register
  4. cpu jumps to ???

In step 4, I would expect the cpu to jump to address 0x00000000 which is located in OCM (if you didn't change OCM address filtering and OCM mapping options). This address probably contains the FSBL code.

Does the contents of 0x00000000 look correct (matches FSBL code) before issuing the reset? If it does look correct, have you tried setting a breakpoint at 0x00000000, and selecting 'continue' in the debuger right before issueing the reset?

One thing I'm not sure of, and might be good to research, is if the MMU gets reset. I recall a time when a certain system would issue a shutdown to the CPU via an FIQ, and within that shutdown, the MMU would be disabled.

 

Visitor dandan1
Visitor
377 Views
Registered: ‎05-04-2018

Re: zynq processor reset not coming out of reset

Jump to solution

John thanks for the detailed reply!

In your step 4 below the cpu does jump to address  0 but the contents of address 0 don't look correct, this area is full of andeq instructions whereas the hello world has meaningful instructions as attached.

So this is where the fsbl code would have executed from at the initial power up? And I have trashed it somehow? Could you suggest next steps?

 

Thanks

Danny

ellocpature.JPG
0 Kudos
Xilinx Employee
Xilinx Employee
365 Views
Registered: ‎02-01-2008

Re: zynq processor reset not coming out of reset

Jump to solution

Just to be absolutely sure, check your fsbl linkerscript to make sure .vectors is the first code in .text section and that .text is in the memory that has ORIGIN=0x00000000. That is the default for zynq 7k.

So why is it getting trashed?

  1. your app is overwriting the FSBL vector table at 0x00000000 cause it's linkerscript is also using ORIGIN=0. Usually, default apps (such as hello) will be placed above the memory region that can be flipped between OCM and DDR. I.E. 0x100000. Check the address map table in the TRM (ug585). There is a table that shows how address range 0 can be OCM or DDR.
  2. As touched on above, make sure the first 3/4 of OCM hasn't been moved to its high address of 0xfffc0000. The TRM should document the registers for flipping OCM from low to high. When zynq7 first boots and runs FSBL, the first 3/4 OCM is mapped low, and the last 64KB of OCM is mapped high at 0xffff0000. You don't want this to change, otherwise fsbl .vectors will be found at 0xfffc0000 instead of 0x0.
  3. Also, from the TRM address map, you will notice 'Address filtered by SCU'. Make sure this hasn't changed. This 'filter' basically enables DDR to be visible at the bottom of memory.
  4. If nothing above seems wrong, then check your custom app for pointers that haven't been initialized and are therefore causing address 0x0 to be overwritten.
0 Kudos
Visitor dandan1
Visitor
351 Views
Registered: ‎05-04-2018

Re: zynq processor reset not coming out of reset

Jump to solution

John thank you for your help.

I checked out all your suggestions and our product project seems to checkout ok. nothing seems incorrect around the fsbl linker or ocm configuration.

 I made another discovery by stepping through the individual commands it seems the point where the address 0 gets corrupted is when I assert the soft reset 0xF8000200:0 set to 1 not during normal running of my app, sorry for the misinformation earlier. I am not setting the pc to 0 as well just asserting a soft reset after unlocking the slcr registers any further suggestions much appreciated.

Thanks Danny

0 Kudos
Xilinx Employee
Xilinx Employee
312 Views
Registered: ‎02-01-2008

Re: zynq processor reset not coming out of reset

Jump to solution

I also have to apologize. I've been tackling this thread as if you were resetting a single A9. But you are actually asserting a full system software reset. Sorry about that.

So it makes sense that a full system reset is changing the contents of OCM.

What does the slcr.REBOOT_STATUS register contain after applying the soft reset?

If you have debug prints enabled in FSBL, try to do a 'resume' just before writing the soft reset. I would expect that the soft reset would cause the A9 to start running bootROM (and therefore not communicating with debug), the bootROM causes the A9 to fetch FSBL from the boot device, and then the A9 starts running FSBL.

0 Kudos
Visitor dandan1
Visitor
291 Views
Registered: ‎05-04-2018

Re: zynq processor reset not coming out of reset

Jump to solution

John thank for your help!

The slcr.REBOOT_STATUS register contains 0x00482000 after the soft reset.

typing con in the xsct console just prior to the soft reset comand made no difference.

I assume thats how I do a resume just prior to reset?

 

Thanks Danny

 

 

0 Kudos
Visitor dandan1
Visitor
270 Views
Registered: ‎05-04-2018

Re: zynq processor reset not coming out of reset

Jump to solution

John

have you got  anymore suggestions for me? I was hopeful we were getting closer to understanding the problem with your help..

Thanks

Danny

0 Kudos
Observer michelcharette
Observer
259 Views
Registered: ‎06-07-2012

Re: zynq processor reset not coming out of reset

Jump to solution

Are you booting from QSPI flash?  

 

You have to take into account that the software reset doesn't reset the peripheral components.  One possibility is that you application is modifying the QSPI's internal state (e.g. page registers) and when the Zynq reboots, the QSPI isn't in the same state as when you cold-booted.

0 Kudos
Visitor dandan1
Visitor
241 Views
Registered: ‎05-04-2018

Re: zynq processor reset not coming out of reset

Jump to solution

Hi Michel,

yes booting from Qspi and am writing to Qspi in my app > 16MB device.

 

I didn't realise the soft reset doesn't initialise  the peripherals ( bit of a shame that! ) so which registers will need to be initialised? 0xE000D000 and 0xE000D0A0  or is it more than these 2?

 

Thanks

Danny

0 Kudos
Observer michelcharette
Observer
233 Views
Registered: ‎06-07-2012

Re: zynq processor reset not coming out of reset

Jump to solution

Actually it's the external peripherals (like the QSPI flash) that should be reset prior to the software reset.  The internal peripherals should revert to their initial state automatically.

0 Kudos
Visitor dandan1
Visitor
231 Views
Registered: ‎05-04-2018

Re: zynq processor reset not coming out of reset

Jump to solution

Ah I se! I will look into that....

Thanks

Danny

0 Kudos
Visitor dandan1
Visitor
129 Views
Registered: ‎05-04-2018

Re: zynq processor reset not coming out of reset

Jump to solution

I coded up a soft reset for my Qspi flash chip (S25FL256S_256_MBIT_32_MBYTE_3.0V_SPI_FLASH_MEMORY).

This was called prior to issuing the soft reset and we now have a working soft reset in our product.

Thanks Michel and John for your help!

0 Kudos