Hello, 

I'm currently trying to configure and use the PRU of the BBB.

So I've tried two different method to do so however, with none of them I 
get succeed and I don't really 
understand why.

1) First method (from Derek Molloy book) :

http://exploringbeaglebone.com/chapter13/
So I have tried to do the PRU-based Clock Signal Generators, because this 
one 
do not required any additional material except an oscilloscope.

So I had load the EBB-PRU-Example DTS overlay (provided in attachment), and 
I have receive the following message : 
# echo EBB-PRU-Example > $SLOTS
[   51.417438] bone_capemgr bone_capemgr: part_number 'EBB-PRU-Example', 
version 'N/A'
[   51.425297] bone_capemgr bone_capemgr: slot #4: override
[   51.430665] bone_capemgr bone_capemgr: Using override eeprom data at 
slot 4
[   51.437772] bone_capemgr bone_capemgr: slot #4: 'Override Board 
Name,00A0,Override Manuf,EBB-PRU-Example'
[   52.526058] gpio-of-helper ocp:gpio_helper: ready
[   52.531052] bone_capemgr bone_capemgr: slot #4: dtbo 
'EBB-PRU-Example-00A0.dtbo' loaded; overlay id #0



# cat $SLOTS
 0: PF----  -1 
 1: PF----  -1 
 2: PF----  -1 
 3: PF----  -1 
 4: P-O-L-   0 Override Board Name,00A0,Override Manuf,EBB-PRU-Example

I have also check :
# lsmod |grep uio
uio_pruss               4590  0 
uio_pdrv_genirq         3317  0 
uio                     8319  2 uio_pruss,uio_pdrv_genirq


root@beagle01:~/labs/exploringBB/chp13/fixedPRUClock# ./build 
PRU Assembler Version 0.86
Copyright (C) 2005-2013 by Texas Instruments Inc.
Pass 2 : 0 Error(s), 0 Warning(s)
Writing Code Image of 12 word(s)

# sudo ./fixedclock
However, when I tried to monitor what append on pin P9_27 but I didn't 
observed anything on this pins.




2) Second method (from the Beagle bone black cookbook written by Charles A 
Hamilton) :

This time, I have use this DTS : BB-BONE-PRU-01 (
https://github.com/jadonk/cape-firmware/blob/master/arch/arm/boot/dts/BB-BONE-PRU-01-00A0.dts
)
In addition, I have tried to used this code :
https://github.com/HudsonWerks/bbb-pru

So first I tried to add the DTS, I received this message : 
# echo EBB-PRU-Exampecho BB-BONE-PRU-01 > $SLOTS
[59800.649273] bone_capemgr bone_capemgr: part_number 'BB-BONE-PRU-01', 
version 'N/A'
[59800.656947] bone_capemgr bone_capemgr: slot #12: override
[59800.662528] bone_capemgr bone_capemgr: Using override eeprom data at 
slot 12
[59800.669680] bone_capemgr bone_capemgr: slot #12: 'Override Board 
Name,00A0,Override Manuf,BB-BONE-PRU-01'
[59800.699368] ------------[ cut here ]------------
[59800.704089] WARNING: CPU: 0 PID: 619 at arch/arm/mach-omap2/omap_hwmod.c:
2087 _enable+0x201/0x210()
[59800.713188] omap_hwmod: pruss: enabled state can only be entered from 
initialized, idle, or disabled state
[59800.722894] Modules linked in: uio_pruss usb_f_ecm g_ether usb_f_rndis 
u_ether libcomposite pvrsrvkm(O) omap_sham omap_aes snd_soc_davinci_mcasp 
snd_soc_edma snd_soc_omap omap_rng rng_core snd_soc_core snd_compress 
snd_pcm_dmaengine snd_pcm snd_timer snd soundcore evdev spi_omap2_mcspi 
uio_pdrv_genirq uio leds_gpio
[59800.751252] CPU: 0 PID: 619 Comm: bash Tainted: G        W  O    
4.1.19-bone20 
#1
[59800.758778] Hardware name: Generic AM33XX (Flattened Device Tree)
[59800.764974] [<c0012f39>] (unwind_backtrace) from [<c00110a9>] (show_stack
+0x11/0x14)
[59800.772791] [<c00110a9>] (show_stack) from [<c002e5b7>] (
warn_slowpath_common+0x6b/0x8c)
[59800.780948] [<c002e5b7>] (warn_slowpath_common) from [<c002e5fb>] (
warn_slowpath_fmt+0x23/0x2c)
[59800.789714] [<c002e5fb>] (warn_slowpath_fmt) from [<c0022dfd>] (_enable+
0x201/0x210)
[59800.797524] [<c0022dfd>] (_enable) from [<c00231fd>] (omap_hwmod_enable+
0x15/0x20)
[59800.805158] [<c00231fd>] (omap_hwmod_enable) from [<c0023e05>] (
omap_device_enable+0x29/0x50)
[59800.813751] [<c0023e05>] (omap_device_enable) from [<c0023e3d>] (
_od_runtime_resume+0x11/0x1c)
[59800.822450] [<c0023e3d>] (_od_runtime_resume) from [<c03c87b9>] (
rpm_callback+0x79/0x8c)
[59800.830608] [<c03c87b9>] (rpm_callback) from [<c03c92a3>] (rpm_resume+
0x25b/0x3f8)
[59800.838237] [<c03c92a3>] (rpm_resume) from [<c03c9483>] (
__pm_runtime_resume+0x43/0x54)
[59800.846319] [<c03c9483>] (__pm_runtime_resume) from [<bf9e6145>] (
pruss_probe+0x64/0x478 [uio_pruss])
[59800.855635] [<bf9e6145>] (pruss_probe [uio_pruss]) from [<c03c4759>] (
platform_drv_probe+0x35/0x74)
[59800.864757] [<c03c4759>] (platform_drv_probe) from [<c03c338b>] (
driver_probe_device+0x173/0x31c)
[59800.873702] [<c03c338b>] (driver_probe_device) from [<c03c1fbf>] (
bus_for_each_drv+0x3f/0x60)
[59800.882297] [<c03c1fbf>] (bus_for_each_drv) from [<c03c31af>] (
device_attach+0x57/0x6c)
[59800.890366] [<c03c31af>] (device_attach) from [<c03c2a17>] (
bus_probe_device+0x5b/0x78)
[59800.898435] [<c03c2a17>] (bus_probe_device) from [<c03c152b>] (device_add
+0x303/0x430)
[59800.906422] [<c03c152b>] (device_add) from [<c04edf9b>] (
of_platform_device_create_pdata+0x5f/0x8c)
[59800.915540] [<c04edf9b>] (of_platform_device_create_pdata) from [<
c04ee047>] (of_platform_notify+0x73/0xa0)
[59800.925364] [<c04ee047>] (of_platform_notify) from [<c0040ac3>] (
notifier_call_chain+0x4b/0x68)
[59800.934137] [<c0040ac3>] (notifier_call_chain) from [<c0040cd5>] (
__blocking_notifier_call_chain+0x2d/0x3c)
[59800.943954] [<c0040cd5>] (__blocking_notifier_call_chain) from [<c0040cfb
>] (blocking_notifier_call_chain+0x17/0x1c)
[59800.954556] [<c0040cfb>] (blocking_notifier_call_chain) from [<c04eea03>] 
(of_property_notify+0x3b/0x54)
[59800.964107] [<c04eea03>] (of_property_notify) from [<c04eea4b>] (
__of_changeset_entry_notify+0x2f/0x98)
[59800.973571] [<c04eea4b>] (__of_changeset_entry_notify) from [<c04ef06f>] 
(of_changeset_apply+0x53/0xe0)
[59800.983042] [<c04ef06f>] (of_changeset_apply) from [<c04f2399>] (
__of_overlay_create+0x21d/0x380)
[59800.991996] [<c04f2399>] (__of_overlay_create) from [<c03d7b59>] (
capemgr_load_slot+0x2c9/0x440)
[59801.000854] [<c03d7b59>] (capemgr_load_slot) from [<c03d90b1>] (
slots_store+0xe1/0x230)
[59801.008927] [<c03d90b1>] (slots_store) from [<c013b831>] (
kernfs_fop_write+0x85/0x130)
[59801.016913] [<c013b831>] (kernfs_fop_write) from [<c00f526f>] (
__vfs_write+0x1b/0x90)
[59801.024807] [<c00f526f>] (__vfs_write) from [<c00f5835>] (vfs_write+0x65/
0x12c)
[59801.032175] [<c00f5835>] (vfs_write) from [<c00f5eb1>] (SyS_write+0x31/
0x6c)
[59801.039283] [<c00f5eb1>] (SyS_write) from [<c000e561>] (ret_fast_syscall+
0x1/0x4c)
[59801.046900] ---[ end trace 946addae1fb87bd8 ]---
[59801.070988] pruss_uio 4a300000.pruss: No children
[59801.081029] gpio-of-helper ocp:gpio_helper: ready
[59801.085871] bone_capemgr bone_capemgr: slot #12: dtbo 
'BB-BONE-PRU-01-00A0.dtbo' loaded; overlay id #0
I don't really understand the middle part, but it seam not to have error.

I have still 
# lsmod |grep uio
uio_pruss               4590  0 
uio_pdrv_genirq         3317  0 
uio                     8319  2 uio_pruss,uio_pdrv_genirq


# cat $SLOTS
 0: PF----  -1 
 1: PF----  -1 
 2: PF----  -1 
 3: PF----  -1 
12: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-BONE-PRU-01




Then, I just use the makefile
# make
pasm -b major-tom-pru.p

PRU Assembler Version 0.86
Copyright (C) 2005-2013 by Texas Instruments Inc.

Pass 2 : 0 Error(s), 0 Warning(s)

Writing Code Image of 6 word(s)

cc -Wall -Werror   -c -o major-tom-pru.o major-tom-pru.c
cc   major-tom-pru.o  -lpthread -lprussdrv -o major-tom-pru



# sudo ./major-tom-pru
prussdrv_open() failed



So it is link with this code section
/* open the interrupt */
   if((rtn = prussdrv_open(PRU_EVTOUT_0)) != 0) {
      fprintf(stderr, "prussdrv_open() failed\n");
      return rtn;
   }
   
And generally they fixed it by adding the DTS but I already loaded it.


That is why I have no clue on what's going wrong on both example.
My main purpose is to test if my configuration are correct in order to do 
then more advance
example with the PRU. 
If someone have an idea to fix this ?
In addition if someone have some other good example on PRU working on the 
v4.1.19, I will be glad to see them.
Thanks by advance
Regards 
Vincent

Rq ;
# uname -a
Linux beagle01 4.1.19-bone20 #1 Tue Mar 8 01:54:43 UTC 2016 armv7l GNU/Linux


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to