CubieBoard博客-HomeCubieTech公司网站

cubie.cc CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 2116|回复: 5

SPI device driver issue on Cubietruck Android

[复制链接]

2

主题

0

好友

250

积分

中级会员

Rank: 3Rank: 3

贡献
54
金钱
81
威望
54
买家信用
卖家信用
积分
250
发表于 2015-9-22 12:14:27 |显示全部楼层
Hi everyone,

I have a question on cubietruck SPI, and am seeking help from this group. Hope someone can help me.

My target OS is android, and the BSP is cubieboard2_android_SDK_v1.09. The SPI2 (pin5~8) is used and the configuration is as following:
[spi2_para]
spi_used            = 1
spi_cs_bitmap       = 1
spi_cs0             = portC19<3><default><default><default>
spi_cs1             = portB13<2><default><default><default>
spi_sclk            = portC20<3><default><default><default>
spi_mosi            = portC21<3><default><default><default>
spi_miso            = portC22<3><default><default><default>

[spi_devices]
spi_dev_num = 1

[spi_board0]
modalias = "spidev"
max_speed_hz = 12000000
bus_num = 2
chip_select = 0
mode = 0
full_duplex = 0
manual_cs = 0

When I try to debug the spi driver, I got the log info as following:

[spi-dbg] sun7i_spi_transfer: enter
[spi-dbg] sun7i_spi_work: enter
[spi-dbg] sun7i_spi_xfer: spi2 begin transfer, txbuf ecea2ac0, rxbuf   (null), len 246
[spi-dbg] spi_set_bc_wtc: bc: 246
[spi-dbg] spi_set_bc_wtc: tc: 246
[spi-dbg] sun7i_spi_prepare_dma: enter
[spi-dbg] sun7i_spi_config_dma: enter
[spi-dbg] sun7i_spi_start_dma: enter
[spi-dbg] sun7i_spi_xfer: spi2 wait for xfer complete
init: sys_prop: permission denied uid:1003  name:service.bootanim.exit
start_powernow uncare mode:859320624!
wait for xfer complete[spi-dbg] sun7i_spi_transfer: enter
/dev/ttyS0[1]: wait: for: argument must be %job or process id
/dev/ttyS0[1]: wait: xfer: argument must be %job or process id
/dev/ttyS0[1]: wait: complete[spi-dbg]: argument must be %job or process id
/dev/ttyS0[1]: wait: sun7i_spi_transfer:: argument must be %job or process id
/dev/ttyS0[1]: wait: enter: argument must be %job or process id
[spi-dbg] sun7i_spi_work: enter
/dev/ttyS0[2]: [spi-dbg]: not found
[spi-dbg] sun7i_spi_xfer: spi2 begin transfer, txbuf ecea2ac0, rxbuf   (null), len 246
/dev/ttyS0[3]: syntax error: '(' unexpected
[spi-dbg] sun7i_spi_prepare_dma: enter
/dev/ttyS0[1]: [spi-dbg]: not found
[spi-dbg] sun7i_spi_config_dma: enter
/dev/ttyS0[2]: [spi-dbg]: not found
[spi-dbg] sun7i_spi_start_dma: enter
/dev/ttyS0[3]: [spi-dbg]: not found
[spi-dbg] sun7i_spi_xfer: spi2 wait for xfer complete

Somehow SPI transferring was never get finished.

May someone tell me what's wrong and how to do?
Thanks  a lot in advance!
回复

使用道具 举报

118

主题

1

好友

1万

积分

版主

Rank: 7Rank: 7Rank: 7

贡献
2663
金钱
6177
威望
2663
买家信用
卖家信用
积分
14655
发表于 2015-9-23 09:06:26 |显示全部楼层



ttyS0 not open,please open the uart0
回复

使用道具 举报

2

主题

0

好友

250

积分

中级会员

Rank: 3Rank: 3

贡献
54
金钱
81
威望
54
买家信用
卖家信用
积分
250
发表于 2015-9-23 12:38:16 |显示全部楼层
蓝天-彭 发表于 2015-9-23 09:06
ttyS0 not open,please open the uart0

Hi 蓝天-彭

Thanks a lot for your response.
Did you mean uart_para0?
[uart_para0]
uart_used           = 1
uart_port           = 0
uart_type           = 2
uart_tx             = portB22<2><1><default><default>
uart_rx             = portB23<2><1><default><default>
I think it's opened already. Am I right?

thanks again!
回复

使用道具 举报

118

主题

1

好友

1万

积分

版主

Rank: 7Rank: 7Rank: 7

贡献
2663
金钱
6177
威望
2663
买家信用
卖家信用
积分
14655
发表于 2015-9-23 15:07:58 |显示全部楼层
henryhzhang 发表于 2015-9-23 12:38
Hi 蓝天-彭

Thanks a lot for your response.

It is right
回复

使用道具 举报

2

主题

0

好友

250

积分

中级会员

Rank: 3Rank: 3

贡献
54
金钱
81
威望
54
买家信用
卖家信用
积分
250
发表于 2015-9-24 13:20:20 |显示全部楼层
Hello all,

I have found the following descriptions in A20_系统配置手册_V1.0_20130521.pdf

Page #26
7.6. [spi_board0]
chip_select=xx 理论上可以选0,1,2,3,目前只支持1,2(芯片每引出接口)

This pdf file could be found in Android BSP, the path is lichee/tools_win/documentations.

is there anyone could help to explain it?

Thanks a lot!
回复

使用道具 举报

9

主题

0

好友

943

积分

高级会员

Rank: 4

贡献
186
金钱
339
威望
186
买家信用
卖家信用
积分
943
发表于 2015-9-25 10:33:21 |显示全部楼层
Page #26
7.6. [spi_board0]
chip_select=xx   xx should be 0,1,2,3, but only 1,2 for A20
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

QQ|Archiver|手机版|邮件群发|cubie.cc---深刻的嵌入式技术和应用讨论中文社区 ( 粤ICP备13051116号-1  

GMT+8, 2020-4-5 09:23 , Processed in 0.030417 second(s), 8 queries , Apc On.

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc. | Style by Coxxs

回顶部