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: 
Highlighted
Visitor ram32xtr
Visitor
7,396 Views
Registered: ‎06-05-2013

Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution

Hi all,

 

First off, some info about my setup:

- Ubuntu 16.04

- Petalinux 2016.4

- Vivado 2016.4

- Zynq ZC706

 

I am looking to write a device driver for a custom core (let's call it mySimpleCore) that is connected to the ARM via an AXI interconnect.

 

Regarding the hardware, I am using a block diagram in Vivado. I am able to generate a bitstream, export the hardware, and successfully test mySimpleCore on the FPGA from the ARM in standalone mode (no Linux yet).

 

Using Petalinux:

I am creating a Petalinux project using:

petalinux-create -t project -n mySimpleProject -s dir_to_bsps/latest_706_bsp_from_xilinx_web.bsp

 

Then, I configure petalinux with the exported hardware:

petalinux-config --get-hw-description=/home/me/vivado_projects/myVivadoProject/myVivadoProject.sdk/design_1_wrapper_hw_platform_0

 

Next step is the packaging with the bitstream:

petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga pre-built/linux/implementation/download.bit --uboot --force

Now I want to create a module skeleton which I can then modify:

petalinux-create -t modules -n simpleModule --enable

The module skeleton is generated successfully. However, I need to modify the compatible property to match mySimpleCore's compatible property.

 

>>> The problem is that I cannot find any mention of mySimpleCore in any dts/dtsi file.

 

When I grep for mySimpleCore, the matching files are

- build/misc/plnx_syshw_data
- project-spec/hw-description/drivers/mySimpleCore_v1_0/src/Makefile
- project-spec/hw-description/drivers/mySimpleCore_v1_0/data/mySimpleCore.mdd
 
Am I missing any steps in the config/build? Should I be adding the entry in the dtsi manually and then recompile to dtb? Should I use SDK?
 
Any help is greatly appreciated.

 

0 Kudos
1 Solution

Accepted Solutions
Visitor ram32xtr
Visitor
13,273 Views
Registered: ‎06-05-2013

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution

 

Looks like the missing command was 

petalinux-build

Once I run that command, I can see my core listed in components/plnx_workspace/device-tree-generations/plnx_arm-systems.dts

 

Now does that mean any changes to the DTS will be overwritten if I build again?.. a question for another time ...

 

 

(Side note, in earlier versions of petalinux, when the subsystems dir was used, only petalinux-config was needed to generate the device tree....)

0 Kudos
10 Replies
Moderator
Moderator
7,373 Views
Registered: ‎12-04-2016

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution

Hi

 

Firstly, dont use upper case for application/module names as petalinux-2016.4 based out of yocto. Yocto doesnt allow uppercase letters to use in recipe names or application names.

 

Following are the steps to add Custom Modules
1. Create a user module by running petalinux-create -t modules from inside a PetaLinux project on your workstation:
$ cd <plnx-proj-root>
$ petalinux-create -t modules --name <user-module-name> --enable
For example, to create a user module called mymodule in C (the default):
$ petalinux-create -t modules --name mymodule --enable
or:
$ petalinux-create -t modules --name mymodule --enable
You can use -h or --help to see the usage of the petalinux-create -t modules. The new module you have created can be found in the <plnx-proj-root>/project-spec/meta-user/recipes-modules/mymodule directory.


2. Change to the newly created module directory.
$ cd <plnx-proj-root>/project-spec/meta-user/recipes-modules/mymodule

 

3. mymodule.c file can be edited or replaced with the real source code for your module. Later if you want to modify your custom user module, you should edit this file.

 

Regarding device tree

When you run petalinux-config, you will see the "Auto Config Settings"sub-menu. If you click in the sub-menu, you will see the list of components, select device tree.

Files impacted when autoconfig is enabled

• <plnx-proj-root>/components/plnx_workspace/device-tree-generation/skeleton.dtsi (Zynq-7000 only)
• <plnx-proj-root>/components/plnx_workspace/device-tree-generation/zynq-7000.dtsi (Zynq-7000 only)

 

Best Regards

Shabbir

0 Kudos
Visitor ram32xtr
Visitor
7,364 Views
Registered: ‎06-05-2013

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution

Hi Shabbir,

 

Regarding device tree

When you run petalinux-config, you will see the "Auto Config Settings"sub-menu. If you click in the sub-menu, you will see the list of components, select device tree.

 

I don't see a list of components in the Auto Config Settings sub-menu. I am attaching a screenshot of the sub-menu contents below.

 

Should I look in another sub-menu for info on my custom core? I couldn't find anything at this point. 

 

sub_menu.png

Visitor ram32xtr
Visitor
7,354 Views
Registered: ‎06-05-2013

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution
Also, as per your caution, I re-did my design with the use of all lowercase characters for the application/module/vivado project/etc...

The outcome is the same.
0 Kudos
Visitor ram32xtr
Visitor
13,274 Views
Registered: ‎06-05-2013

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution

 

Looks like the missing command was 

petalinux-build

Once I run that command, I can see my core listed in components/plnx_workspace/device-tree-generations/plnx_arm-systems.dts

 

Now does that mean any changes to the DTS will be overwritten if I build again?.. a question for another time ...

 

 

(Side note, in earlier versions of petalinux, when the subsystems dir was used, only petalinux-config was needed to generate the device tree....)

0 Kudos
Moderator
Moderator
7,283 Views
Registered: ‎04-17-2011

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution
Petalinux 2016.4 is based on Yocto unlike the 2016.3 version where device tree was generated during petalinux-config. In 2016.4, device-tree-generator will run once you run petalinux-build. The generated device-tree files would be present at <plnx-projroot>/components/plnx_workspace/device-tree-generation/
and <plnx-proj-root>/project-spec/meta-user/recipes-dt/device-tree/.

You should not make changes to the generated files. The only file where you can make changes is system-top.dts present at <plnx-projroot>/project-spec/meta-user/recipes-dt/device-tree.

Add a reference to your PL IP node in this file and add the properties you want to set. Hope this answers your another question this time.
Regards,
Debraj
----------------------------------------------------------------------------------------------
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.
----------------------------------------------------------------------------------------------
0 Kudos
Visitor ram32xtr
Visitor
7,250 Views
Registered: ‎06-05-2013

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution

Hi @debrajr

 

Thanks for looking into this although I had already selected another answer as accepted. You point out very timely and useful info.

 

Let me try to better understand this:

- I can see a system-top.dts file under /project-spec/meta-user/recipes-dt/device-tree/files/  (note that added 'files' dir). I am assuming this is the file you are referring to.

 

- The system-top.dts file does NOT have any entry respective to my custom core. Should I manually insert something for my custom core? If so, should the entry resemble that in the generated dts file? 

 

- Generally what is the relation between /project-spec/meta-user/recipes-dt/device-tree/files/system-top.dts and /components/plnx_workspace/device-tree-generation/plnx_arm-system.dts? How is the format in the former relevant to generate the latter? thanks.

Moderator
Moderator
7,239 Views
Registered: ‎04-17-2011

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution
1. The <plnx-projroot>/project-spec/meta-user/recipes-dt/device-tree holds the device-tree bbappend and files directory. The files directory holds the system-top.dts which can be modified. So, you are correct.

2. You need to make manual changes in the file. Create a reference to the custom-ip node as @yourcustomip and you can add properties underneath that like how you have in the generated dts file.

3. system-top.dts is the Top level .dts file which has user modifications and can overwrite options present in the .dts files like pl.dtsi or plnx_arm-system.dts and finally you get only one compiled devicetree as system.dtb. If you make changes to plnx_arm-system.dts then it gets overwritten by the device tree generator while running petalinux-build.
Regards,
Debraj
----------------------------------------------------------------------------------------------
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.
----------------------------------------------------------------------------------------------
Visitor ram32xtr
Visitor
7,210 Views
Registered: ‎06-05-2013

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution

Hi @debrajr

 

Thanks for the response. Here's what I added to <plnx_proj_root>/project-spec/meta-user/recipes-dt/device-tree/files/system-top.dts

 

&amba_pl {
    #address-cells = <0x1>;
    #size-cells = <0x1>;
    compatible = "simple-bus";
    ranges;
    simple_customcore@43c00000 {
        compatible = "xlnx,simple-customcore-1.0";
        reg = <0x43c00000 0x10000>;
        xlnx,s-axi-ctrl-bus-addr-width = <0x6>;
        xlnx,s-axi-ctrl-bus-data-width = <0x20>;
    };  
}; 

Please let me know whether the additions look reasonable.

 

I was not sure whether to start from amba_pl, or just simple_customcore (obviously in the above case I start from amba_pl).

Looks like after petalinux-build, the generated dts (<plnx-proj-root>/components/plnx_workspace/device-tree-generation/plnx_arm-system.dts) included the above info.

Explorer
Explorer
5,792 Views
Registered: ‎03-09-2017

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution

Hi I am not able to generate system-top.dtsi and device tree when i run petalinux-config... i followed the same procedures as in petalinux user manual and when does i can see these files? Do I need to do petalinux build? but before that i need to add some code in system-top.dtsi file for which i couldnot find it anywhere in my workspace

0 Kudos
Adventurer
Adventurer
2,015 Views
Registered: ‎06-13-2017

Re: Cannot find PL custom core in generated device tree (Petalinux/Vivado 2016.4)

Jump to solution

This solution probably does not work for 2017.4

 

I followed all instructions above, but some things look different:

1. system top has no references to usb0

2. device-tree.mss shows ps7_usbps

3.When linux is loaded plenty of usb-related messages are printed:

 

usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb

...

usbcore: registered new interface driver usbhid
usbhid: USB HID core driver

...

usbcore: registered new interface driver usbfs

 

4. The USB memory plugged in is not detected in any way: lsusb does not return any output, fdisk -l shows the boot partition only.

 

 

0 Kudos