AnsweredAssumed Answered

spi driver can not receive

Question asked by peng xi on Oct 9, 2013
Latest reply on Nov 11, 2013 by zhaozhao

imx53   L2.6.35_11.09.01 linux-2.6.35.3

 

if I use transport test , I can transport buf to spi slave,

transport test:

st[ 1 ].tx_buf = buf;

st[ 1 ].len =1;

but when I use receive test, I can receive any message, the spi bus is always 0x80.when I insmod module,the system is crash and print cann't use tx_buf  = NULL .

receive test:

st[ 1 ].rx_buf = buf;

st[ 1 ].len =1;

 

setup spi :

8bit/w 15000000kbps

 

also I cann't find "mxc_spi_buf_tx_u8" in my linux code.

 

kernel print:

[fkuexl]#insmod ads7846.ko

ads7846 probe start

mxc_spi_setup: mode 0, 8 bpw, 1500000 hz

setup mode 0, 8 bits/w, 1500000 Hz max --> 0

ads7846 spi2.0: touchscreen, irq 128

spi_sync 111

xfer_len=8 master_drv_data->usedma=1

 

 

mxc_spi_pio_transfer tx=cf325800,rx=0,len=1

transfer.count =1

transfer.rx_count=1

spi_sync 222=0

 

 

clk

transfer.count=0

 

 

mxc_spi_pio_transfer tx=0,rx=cf325804,len=2

transfer.count =2

transfer.rx_count=2

Unable to handle kernel NULL pointer dereference at virtual address 00000000

pgd = 80004000

[00000000] *pgd=00000000

Internal error: Oops: 17 [#1] PREEMPT

last sysfs file: /sys/devices/virtual/gsl_kmod/gsl_kmod/dev

Modules linked in: ads7846(+)

CPU: 0    Not tainted  (2.6.35.3-1129-g691c08a-fkuexl #255)

PC is at mxc_spi_buf_tx_u8+0x8/0x14

LR is at mxc_spi_pio_transfer+0x110/0x1ec

pc : [<802d64a8>]    lr : [<802d74f8>]    psr: 80000013

sp : cf0a3f20  ip : d0936000  fp : d0876004

r10: 00000001  r9 : d0876000  r8 : 00000002

r7 : 00000000  r6 : cf0f3518  r5 : cf0f3600  r4 : cf325858

r3 : 00000000  r2 : cf0f3518  r1 : 807f91fa  r0 : cf0f3518

Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel

Control: 10c5387d  Table: bf3bc019  DAC: 00000017

Process mxc_spi.1 (pid: 225, stack limit = 0xcf0a22e8)

Stack: (0xcf0a3f20 to 0xcf0a4000)

3f20: 802d73e8 cf0f3600 cf325858 cf0a2000 cf325828 cf325808 cf0f3600 cf0f3518

3f40: 00000000 802d6594 cf325858 00000000 cf0a2000 802d49e0 cf0a2000 ffffffff

3f60: 802d6564 cf0f352c cf0e4cc0 cf0a2000 cf0e4cc0 cf0e4cc8 802d4870 cf0a3f94

3f80: cf0f3520 00000000 cf0f351c 800c0248 cf0a2000 00000000 cf1b65c0 800c3b10

3fa0: cf0a3fa0 cf0a3fa0 00000000 cf039e78 cf0a3fd4 800c00cc cf0e4cc0 00000000

3fc0: 00000000 00000000 00000000 800c37dc 00000000 00000000 cf0a3fd8 cf0a3fd8

3fe0: 00000000 cf039e78 800c3764 800899c0 00000013 800899c0 5a999cc1 5a899cc9

[<802d64a8>] (mxc_spi_buf_tx_u8+0x8/0x14) from [<802d74f8>] (mxc_spi_pio_transfer+0x110/0x1ec)

[<802d74f8>] (mxc_spi_pio_transfer+0x110/0x1ec) from [<802d6594>] (mxc_spi_transfer+0x24/0x28)

[<802d6594>] (mxc_spi_transfer+0x24/0x28) from [<802d49e0>] (bitbang_work+0x170/0x2e0)

[<802d49e0>] (bitbang_work+0x170/0x2e0) from [<800c0248>] (worker_thread+0x17c/0x228)

[<800c0248>] (worker_thread+0x17c/0x228) from [<800c37dc>] (kthread+0x78/0x80)

[<800c37dc>] (kthread+0x78/0x80) from [<800899c0>] (kernel_thread_exit+0x0/0x8)

Outcomes