Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Application loading not working with libdfx

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, linux

Research direction

Start with the modified demo application's calls to dfx_cfg_init, dfx_cfg_load, and dfx_cfg_destroy, then compare the library's behavior with fpgautil on the Kv260/PetaLinux setup. Reproduce the hang with devmem 0xa0000000 and the repeated-load overlay error using /media/dfx-static; done means the static overlay can be loaded safely, the SysInfo register is accessible, and a second load has defined behavior.

Written by the indexing model from the issue text.

Description

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.

Dominant language
C
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Xilinx/libdfx

All issues in Xilinx/libdfx

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.