AnsweredAssumed Answered

Enable ad5933 through i2c_devantech_iss driver does not work

Question asked by abdelghani on May 15, 2014
Latest reply on May 20, 2014 by abdelghani

I want to access the AD5933 through I2C, for that I am using the devantech adapter

 

1. I got the i2c_devantech_iss driver from https://github.com/groeck/devantech

2. Build the driver and load it

3. echo ad5933 0x0d > /sys/bus/i2c/devices/i2c-1/new_device

 

I can see under /sys/bus/i2c/devices/1-000d/iio:device0:

 

drwxr-xr-x 2 root root    0 Aug 12 09:58 buffer

-r--r--r-- 1 root root 4096 Aug 12 09:58 dev

-rw-r--r-- 1 root root 4096 Aug 12 09:58 in_temp0_input

-rw-r--r-- 1 root root 4096 Aug 12 09:58 in_voltage0_scale

-r--r--r-- 1 root root 4096 Aug 12 09:58 in_voltage0_scale_available

-r--r--r-- 1 root root 4096 Aug 12 09:58 name

-rw-r--r-- 1 root root 4096 Aug 12 09:59 out_voltage0_freq_increment

-rw-r--r-- 1 root root 4096 Aug 12 09:59 out_voltage0_freq_points

-rw-r--r-- 1 root root 4096 Aug 12 09:59 out_voltage0_freq_start

-rw-r--r-- 1 root root 4096 Aug 12 09:58 out_voltage0_scale

-r--r--r-- 1 root root 4096 Aug 12 09:58 out_voltage0_scale_available

-rw-r--r-- 1 root root 4096 Aug 12 09:58 out_voltage0_settling_cycles

drwxr-xr-x 2 root root    0 Aug 12 09:58 power

drwxr-xr-x 2 root root    0 Aug 12 09:58 scan_elements

lrwxrwxrwx 1 root root    0 Aug 12 09:58 subsystem -> ../../../../../../../../../../bus/iio

-rw-r--r-- 1 root root 4096 Aug 12 09:58 uevent

 

 

Everything is working fine but I got an error (echo 1 > buffer/enable) at the end when I do:

 

 

echo 15000 > out_voltage0_freq_start

echo 200 > out_voltage0_freq_increment

echo 100 > out_voltage0_freq_points

echo 512 > buffer/length

echo 1 > buffer/enable

 

[ 1427.131307] BUG: unable to handle kernel NULL pointer dereference at 00000016

[ 1427.131326] IP: [<f80a2bf9>] iio_compute_scan_bytes+0x41/0xa8 [industrialio]

[ 1427.131351] *pde = 2ecaa067 *pte = 00000000

[ 1427.131362] Oops: 0000 [#1] PREEMPT SMP

[ 1427.131373] Modules linked in: i2c_devantech_iss(OF) ad5933(FC) ring_sw(FC) industrialio(F) i2c_dev(F) i2c_diolan_u2c(F) fglrx(POF) snd_hda_codec_via(F) snd_hda_intel(F) snd_hda_codec(F) snd_hwdep(F) snd_pcm(F) mcs7830(F) usbnet(F) mii(F) snd_timer(F) snd_page_alloc(F) [last unloaded: i2c_devantech_iss]

[ 1427.131428] Pid: 2147, comm: bash Tainted: PF        C O 3.8.9-200.19.delos.smp.i686 #1    /conga-BAF

[ 1427.131440] EIP: 0060:[<f80a2bf9>] EFLAGS: 00010246 CPU: 1

[ 1427.131454] EIP is at iio_compute_scan_bytes+0x41/0xa8 [industrialio]

[ 1427.131463] EAX: 00000000 EBX: d9ed2c00 ECX: f80f0f54 EDX: 00000001

[ 1427.131470] ESI: 00000002 EDI: 00000001 EBP: e54b7ec4 ESP: e54b7eb0

[ 1427.131478]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068

[ 1427.131486] CR0: 80050033 CR2: 00000016 CR3: 2ec98000 CR4: 000007d0

[ 1427.131493] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000

[ 1427.131498] DR6: ffff0ff0 DR7: 00000400

[ 1427.131508] Process bash (pid: 2147, ti=e54b6000 task=f16439c0 task.ti=e54b6000)

[ 1427.131513] Stack:

[ 1427.131518]  00000000 dc571e28 f14e4800 d9ed2d60 d9ed2c00 e54b7ed8 f80a2c98 d9ed2c00

[ 1427.131537]  d9ed2d60 d9ed2d14 e54b7ef0 f80f0b1f 000080d0 d9ed2c00 d9ed2c00 d9ed2d60

[ 1427.131556]  e54b7f18 f80a34f5 00000002 00000000 dc571e90 f14e4800 00000000 d9ed2c0c

[ 1427.131574] Call Trace:

[ 1427.131593]  [<f80a2c98>] ? iio_sw_buffer_preenable+0x38/0x58 [industrialio]

[ 1427.131606]  [<f80f0b1f>] ? ad5933_ring_preenable+0x2f/0xe0 [ad5933]

[ 1427.131621]  [<f80a34f5>] ? iio_update_buffers+0x185/0x430 [industrialio]

[ 1427.131636]  [<f80a3818>] ? iio_buffer_store_enable+0x78/0xd0 [industrialio]

[ 1427.131650]  [<f80a37a0>] ? iio_update_buffers+0x430/0x430 [industrialio]

[ 1427.131667]  [<c072d6cf>] ? dev_attr_store+0x1f/0x30

[ 1427.131680]  [<c0553e73>] ? sysfs_write_file+0x9b/0x108

[ 1427.131690]  [<c0553dd8>] ? sysfs_remove_files+0x38/0x38

[ 1427.131704]  [<c04f5952>] ? vfs_write+0x82/0x160

[ 1427.131716]  [<c052eb06>] ? dnotify_flush+0xe/0xd0

[ 1427.131728]  [<c050cecb>] ? fget_light+0xb/0xb8

[ 1427.131740]  [<c04f5af1>] ? sys_write+0x41/0x80

[ 1427.131753]  [<c08ee145>] ? sysenter_do_call+0x12/0x26

[ 1427.131760] Code: d0 8b 93 84 01 00 00 89 4d ec e8 cb 14 5f c8 3b 83 84 01 00 00 89 c7 73 43 89 f6 8d bc 27 00 00 00 00 89 fa 89 d8 e8 67 de ff ff <0f> b6 40 16 8d 4f 01 c0 e8 03 0f b6 c0 8d 74 30 ff 89 c2 f7 da

[ 1427.131874] EIP: [<f80a2bf9>] iio_compute_scan_bytes+0x41/0xa8 [industrialio] SS:ESP 0068:e54b7eb0

[ 1427.131890] CR2: 0000000000000016

[ 1427.131901] ---[ end trace ddb458da3b3dd170 ]---

 

 

Any idea please?

Outcomes