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 edzafr
Visitor
204 Views
Registered: ‎10-24-2018

AMP mode: Linux in CPU0 hangs when bare-metal app in CPU1 starts execution

Hello,

We've been trying to set up an AMP system similar to the structure in XAPP1078. We could sucessfully set it up in a Zedboard kit a couple years ago, and for different reasons, we find the Pynq-Z1 more convenient so our idea is to develop a similar system for this board.

For the Zedboard, it was possible to find compiled versions of the necessary files to set up our embedded Linux, so the process was a little easier. Now, for the Pynq-Z1, we are following the UG1156 Workflow tutorial to compile our own version of Linux with the Petalinux Tools.

So far, we have succeeded booting our compiled Linux. We made some of the necessary modifications to work in AMP mode, such as adding the "maxcpus=1" bootarg and restricting the system memory. We check with the cat /proc/cpuinfo command, and Linux is indeed using only CPU0. FPGA is also programmed correctly as the DONE led is on.

Problem arises when we try to execute an application in CPU1. It doesn't matter if we load the app in the BOOT.bin file or if we send it through System Debugger. The moment it starts, the Linux system crashes. For this baremetal app, we specified the AMP mode with the DUSE_AMP=1 compiler flag, and edited the linker script to avoid the Linux memory section.


It seems the contents of the app for CPU1 do not matter either, as a simple app with just a while loop still hangs the Linux system. I have uploaded the log we get through the console.

Thank you very much for your help.

0 Kudos
6 Replies
Xilinx Employee
Xilinx Employee
170 Views
Registered: ‎09-14-2018

回复: AMP mode: Linux in CPU0 hangs when bare-metal app in CPU1 starts execution

@edzafr 

Hi,

I once ran into the same issue years ago. And it turned out CPU1 had changed GIC settings in it's initialization.

You may want to confirm that also.


----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

Scholar watari
Scholar
163 Views
Registered: ‎06-16-2013

Re: AMP mode: Linux in CPU0 hangs when bare-metal app in CPU1 starts execution

Hi @edzafr 

 

I guess it seems CPU idle issue on ZynqMPSoC.

 

Would you refer the following URL ?

 

https://www.xilinx.com/support/answers/69143.html

 

Best regards,

Visitor edzafr
Visitor
147 Views
Registered: ‎10-24-2018

回复: AMP mode: Linux in CPU0 hangs when bare-metal app in CPU1 starts execution

Hi! I indeed made used of interrupts and the GIC in my design. I knew they could be problematic in AMP designs, from working with the Zedboard.

Just to discard that problem, I disabled interrupt ports in the PS Zynq block in my hardware design and removed them from my CPU1 app design, just to get something simple running. Still no luck and Linux still hangs. Do you think the GIC could still cause some kind of problem even though it is not being used currently?

Thanks for your input!

0 Kudos
Visitor edzafr
Visitor
144 Views
Registered: ‎10-24-2018

Re: AMP mode: Linux in CPU0 hangs when bare-metal app in CPU1 starts execution

Hi! I tried the second solution in that document, disabling the "CPU idle PM support" in my petalinux project kernel config and still no luck.

By the way, I can perfectly stop and resume CPU0´s execution with no problem and Linux never hangs. The minute I load an executable in CPU1, that's when Linux crashes. In fact, one thing I am seeing while debugging is that CPU0 is executing stuff in the following addresses (see attached image). Does that make sense, since I restricted the Linux memory section from 0x0 to 0x20000000 as in the XAPP1078 document?

Thanks for the help!

armCPUs.PNG
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
126 Views
Registered: ‎09-14-2018

回复: AMP mode: Linux in CPU0 hangs when bare-metal app in CPU1 starts execution

Hi @edzafr 

I suppose that even you didn't use GIC in CPU1, their might be some default codes configuring GIC in platfrom init. You can check with that.

0 Kudos
Visitor edzafr
Visitor
107 Views
Registered: ‎10-24-2018

回复: AMP mode: Linux in CPU0 hangs when bare-metal app in CPU1 starts execution

I think I have found the culprit of my problems. It's a bit strange.

So I was configuring my Linux memory from 0x0 to 0x2000_0000, while I configured my app in CPU1 to start in 0x2000_0000. This configuration never worked.

Then I tried to limit my Linux from 0x0 to 0x1800_0000 and the CPU1 app to start in 0x1900_0000. This configuration worked without problems in AMP mode. Even interrupts are working fine also.

What I've found is that for some reason, I cannot read anything from the memory starting from the position 0x2000_0000. Every address below that, I can read in the debugger and I can write the registers, but above that position, I get some weird question marks (see image attached).

According to the Zynq reference manual, memory addresses ranging from 0x0010_0000 to 0x3FFF_FFFF are completely accesible, so I have no idea why this is happening. Just to discard problems, I've tried without an AMP configuration and programming the application in CPU0 and the results are the same. I simply cannot read those memory positions.

 

EDIT: Pynq Z1 has 512 MB ram and 0x2000_0000 is basically around that much, so it makes sense now.

Memory.PNG
0 Kudos