Post Go back to editing

Problem creating buffer for ADIS16475 using libiio

Category: Software
Product Number: ADIS16475
Software Version: Libiio version 0.25

I'm trying to create a buffer using the "iio_device_create_buffer", but this either gives a EINVAL error when I'm trying to create a non-cyclic buffer or a EPERM error when I'm trying to create a cyclic buffer.

Maybe it has something to do with the triggers not properly working because `iio_info` gives the folowing output:

iio_info version: 0.25 (git tag:v0.25)
Libiio version: 0.25 (git tag: v0.25) backends: local xml ip usb serial
IIO context created with local backend.
Backend version: 0.25 (git tag: v0.25)
Backend description string: Linux scout 6.1.74-v8+ #4 SMP PREEMPT Wed Mar 13 15:23:35 CET 2024 aarch64
IIO context has 2 attributes:
	local,kernel: 6.1.74-v8+
	uri: local:
IIO context has 4 devices:
	hwmon0: cpu_thermal
		1 channels found:
			temp1:  (input)
			2 channel-specific attributes found:
				attr  0: crit value: 110000
				attr  1: input value: 45277
		No trigger on this device
	hwmon1: rpi_volt
		1 channels found:
			in0:  (input)
			1 channel-specific attributes found:
				attr  0: lcrit_alarm value: 0
		No trigger on this device
	iio:device0: adis16475-2 (buffer capable)
		8 channels found:
			anglvel_x:  (input, index: 0, format: be:S32/32>>0)
			3 channel-specific attributes found:
				attr  0: calibbias value: 0
				attr  1: raw value: 119056
				attr  2: scale value: 0.000000006
			anglvel_y:  (input, index: 1, format: be:S32/32>>0)
			3 channel-specific attributes found:
				attr  0: calibbias value: 0
				attr  1: raw value: -402139
				attr  2: scale value: 0.000000006
			anglvel_z:  (input, index: 2, format: be:S32/32>>0)
			3 channel-specific attributes found:
				attr  0: calibbias value: 0
				attr  1: raw value: 270085
				attr  2: scale value: 0.000000006
			accel_x:  (input, index: 3, format: be:S32/32>>0)
			3 channel-specific attributes found:
				attr  0: calibbias value: 0
				attr  1: raw value: 648069
				attr  2: scale value: 0.000000037
			accel_y:  (input, index: 4, format: be:S32/32>>0)
			3 channel-specific attributes found:
				attr  0: calibbias value: 0
				attr  1: raw value: -1538946
				attr  2: scale value: 0.000000037
			accel_z:  (input, index: 5, format: be:S32/32>>0)
			3 channel-specific attributes found:
				attr  0: calibbias value: 0
				attr  1: raw value: 262572835
				attr  2: scale value: 0.000000037
			temp0:  (input, index: 6, format: be:S16/16>>0)
			2 channel-specific attributes found:
				attr  0: raw value: 262
				attr  1: scale value: 100
			timestamp:  (input, index: 7, format: le:S64/64>>0)
		4 device-specific attributes found:
				attr  0: current_timestamp_clock value: realtime

				attr  1: filter_low_pass_3db_frequency value: 720
				attr  2: sampling_frequency value: 10.000000
				attr  3: waiting_for_supplier value: 0
		2 buffer-specific attributes found:
				attr  0: data_available value: 0
				attr  1: direction value: in
		6 debug attributes found:
				debug attr  0: firmware_date ERROR: Permission denied (13)
				debug attr  1: firmware_revision ERROR: Permission denied (13)
				debug attr  2: flash_count ERROR: Permission denied (13)
				debug attr  3: product_id ERROR: Permission denied (13)
				debug attr  4: serial_number ERROR: Permission denied (13)
				debug attr  5: direct_reg_access value: 0x0
ERROR: checking for trigger : Input/output error (5)
	trigger0: adis16475-2-dev0
		0 channels found:
		No trigger on this device

and also `$cat /proc/interrupts` shows no interrupt happening:

39:          0          0          0          0  pinctrl-bcm2835  24 Edge      adis16475-2

I'm not sure where to look further to fix this problem, so any help would be greatly appreciated!

Parents
  • Hi,

    Thank you for providing detailed information regarding your challenges while working with the ADIS16475 and libido. Based on your message, let me recommend some initial steps to debug. 

    Based on the symptoms you've described, there are a few key areas to investigate to resolve the issues with buffer creation and the apparent absence of interrupts. Here are the steps I recommend taking to troubleshoot and hopefully resolve the problems:

    • The errors related to trigger configuration (EPERM for cyclic buffers and "ERROR: checking for trigger: Input/output error (5)") indicate that the device might not be correctly configured with a trigger. Triggers are essential for controlling when data acquisition starts and stops, especially for cyclic buffers.
    • Verify that a trigger is correctly associated with your device. This may involve setting a system or software trigger and ensuring the ADIS16475 correctly recognizes it.
    • Since/proc/interrupts do not show any interrupts for the device, verifying the physical connections, especially the interrupt line between the ADIS16475 and your system, is crucial. Ensure the interrupt line is correctly wired and configured to generate hardware interrupts.
    • Ensure your system's kernel is configured to support the necessary features, such as GPIO interrupts, required for your device to function correctly.
  • Thank you very much! I realized that indeed the trigger was not properly configured I needed to set it to `adis16475-2-dev0` before creating the buffer. I do have a new problem where if I run the sensor on around 10Hz or higher it stops giving values after a couple of seconds with just all values being 0.

  • Never mind, I see that that was a problem with my maximum configured spi frequency

Reply Children
No Data