Skip to content

Application loading not working with libdfx #3

@IvoBrandao

Description

@IvoBrandao

Hi,

I'm trying to use this library to create an application to load different bitstreams, but I can't make it work! The hardware project I'm using has a reconfigurable partition with two reconfigurable modules. I'm using Kv260 and petalinux. I have tested this application with real hardware, and I used the fpgautil to load and remove the application, and it works well with it.

I modified the demo application to start loading only the static region of the PL, and it looks like this:

#include <stdio.h>
#include "libdfx.h"

int main()
{
	int  package_id_full,ret;

    	package_id_full = dfx_cfg_init("/media/dfx-static", 0, DFX_EXTERNAL_CONFIG_EN);
    	if (package_id_full < 0) return -1;
	printf("dfx_cfg_init: FULL Package completed successfully\r\n");
	
	ret = dfx_cfg_load(package_id_full);
	printf("dfx_cfg_load: FULL Package completed successfully\r\n");

        ret = dfx_cfg_destroy(package_id_full);
        if (ret) return -1;
	printf("dfx_cfg_destroy: FULL Package completed successfully\r\n");
	return 0;
}	

under the folder /media/dfx-static I have the following:

xilinx-kv260-starterkit-20232:/home/petalinux# ls /media/dfx-static/
dfx-static.bit.bin  dfx-static_i.dtbo

The static bitstream has an AXI slave called SysInfo that I want to access.
In the console, I see the following:

xilinx-kv260-starterkit-20232:/home/petalinux# Dec 22 07:10:33 xilinx-kv260-starterkit-20232 kernel: OF: overlay: WARNING: memory leak will occur if overlay removed, property: /fpga-full/firmware-name
Dec 22 07:10:33 xilinx-kv260-starterkit-20232 kernel: OF: overlay: WARNING: memory leak will occur if overlay removed, property: /fpga-full/pid
Dec 22 07:10:33 xilinx-kv260-starterkit-20232 kernel: OF: overlay: WARNING: memory leak will occur if overlay removed, property: /fpga-full/resets
Dec 22 07:10:33 xilinx-kv260-starterkit-20232 kernel: OF: overlay: WARNING: memory leak will occur if overlay removed, property: /fpga-full/uid
Dec 22 07:10:33 xilinx-kv260-starterkit-20232 kernel: OF: overlay: WARNING: memory leak will occur if overlay removed, property: /__symbols__/fpga_PR0
Dec 22 07:10:33 xilinx-kv260-starterkit-20232 kernel: OF: overlay: WARNING: memory leak will occur if overlay removed, property: /__symbols__/afi0
Dec 22 07:10:33 xilinx-kv260-starterkit-20232 kernel: OF: overlay: WARNING: memory leak will occur if overlay removed, property: /__symbols__/clocking0
Dec 22 07:10:33 xilinx-kv260-starterkit-20232 kernel: OF: overlay: WARNING: memory leak will occur if overlay removed, property: /__symbols__/SysInfo_0

xilinx-kv260-starterkit-20232:/home/petalinux#

I see the device I want to read (/symbols/SysInfo_0) was loaded correctly, but when I try to read the register like this:

xilinx-kv260-starterkit-20232:/home/petalinux# devmem 0xa0000000
  • 1rst problem - This board just hangs, and I have to manually reset it.
  • 2nd problem - when I try to load the application twice, I get this error:
xilinx-kv260-starterkit-20232:~$ Dec 22 07:26:50 xilinx-kv260-starterkit-20232 kernel: fpga_region region0: Region already has overlay applied.
Dec 22 07:26:50 xilinx-kv260-starterkit-20232 kernel: OF: overlay: overlay changeset pre-apply notifier error -22, target: /fpga-full
Dec 22 07:26:50 xilinx-kv260-starterkit-20232 kernel: create_overlay: Failed to create overlay (err=-22)

Shouldn't the library verify if the same overlay is already applied and remove it before applying a new one?

I removed the overlay that is loaded by default by removing the overlay, with rmdir

xilinx-kv260-starterkit-20232:/home/petalinux# rmdir /configfs/device-tree/overlays/k26-starter-kits_image_1/

Then it loads I still have the 1rst problem.
So my question is what is the difference between using fpgautil and this library?

Thanks in advance for any support provided with this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions