主题:请教6800的SPI

  共有42981人关注过本帖    
帅哥哟,离线,有人找我吗?
蜘蛛侦探
1楼 信息 | 搜索 | 邮箱


加好友 发短信
请教6800的SPI  发帖心情 Post By:2018-11-24 15:55:00   [显示全部帖子]


说明文档中描述:

图片点击可在新窗口打开查看


光盘DEMO:


static const char *device = "/dev/spidev1.3";
static uint8_t mode = 3;
static uint8_t bits = 8;
static uint32_t speed = 3000000;
static uint16_t delay;


实际模块上:


图片点击可在新窗口打开查看


实际上把test_spi的代码改成


//static const char *device = "/dev/spidev1.3";

static const char *device = "/dev/spidev1.0";


编译运行的结果如下:


root@esm6800h:/mnt/nfs/test/test_spi/Debug# ./test_spi
spi mode: 3[ 1528.367021] Unable to handle kernel paging request at virtual address 316e                                      619f
[ 1528.375022] pgd = 80004000
[ 1528.377735] [316e619f] *pgd=00000000
[ 1528.381334] Internal error: Oops: 5 [#1] SMP ARM
[ 1528.385954] Modules linked in: mx6s_capture
[ 1528.390174] CPU: 0 PID: 61 Comm: spi1 Not tainted 4.1.15+gd5d7c02 #1027
[ 1528.396791] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 1528.402977] task: 882a17c0 ti: 88386000 task.ti: 88386000
[ 1528.408391] PC is at clk_core_enable+0xc/0xa0
[ 1528.412757] LR is at clk_enable+0x20/0x34
[ 1528.416773] pc : [<805b0cd4>]    lr : [<805b1308>]    psr: 200f0093
[ 1528.416773] sp : 88387ee8  ip : 00000000  fp : 00000000
[ 1528.428258] r10: 80b6e0d8  r9 : 00000000  r8 : 00000000
[ 1528.433490] r7 : 00000001  r6 : a00f0013  r5 : a00f0013  r4 : 316e6163
[ 1528.440021] r3 : 882a17c0  r2 : 00000001  r1 : 0b4d0b4c  r0 : 316e6163
[ 1528.446555] Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[ 1528.453955] Control: 10c53c7d  Table: 889dc06a  DAC: 00000015
[ 1528.459705] Process spi1 (pid: 61, stack limit = 0x88386210)
[ 1528.465369] Stack: (0x88387ee8 to 0x88388000)
[ 1528.469737] 7ee0:                   882a17c0 88382c00 a00f0013 805b1308 8043fdbc 8832                                      5650
[ 1528.477924] 7f00: 883255ec 8043fdcc 8043fdbc 88325400 883255ec 8043ba70 88387f5c 8832                                      55c4
[ 1528.486111] 7f20: 80b6e0d8 883255c4 80b6e0d8 00000001 883255c8 00000000 00000000 80b6                                      e0d8
[ 1528.494297] 7f40: 00000000 8004c418 882a17c0 88382dc0 00000000 883255c4 8004c3c0 0000                                      0000
[ 1528.502483] 7f60: 00000000 8004c774 fced9c4c 00000000 6f7fff9f 883255c4 00000000 0000                                      0000
[ 1528.510672] 7f80: 88387f80 88387f80 00000000 00000000 88387f90 88387f90 88387fac 8838                                      2dc0
[ 1528.518858] 7fa0: 8004c68c 00000000 00000000 8000f528 00000000 00000000 00000000 0000                                      0000
[ 1528.527044] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000                                      0000
[ 1528.535230] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 18e5f2be fdff                                      fffd
[ 1528.543431] [<805b0cd4>] (clk_core_enable) from [<805b1308>] (clk_enable+0x20/0x34)
[ 1528.551108] [<805b1308>] (clk_enable) from [<8043fdcc>] (spi_imx_prepare_message+0x10                                      /0x40)
[ 1528.559475] [<8043fdcc>] (spi_imx_prepare_message) from [<8043ba70>] (__spi_pump_mess                                      ages+0x1c4/0x4d0)
[ 1528.568797] [<8043ba70>] (__spi_pump_messages) from [<8004c418>] (kthread_worker_fn+0                                      x58/0x1b8)
[ 1528.577508] [<8004c418>] (kthread_worker_fn) from [<8004c774>] (kthread+0xe8/0xfc)
[ 1528.585091] [<8004c774>] (kthread) from [<8000f528>] (ret_from_fork+0x14/0x2c)
[ 1528.592324] Code: eaea0e96 e92d4038 e2504000 0a000018 (e594303c)
[ 1528.598427] ---[ end trace e6092cd3f19c373a ]---

bits per word: 8
max speed: 3000000 Hz (3000 KHz)
transfer

Message from syslogd@esm6800h at Tue May  1 23:16:48 2018 ...
esm6800h kernel: [ 1528.459705] Process spi1 (pid: 61, stack limit = 0x88386210)


  单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
蜘蛛侦探
2楼 信息 | 搜索 | 邮箱


加好友 发短信
  发帖心情 Post By:2018-11-26 10:29:00   [显示全部帖子]

liuning@cytrix.com.cn


  单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
蜘蛛侦探
3楼 信息 | 搜索 | 邮箱


加好友 发短信
  发帖心情 Post By:2018-11-26 15:21:00   [显示全部帖子]

收到,谢谢,我来试试


  单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
蜘蛛侦探
4楼 信息 | 搜索 | 邮箱


加好友 发短信
  发帖心情 Post By:2018-11-26 16:02:00   [显示全部帖子]

好像哪里不对?


root@esm6800h:/# /mnt/usb1/mmc_opt zImage /mnt/usb1/zImage

*********INPUT************
cmd zImage
files /mnt/usb1/zImage
**************************

continue:y/n[n]
y
umount: /dev/mmcblk1: not mounted
umount: /dev/mmcblk1boot0: not mounted
umount: /dev/mmcblk1boot1: not mounted
umount: /: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
umount: /dev/mmcblk1rpmb: not mounted
12288+1 records in
12288+1 records out
6291680 bytes (6.3 MB, 6.0 MiB) copied, 1.05642 s, 6.0 MB/s

**************************
UPDATE FINISH!!!!!!!!!!


  单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
蜘蛛侦探
5楼 信息 | 搜索 | 邮箱


加好友 发短信
  发帖心情 Post By:2018-11-26 16:18:00   [显示全部帖子]

root@esm6800h:/# /mnt/usb1/mmc_opt dtb imx6ul-esm6800-emmc.dtb
file not exist, please check!


  单帖管理 | 引用 | 回复 回到顶部
帅哥哟,离线,有人找我吗?
蜘蛛侦探
6楼 信息 | 搜索 | 邮箱


加好友 发短信
  发帖心情 Post By:2018-11-27 11:10:00   [显示全部帖子]

现在好了,谢谢!


代码:

static const char *device = "/dev/spidev1.0";


结果:

root@esm6800h:/mnt/nfs/test/test_spi/Debug# ./test_spi
spi mode: 3
bits per word: 8
max speed: 3000000 Hz (3000 KHz)
transfer
ret=9
0xFF
0xFF
0xFF
0xFF
0xFF
0xFF
0xFF
0xFF
0xFF




  单帖管理 | 引用 | 回复 回到顶部

返回首页

请教6800的SPI

用户名:
            验证码: 验证码,看不清楚?请点击刷新验证码
内容: