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: 
Observer nburkitt
Observer
9,556 Views
Registered: ‎06-16-2016

Getting Started with AMP

Hi All.
 
I want to use OpenAMP (Linux+FreeRTOS) on a 3rd-party Zynq-7000-based board (http://krtkl.com). I haven't been able to find much documentation that describes the steps involved. The closest I've found is Xilinx's OpenAMP Framework for Zynq Devices Getting Started Guide (UG1186), which really just documents how to run Xilinx's demo applications on Xilinx's development board using Xilinx's embedded Linux tools.

I'm still waiting for parts to build a JTAG cable, so in the meantime I'm trying to make a bootable SD card. I can get as far as petalinux-build -x package, but no further. When I run petalinux-util --update-sdcard, it fails because it doesn't have permission to write to the SD device; if I try sudo petalinux-util --update-sdcard, it fails because it can't find petalinux-util, despite the fact that its in the path and all the proper environment variables are set.

Any ideas on what I can try next? I'm happy to copy files by hand if I know which ones they are...

Thanks,
 
-Nick

0 Kudos
8 Replies
Visitor claudiofi
Visitor
9,532 Views
Registered: ‎02-25-2016

Re: Getting Started with AMP

I'm using the same your configuration but on the AVNET MicroZED board. I advise you to follow the UG1144 in order to prepare the SD card for the boot and for the rootfs.

 

You need to format correctly the sd with 2 partition, the first one like FAT32 for for the boot files and  the second one in ext4 format  for the rootfs.

 

but everything is explained in the UG1144.

 

have a nice day,

Claudio

0 Kudos
Observer nburkitt
Observer
9,489 Views
Registered: ‎06-16-2016

Re: Getting Started with AMP

Hi Claudio.

 

Thanks very much for the reply. I've tried what you suggest, but get no output from the serial port. The same hardware works using the manufacturer's version of SMP LInux. This is the problem I've had - all the documentation assumes that you're using the Xilinx board, and so offer no guidance on how to deal with other hardware. Generic solutions are hard to come by.

 

-Nick

0 Kudos
Highlighted
Visitor claudiofi
Visitor
9,367 Views
Registered: ‎02-25-2016

Re: Getting Started with AMP

Did you try to generate by Vivado the hdf (hardware description file) for your board and import it in your Petalinux project (following the UG1144 pag. 26)?

 

My advise is to follow the UG1144 guide togheter to the UG1186.

 

claudio

0 Kudos
Observer nburkitt
Observer
9,337 Views
Registered: ‎06-16-2016

Re: Getting Started with AMP

Hi Claudio. I've discovered the first problem - my board is wired to use UART0 for USB serial output, where the ZC702 uses UART1. If I can figure out how to change the devicetree description, I may be able to use the ZC702 examples. Thanks, -Nick
0 Kudos
Visitor claudiofi
Visitor
9,317 Views
Registered: ‎02-25-2016

Re: Getting Started with AMP

After that you have exported the hardware platform and the .hdf file is generated by vivado tool and created a new Petalinux project, you have to import your hardware description with the follow command:

 

$ petalinux-config --get-hw-description=<path-to-directory-which-contains-hardware-description-file>

 

After configured Petalinux the new dts files are generated and you will can edit them if you need to change something (it could be not necessary).

 

I think this is the most correctly aproch if you have a different board and you have to generate a new Petalinux project; otherwise if you want try but I'm not sure it is work you can editated the "system-conf.dtsi":

 

/*
 * CAUTION: This file is automatically generated by PetaLinux SDK.
 * DO NOT modify this file
 */

/include/ "skeleton.dtsi"
/include/ "zynq-7000.dtsi"
/include/ "pcw.dtsi"
/include/ "pl.dtsi"

/ {
    model = "peta_amp";
    aliases {
        serial0 = &uart1; 
        serial1 = &uart0;
        ethernet0 = &gem0;
        spi0 = &qspi;
    };
    chosen {
        bootargs = "console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait";
    };
    memory {
        device_type = "memory";
        reg = <0x0 0x40000000>;
    };
};

 

 

Probabily you will have to swap "serial0" with "serial1", but you have pay attention if you have configured in your hdf (by Vivado) both UART because one is used for external communication (CPU0 Master to Terminal) and the second one is used for communication between cpus (CPU0 MAster Linux -CPU1 Slave FreeRTOS), so as indicated in the UG978 pag.12.

 

Claudio

 

 

0 Kudos
Observer nburkitt
Observer
9,288 Views
Registered: ‎06-16-2016

Re: Getting Started with AMP

Hi Claudio.

 

Thanks for your help with this. I've made progress, although there are still problems. 

I am now at the point where I can boot from SD and run u-boot, but I still can't get Linux to run. u-boot can see the LInux partition:

 

U-Boot-PetaLinux> ext2ls mmc 0:2 /
<DIR>       1024 .
<DIR>       1024 ..
<DIR>      12288 lost+found
         6441984 rootfs.cpio
<DIR>       1024 dev
<DIR>       1024 proc
<DIR>       1024 mnt
<DIR>       1024 sys
<DIR>       1024 usr
<DIR>       3072 bin
<DIR>       1024 boot
<DIR>       1024 var
<DIR>       1024 lib
<DIR>       1024 srv
<DIR>       1024 run
<DIR>       1024 media
<DIR>       1024 install
<DIR>       1024 etc
<DIR>       1024 home
<DIR>       3072 sbin
<SYM>          9 init
<SYM>          8 tmp

 

But if I try to boot, I get this far:

 

...

<a lot of stuff cut here>

...

Memory: 1015720K/1048576K available (4839K kernel code, 218K rwdata, 1768K rodata, 228K init, 213K bss, 16472K reserved, 16384K cma-reserved, 245760K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
    lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc067c234   (6609 kB)
      .init : 0xc067d000 - 0xc06b6000   ( 228 kB)
      .data : 0xc06b6000 - 0xc06ec8a0   ( 219 kB)
       .bss : 0xc06ec8a0 - 0xc0721efc   ( 214 kB)
...

<a lot of stuff cut here>

...

CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x82c0 - 0x8318
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (2664.03 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xf0880000
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized

 

And then console output stops.

 

I'm trying to follow UG 1186 (http://www.xilinx.com/support/documentation/sw_manuals/ug1186-zynq-openamp-gsg.pdf), which uses a different communication mechanism than UG978. Hopefully faster than UART speeds.

 

Thanks again,

 

-Nick

0 Kudos
Visitor claudiofi
Visitor
9,266 Views
Registered: ‎02-25-2016

Re: Getting Started with AMP

it seems that the system is not able to recognize some peripherials... Do you have a hdf coherents with your system or do you have genetared it with vivado for your board? If you made this... do you have imported your hardware description in a new Petalinux project? Remember that for every project with Petalinux and Xilinx tools is very important that the tools and Petalinux have the same version, for example Vivado 2015.4 and Petalinux 2015.4.

 

I don't know if this can help you...

 

have a nice day,

Claudio

0 Kudos
Observer nburkitt
Observer
9,220 Views
Registered: ‎06-16-2016

Re: Getting Started with AMP

Hi Claudio. The problem was that I had failed to include the FPGA bitstream in the boot image. Now I can boot Linux from the SD. :-) Now I have to figure out why u-boot fails when I change the kernel load memory address. Thanks again for your help! -Nick
0 Kudos