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: 
Adventurer
Adventurer
461 Views
Registered: ‎08-06-2018

Core0 runs weird when both cores's .text in ocm

Hi,

zynq xc7z100 & SDK 2017.4.

I'm running AMP, baremetal on both cores.I'm using -Os on both cores. When both cores's .text locates in OCM, core0 runs to no where. 

Here are the ld file of two project:

two ld.PNG

1. Anything incorrect with my ld script file?

weird core0.PNG

when it runs to main, it looks as above, core0's calling stack is weird at 0xce3fe71c. I resume core0 and it runs to a state like below:

run and stop.PNG

2. what's the problem?

ps. If I only launch core0 on the system debugger , it runs correct as below. If I move core1's .text to ddr, both cores also run normally.

only core0.PNG

 

Best Regards

0 Kudos
7 Replies
Adventurer
Adventurer
434 Views
Registered: ‎08-06-2018

Re: Core0 runs weird when both cores's .text in ocm

Can anyone help me out??? If you need more information please ask.

0 Kudos
Scholar ericv
Scholar
414 Views
Registered: ‎04-13-2015

Re: Core0 runs weird when both cores's .text in ocm

@ruijie 

I see 2 things.

First you cannot use the upper 256 bytes on the OCM (0xFFFFFE00 -> 0xFFFFFFFF) as it's used by the ROM start-up code.

Second, the code of both cores land in the same memory..  You have to split the OCM - one part for core #0 and the other for core #1.

 

0 Kudos
Adventurer
Adventurer
401 Views
Registered: ‎08-06-2018

Re: Core0 runs weird when both cores's .text in ocm

Thank you @ericv ,

I already fix the size of upper address of OCM according to your first mention.

However, I don't see any overlap of my code memory.

Here's the script.ld of core0 :

core0 ld.png

Here's the script.ld of core1:

core1 ld.png

you mention that my code of both cores load in the same memory, I wonder how you see it ?? According to the two ld files above, the text of core0 locates in ps_ram_0 which is from 0x0 to 0x1EFFF. while text of core1 locates in ps_ram_1 which from 0x1F000 to 0x2FFFF. That makes the code of two cores land in two separate without overlapping memory segments. So I don't know why you think my code of two cores land in the same memory??

What's more, all other system sections are located in different segments in ddr, to be specific, core0 in ps_ddr_0 which is from 0x100000 to 0x64FFFFF and core1 in ps_ddr_1 which is from 0x6500000 to 0xC8FFFFF.

Onlyl 0xFFFF0000 to 0xFFFFFE00 in OCM and all upper area from 0xC900000 in DDR are used as share memories between two cores.

Am I misunderstood something??

0 Kudos
Scholar ericv
Scholar
391 Views
Registered: ‎04-13-2015

Re: Core0 runs weird when both cores's .text in ocm

@ruijie 

My bad for the code overlap - I got confused with the section names.

0 Kudos
Adventurer
Adventurer
348 Views
Registered: ‎08-06-2018

Re: Core0 runs weird when both cores's .text in ocm

Here's something more.

When I debug both cores on jtag, I select to download both cores' elf in debug configurations, after the cores launch in debug perspective, I see core0's code in the disassembly window, the assemble code is not like what it should be like as in core0's elf file. The normal assemble code is somehow replace to "andeq r0, r0, r0".

core0 disasm.PNG

However, If I select only to download core0 in the debug configuration, and after both cores launch in debug perspective, I right click on the core1 and choose symbol files, then load core1's elf. This time, both cores work fine.

So it looks like core0's elf is somehow corrupted when core1 boot up. Will system debugger call FSBL to boot up both cores?

I'm not sure whether it has something to do with the boot up process in jtag mode.

0 Kudos
Highlighted
Scholar ericv
Scholar
325 Views
Registered: ‎04-13-2015

Re: Core0 runs weird when both cores's .text in ocm

@ruijie 

the andeq r0,r0,r0 instruction code is 0x00000000.  Use objdump on core #1 ELF file and you'll see why 0x00000000 lands in core #0 memory space.

0 Kudos
Adventurer
Adventurer
288 Views
Registered: ‎08-06-2018

Re: Core0 runs weird when both cores's .text in ocm

Thank you @ericv ,

The .elf file itself already offers all the section informations. But I don't feel like it's a compile and linking problem . Since launching  core0 only in system debugger works fine.

And like I metioned in my last post, if I load two cores' elf separately. Two cores working fine.  So I feel it has something to do with the launching process of system debugger. Somehow it crashes core0's memory.

I did another test today. In my old ld file. core0's .text locates in ps7_ddr_0 segment which from 0x0 to 0x1EFFF while core1's .text locates in ps7_ddr_1 which from 0x1F000 to 0x2FFFF.

I did a little switch. I change ps7_ddr_0 to 0x1F000 to 0x2FFFF while ps7_ddr_1 to 0x0 to 0x1EFFF. Then both cores work well.

Feel like core0's text can't reside in memory base at 0x0.

So , is there any restriction in using 0x0 by core0 ?

0 Kudos