测试硬件:Bealgebone black 开发板
测试软件:ti-processor-sdk-linux-rt-am335x-evm-03.01.00.06-Linux-x86-Install
测试目的:测试Bealgebone black PRU使用
测试场景:在TI官网文档PRU Training: Hands-on Labs中LAB 5: RPMsg Communication between ARM and PRU中
基于BeagleBone Black 做PRU 测试时的问题:
问题描述:
1) modprobe virtio_rpmsg_bus
2)modprobe repmsg rpmsg_pru
3) modprobe pru_rproc 产生异常信息,详细信息如下:
[root@ZHU ]$modprobe pru_rproc
[ 110.237337] Driver name is 'ti-pruss'
[ 110.241170] bUS: 'platform' ? 'ti-pruss': add driver
[ 110.253903] ti-pruss 4a300000.pruss: creating PRU cores and other child platform devices
[ 110.286336] Driver name is 'pruss-intc'
[ 110.290343] bUS: 'platform' ? 'pruss-intc': add driver
[ 110.300007] PRUSS_INTC_PROBE
[ 110.302959] IS_ERR(DDDDDDDDDDDDDDDDDDD)
[ 110.306897] INTC->MEM.VA e0908000
[ 110.310052] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.315222] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.320389] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.325557] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.330724] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.335891] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.341058] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.346225] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.351391] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.356558] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.361724] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.377897] Driver name is 'pru-rproc'
[ 110.381997] bUS: 'platform' ? 'pru-rproc': add driver
[ 110.391811] remoteproc0: 4a334000.pru0 is available
[ 110.396893] remoteproc0: Note: remoteproc is still under development and considered experimental.
[ 110.405895] remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[ 110.419767] pru-rproc 4a334000.pru0: booting the PRU core manually
[ 110.426023] remoteproc0: powering up 4a334000.pru0
[ 110.431085] remoteproc0: Booting fw image am335x-pru0-fw, size 27296
[ 110.437607] remoteproc0: remote processor 4a334000.pru0 is now up
[ 110.443835] pru-rproc 4a334000.pru0: PRU rproc node /ocp/pruss@4a300000/pru0@4a334000 probed successfully
[ 110.453867] remoteproc1: 4a338000.pru1 is available
[ 110.458860] remoteproc1: Note: remoteproc is still under development and considered experimental.
[ 110.467857] remoteproc1: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
[ 110.484407] virtio_dev_probe INIT
[ 110.487923] remoteproc1: powering up 4a338000.pru1
[ 110.492830] remoteproc1: Booting fw image am335x-pru1-fw, size 73780
[ 110.503656] INTC->MEM.VA e0908000
[ 110.506823] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.511995] INTC->MEM.VA e0908000[ 110.515339] ti-pruss 4a300000.pruss: configured system_events = 0x00000000000c0000 intr_channels = 0x0000000a host_intr = 0x0000000a
[ 110.527301] INTC->MEM.VA e0908000
[ 110.530452] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.535621] INTC->MEM.VA e0908000INTC->MEM.VA e0908000
[ 110.540788] INTC->MEM.VA e0908000INTC->MEM.VA e0908000 remoteproc1: remote processor 4a338000.pru1 is now up
[ 110.551341] INTC->MEM.VA 0
[ 110.554070] INTC->MEM.VA e0908000
[ 110.554071] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 110.562981] remoteproc1: registered virtio0 (type 7)
[ 110.568112] pru-rproc 4a338000.pru1: PRU rproc node /ocp/pruss@4a300000/pru1@4a338000 probed successfully
加载pru_rproc模块过程中产生 INTC->MEM.VA为 0的现象??
请问这是什么原因??
Denny%20Yang99373:
先看看PRU的代码有没有正确跑起来?如果跑不起来就做些对比试验看看有没有能跑起来的FIRMWARE
INTC->MEM.VA 0 需要找到打印的地方,具体分析一下,可能是PRU RESOURCE TABLE里面配成这样的
郑州–大胜:
回复 Denny%20Yang99373:
谢谢您的回复,
1)先看看PRU的代码有没有正确跑起来?如果跑不起来就做些对比试验看看有没有能跑起来的FIRMWARE
在TI官网文档PRU Training: Hands-on Labs中LAB 4测试正确,固件是没有问题的
2)INTC->MEM.VA 0 需要找到打印的地方,具体分析一下,可能是PRU RESOURCE TABLE里面配成这样的
INTC->MEM.VA 0 的打印信息是我在linux内核的drivers/remoteproc目录的pruss_intc.c中的函数中添加如下调试内容产生的
static inline void pruss_intc_write_reg(struct pruss_intc *intc,unsigned int reg, u32 val){
printk(KERN_ERR "INTC->MEM.VA %x", intc->mem.va); //添加调试内容
if (intc->mem.va == 0 ) //添加调试内容 { return; //添加调试内容 } writel_relaxed(val, intc->mem.va + reg);}
如果不添加该部分调试内容,尤其是对intc->mem.va == 0时的判断,则会产生
[ 94.591570] remoteproc1: Booting fw image am335x-pru1-fw, size 74204
[ 94.605949] ti-pruss 4a300000.pruss: configured system_events = 0x00000000000c0000 intr_channels = 0x0000000a host_intr = 0x0000000a
[ 94.618161] remoteproc1: remote processor 4a338000.pru1 is now up
[ 94.624617] Unable to handle kernel NULL pointer dereference at virtual address 00000020
[ 94.632771] pgd = dde08000
[ 94.635487] [00000020] *pgd=9ddb2831, *pte=00000000, *ppte=00000000
[ 94.641805] Internal error: Oops: 817 [#1] PREEMPT ARM
[ 94.641821] Modules linked in: virtio_rpmsg_bus(+) pru_rproc pruss_intc pruss remoteproc virtio virtio_ring
[ 94.641833] CPU: 0 PID: 99 Comm: modprobe Tainted: G W O 4.4.19-rt25 #6
[ 94.641835] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 94.641839] task: dde10680 ti: ddd76000 task.ti: ddd76000
[ 94.641864] PC is at pruss_intc_trigger+0x48/0x60 [pruss_intc]
[ 94.641867] LR is at 0xdd0003c0
[ 94.641872] pc : [<bf021140>] lr : [<dd0003c0>] psr: 60080013
[ 94.641872] sp : ddd77bd0 ip : dd0004b8 fp : ddd77bdc
[ 94.641875] r10: de845e00 r9 : 00000200 r8 : 024000c0
[ 94.641879] r7 : ddde8010 r6 : 00000010 r5 : dddee0c0 r4 : ddca7820
[ 94.641882] r3 : 00000013 r2 : 00000000 r1 : 000000be r0 : 00000000
[ 94.641888] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 94.641892] Control: 10c5387d Table: 9de08019 DAC: 00000051
[ 94.641895] Process modprobe (pid: 99, stack limit = 0xddd76208)
[ 94.641899] Stack: (0xddd77bd0 to 0xddd78000)
[ 94.641907] 7bc0: ddd77bf4 ddd77be0 bf0275e0 bf021104
[ 94.641916] 7be0: dddee180 dddee0c0 ddd77c04 ddd77bf8 bf00f6a4 bf02759c ddd77c1c ddd77c08
[ 94.641924] 7c00: bf000110 bf00f688 00000001 dddee0c0 ddd77c84 ddd77c20 bf03342c bf0000f8
[ 94.641932] 7c20: 00000035 ddd9b6e0 ddd77c6c de844000 bf033ba0 00004000 bf032ee0 bf032eb4
[ 94.641940] 7c40: dddee180 dddee6c0 00000002 00000000 00000200 9e845e00 ddd938c0 ddde81e0
[ 94.641948] 7c60: 00000000 ddde8010 ddde8030 00000001 00000000 00000000 ddd77ce4 ddd77c88
[ 94.641957] 7c80: bf0073b0 bf033164 c0165398 c0161c1c ddde8030 00000000 ddde8038 00000000
[ 94.641965] 7ca0: ddde8010 0000000c ddde81e0 00000000 ddde8030 bf033cf8 ddd77ce4 ddde8030
[ 94.641973] 7cc0: c093f754 c093f764 00000000 bf033cf8 0000000c 00000000 ddd77d0c ddd77ce8
[ 94.641981] 7ce0: c03c7b8c bf007180 ddde8030 bf033cf8 ddde8064 00000000 ddd27648 222d89dc
[ 94.641989] 7d00: ddd77d2c ddd77d10 c03c7d1c c03c7994 00000000 bf033cf8 c03c7c88 00000000
[ 94.641998] 7d20: ddd77d54 ddd77d30 c03c5dfc c03c7c94 ddd95464 dddef244 ddd95488 bf033cf8
[ 94.642006] 7d40: dddef000 bf007b64 ddd77d64 ddd77d58 c03c747c c03c5d98 ddd77d8c ddd77d68
[ 94.642014] 7d60: c03c70c4 c03c7464 bf033c60 ddd77d78 bf033cf8 bf037000 c08babe0 ddd27800
[ 94.642023] 7d80: ddd77da4 ddd77d90 c03c823c c03c6f28 00000000 bf037000 ddd77db4 ddd77da8
[ 94.642031] 7da0: bf0078c4 c03c81c8 ddd77dcc ddd77db8 bf037044 bf0078a0 c08babe0 bf037000
[ 94.642039] 7dc0: ddd77e4c ddd77dd0 c00096d4 bf03700c 0040003e bf033e00 ddd77e2c ddd77de8
[ 94.642048] 7de0: c00b8a04 c06306c4 00000000 de7a00f8 ddd76000 dddceb00 c00e6164 dd801e40
[ 94.642056] 7e00: 00005090 bf033e00 ddd77e44 ddd77e18 c00f0818 c00efc4c 00000001 c00e6164
[ 94.642064] 7e20: c092e7bc bf033e00 00000001 ddd27700 00000001 ddd27648 222d89dc bf033e00
[ 94.642073] 7e40: ddd77e74 ddd77e50 c00b0b84 c0009648 ddd27640 00000001 ddd77e74 ddd77f44
[ 94.642081] 7e60: 00000001 ddd27640 ddd77f3c ddd77e78 c0092044 c00b0b28 bf033e0c 00007fff
[ 94.642089] 7e80: bf033e00 c008f4f8 dddee600 c07b9ba8 c07b9b80 c07b9bd8 c07b9b74 c0634e80
[ 94.642097] 7ea0: 00000000 bf033e0c bf033f90 e0946bbc 00000000 bf033f18 c008eda8 bf033e48
[ 94.642106] 7ec0: bf033766 00000001 00036692 00000000 0b300002 bf033668 00000008 00000000
[ 94.642113] 7ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 94.642121] 7f00: 00000000 00000000 00000000 00000000 00000030 00000000 00000004 000acb8b
[ 94.642129] 7f20: 0000017b c000fb84 ddd76000 00000000 ddd77fa4 ddd77f40 c0092484 c0090314
[ 94.642138] 7f40: ddd77f94 e0941000 00005c0c e094675c e0943f8b e0945044 00001fc8 00002968
[ 94.642145] 7f60: 00000000 00000000 00000000 00001c6c 0000001c 0000001d 00000015 00000011
[ 94.642154] 7f80: 0000000e 00000000 ddd77fa4 7fffffff ffffffff 00000000 00000000 ddd77fa8
[ 94.642162] 7fa0: c000f9c0 c0092408 7fffffff ffffffff 00000004 000acb8b 00000000 000da0f0
[ 94.642170] 7fc0: 7fffffff ffffffff 00000000 0000017b 000bf758 000f6148 b6faa6e0 000bee04
[ 94.642178] 7fe0: be946ab8 be946aa8 00027925 b6eb3df2 80080030 00000004 00000000 00000000
[ 94.642181] Backtrace:
[ 94.642210] [<bf0210f8>] (pruss_intc_trigger [pruss_intc]) from [<bf0275e0>] (pru_rproc_kick+0x50/0x6c [pru_rproc])
[ 94.642262] [<bf027590>] (pru_rproc_kick [pru_rproc]) from [<bf00f6a4>] (rproc_virtio_notify+0x28/0x30 [remoteproc])
[ 94.642268] r5:dddee0c0 r4:dddee180
[ 94.642311] [<bf00f67c>] (rproc_virtio_notify [remoteproc]) from [<bf000110>] (virtqueue_notify+0x24/0x3c [virtio_ring])
[ 94.642356] [<bf0000ec>] (virtqueue_notify [virtio_ring]) from [<bf03342c>] (rpmsg_probe+0x2d4/0x444 [virtio_rpmsg_bus])
[ 94.642361] r5:dddee0c0 r4:00000001
[ 94.642389] [<bf033158>] (rpmsg_probe [virtio_rpmsg_bus]) from [<bf0073b0>] (virtio_dev_probe+0x23c/0x3bc [virtio])
[ 94.642399] r10:00000000 r9:00000000 r8:00000001 r7:ddde8030 r6:ddde8010 r5:00000000
[ 94.642402] r4:ddde81e0
[ 94.642429] [<bf007174>] (virtio_dev_probe [virtio]) from [<c03c7b8c>] (driver_probe_device+0x204/0x300)
[ 94.642438] r10:00000000 r9:0000000c r8:bf033cf8 r7:00000000 r6:c093f764 r5:c093f754
[ 94.642441] r4:ddde8030
[ 94.642451] [<c03c7988>] (driver_probe_device) from [<c03c7d1c>] (__driver_attach+0x94/0x98)
[ 94.642460] r9:222d89dc r8:ddd27648 r7:00000000 r6:ddde8064 r5:bf033cf8 r4:ddde8030
[ 94.642470] [<c03c7c88>] (__driver_attach) from [<c03c5dfc>] (bus_for_each_dev+0x70/0xa4)
[ 94.642477] r7:00000000 r6:c03c7c88 r5:bf033cf8 r4:00000000
[ 94.642485] [<c03c5d8c>] (bus_for_each_dev) from [<c03c747c>] (driver_attach+0x24/0x28)
[ 94.642491] r6:bf007b64 r5:dddef000 r4:bf033cf8
[ 94.642499] [<c03c7458>] (driver_attach) from [<c03c70c4>] (bus_add_driver+0x1a8/0x220)
[ 94.642508] [<c03c6f1c>] (bus_add_driver) from [<c03c823c>] (driver_register+0x80/0x100)
[ 94.642516] r7:ddd27800 r6:c08babe0 r5:bf037000 r4:bf033cf8
[ 94.642528] [<c03c81bc>] (driver_register) from [<bf0078c4>] (register_virtio_driver+0x30/0x44 [virtio])
[ 94.642533] r5:bf037000 r4:00000000
[ 94.642553] [<bf007894>] (register_virtio_driver [virtio]) from [<bf037044>] (rpmsg_init+0x44/0x84 [virtio_rpmsg_bus])
[ 94.642571] [<bf037000>] (rpmsg_init [virtio_rpmsg_bus]) from [<c00096d4>] (do_one_initcall+0x98/0x1e4)
[ 94.642576] r5:bf037000 r4:c08babe0
[ 94.642593] [<c000963c>] (do_one_initcall) from [<c00b0b84>] (do_init_module+0x68/0x384)
[ 94.642603] r10:bf033e00 r9:222d89dc r8:ddd27648 r7:00000001 r6:ddd27700 r5:00000001
[ 94.642606] r4:bf033e00
[ 94.642621] [<c00b0b1c>] (do_init_module) from [<c0092044>] (load_module+0x1d3c/0x1f90)
[ 94.642627] r6:ddd27640 r5:00000001 r4:ddd77f44
[ 94.642636] [<c0090308>] (load_module) from [<c0092484>] (SyS_finit_module+0x88/0x98)
[ 94.642645] r10:00000000 r9:ddd76000 r8:c000fb84 r7:0000017b r6:000acb8b r5:00000004
[ 94.642648] r4:00000000
[ 94.642661] [<c00923fc>] (SyS_finit_module) from [<c000f9c0>] (ret_fast_syscall+0x0/0x44)
[ 94.642667] r6:00000000 r5:ffffffff r4:7fffffff
[ 94.642676] Code: 03800001 e3500000 1a000002 e5922024 (e5823020)
[ 95.281018] —[ end trace 0000000000000003 ]—
Segmentation fault
这类错误,请帮忙分析原因??是否pru与linux之间的通信功能仍未实现或正在开发中?????