我在加載BBB上的設備樹覆蓋時遇到問題。我運行Debian Linux的8(傑西),內核4.4.17-bone13爲Beaglebone Black Kernel 4.4.17加載設備樹覆蓋並加載PRU .bin
操作系統沒來安裝,所以我從這裏得到它斗篷經理... https://github.com/beagleboard/bb.org-overlays
我跟着指令得到它的設置,一切似乎都很好。現在,我嘗試加載我的設備樹覆蓋...
[email protected]:~# cd /lib/firmware
[email protected]:/lib/firmware# dtc -O dtb -I dts -o /lib/firmware/PRU-GPIO-EXAMP LE-00A0.dtbo -b 0 [email protected] PRU-GPIO-EXAMPLE-00A0.dts
[email protected]:/lib/firmware# cat /sys/devices/platform/bone_capemgr/slots
0: PF---- -1
1: PF---- -1
2: PF---- -1
3: PF---- -1
[email protected]:/lib/firmware# sudo sh -c "echo 'PRU-GPIO-EXAMPLE-00A0' > /sys/devices/platform/bone_capemgr/slots"
[email protected]:/lib/firmware# cat /sys/devices/platform/bone_capemgr/slots
0: PF---- -1
1: PF---- -1
2: PF---- -1
3: PF---- -1
4: P-O-L- 0 Override Board Name,00A0,Override Manuf,PRU-GPIO-EXAMPLE
到目前爲止,它看起來很不錯,現在我嘗試加載我的PRU程序...
[email protected]:/usr# cd /usr/local/test
[email protected]:/usr/local/test# ls
Makefile libprussdrv.a pasm pruss_intc_mapping.h prussdrv.h testPRU testPRU.c testPRU_Off.bin testPRU_Off.p testPRU_On.bin testPRU_On.p
[email protected]:/usr/local/test# ./testPRU testPRU_On.bin
prussdrv_open() failed
我幾乎得到了一切工作,但我得到一個prussdrv_open()失敗的錯誤,不知道爲什麼。一切的代碼來到了這裏...... http://credentiality2.blogspot.com/2015/09/beaglebone-pru-gpio-example.html
// If this segfaults, make sure you're executing as root.
prussdrv_init();
if (prussdrv_open(PRU_EVTOUT_0) == -1) {
printf("prussdrv_open() failed\n");
return 1;
}
如果我猜我一直在下面是過時的和東西已經改變的例子。我已經知道加載樹疊加層的方式已經改變。也許.dts文件格式已經改變,或者我現在在進行prussdrv_open()調用之前必須再次調用prussdrv libarary。讓我知道你認爲可能造成這種情況。