Jump to content
  • 0

Problems with decutil command


Quello

Question

Hi.

According to the documentation of Zmod ADC 1410 Low Level Controller IP in order to get the calibration coefficients i am supposed to run "decutil enum" in the terminal on the Eclypse after booting it with the image provided at https://github.com/Digilent/Eclypse-Z7/releases. However, for some reason I am unable to run this command. I get an error saying: ERROR: failed to open file descriptor for I2C device

I have tried googling to find more information about this error, but without luck. The --verbose flag also didn't give anything different. If anyone has any idea how to fix this, that would be great!

Thanks 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi Markus,

I'm yet to look into why the command might be failing to find the I2C device in Petalinux, however, there's a workaround. If you include the source code of dpmutil (it was renamed a while back) in a baremetal SDK or Vitis project, you can print the calibration coefficients using the FDisplayZmodADCCal and FDisplayZmodDACCal functions.

You can find the sources in the dpmutil repo on GitHub.

I've attached a Vitis 2021.1 project which implements that, and the source code of the main file is below, in case you are using a different version.

vitis_export_archive.ide.zip

(Edit: there may be some mistakes in this code, looks like the port info array is supposed to be 8 long instead of 2. I tested it with a Scope and AWG attached to the Eclypse and it prints out their calibration coefficients.)

Hope this helps,

Arthur

 

#include "./dpmutil/dpmutil.h"

int main () {
	dpmutilPortInfo_t pPortInfo[2];

	dpmutilFEnum(FALSE, FALSE, pPortInfo);

	u32 ScopeIndex = 0; // Zmod Port A
	u32 AwgIndex = 0; // Zmod Port B

	printf("========= ZmodScope Calibration Coefficients =========\r\n");
	FDisplayZmodADCCal(NULL, pPortInfo[ScopeIndex].i2cAddr);
	printf("\r\n");

	printf("========= ZmodAWG Calibration Coefficients =========\r\n");
	FDisplayZmodDACCal(NULL, pPortInfo[AwgIndex].i2cAddr);
	printf("\r\n");

	return 0;
}
Edited by artvvb
Link to comment
Share on other sites

  • 0

I found a different workaround. Creating a baremetal application with the ADC AXI adapter and using the zoos library to initialize the ADC. Later I issued a memory read operation from the coefficient registers of the adapter using xsct. Quite a bit more complicated than using the decutil command, but it worked.

 Thanks for the help though!

It would still be great to know why the command is failing to find the i2c device, and how to fix it though.

Markus

 

Link to comment
Share on other sites

  • 0

@Quello

I'm sorry that no one figured this out sooner but we were just looking at this again for a question asked by a different customer and I stumbled upon this thread. The reason it's saying it failed to open the I2C file is because the permissions for that file require root to access it. Please use sudo to run the command or use su to switch to root and then run the command.

Thanks,
Michael

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...