I have been trying to write a callback function to work with the ConfigureFPGA function to track the bitfile download progress but have been having trouble. Here is a snippet of code that I’ve written to test/debug the function call:
[CODE] okCFrontPanel::ErrorCode temp;
int val = 0;
int *test = &val;
// Download configuration bitfile to FPGA.
temp = xem->ConfigureFPGA("./xilinx/flimControl/flimControl.bit",
configDownloadStatus, test);
// configDownloadStatus(1,2,test);
cout << "Error Code: " << temp << endl;
cout << "Test: " << val << endl;[/CODE]
The associated callback function is:
void configDownloadStatus(int length, int count, void *arg){
*(int*)arg=100;
printf("This is a test.");
cout << "length " << length << " count " << count << endl;
}
If I execute the code above (after successfully opening FrontPanel and the device), I get the following output:
Error Code: 0
Test: 0
If I uncomment the configDownloadStatus(1,2,test); line, I get the following:
Error Code: 0
Test: 100
So, it looks like in both cases the bitfile is being loaded successfully but the callback function is not being executed from the ConfigureFPGA call. Does anyone have any suggestions?