Trying to start PRU Programming

213 views
Skip to first unread message

Anton Nikiforov

unread,
Sep 16, 2018, 7:37:53 PM9/16/18
to BeagleBoard
There are a lot of examples for PRU in the web, but most of them don't work correctly with latest images .

Most occuring problem - setting up tree overlay for pru.

Are there any  examples or tutorials , which would work with 4.14 kernel , Debian 9.5 2018-08-30?


Robert Nelson

unread,
Sep 16, 2018, 7:42:06 PM9/16/18
to Beagle Board, antox...@gmail.com
First run:

sudo /opt/scripts/tools/version.sh

and dump the output to this email chain.. We will make sure you got
things working in the newish settings:

Then just follow the latest and greatest doc's...

https://markayoder.github.io/PRUCookbook/

Regards,

--
Robert Nelson
https://rcn-ee.com/

TJF

unread,
Sep 17, 2018, 11:02:10 AM9/17/18
to BeagleBoard
It's pretty easy when you use the matching tools:

a) disable rproc
b) disable cape-universal

Instead

c) enable uio_pruss driver
d) install libpruio

Then do pinmuxing by function setPin(Top, Ball, Mode). Single source, no external pinmuxing, no device tree overlay,

It's most likely that you can use some of the libpruio IO features (ADC, GPIO, TIMER. PWM, CAP, QEP). So PRU-0 for your firmware, PRU-1 for hardware driver libpruio. The first prove of concept can be done on ARM CPU, then switch to the PRU for the final shot (fast, hard real-time).

Ask for details if you're interested.
Message has been deleted
Message has been deleted

Anton Nikiforov

unread,
Sep 17, 2018, 12:01:41 PM9/17/18
to BeagleBoard


понедельник, 17 сентября 2018 г., 2:42:06 UTC+3 пользователь RobertCNelson написал:
Version.sh :

git:/opt/scripts/:[73593ebe3b7d3cc381eeb502d45ccb33a6ec5e78]
eeprom:[A335BNLT00C02814BBBK2738]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-08-30]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2015.10-00001-g143c9ee]:[location: dd MBR]
kernel:[4.14.67-ti-r73]
nodejs:[v6.14.4]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.4.20180803.0-0rcnee0~stretch+20180804]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[librobotcontrol]:[1.0.2-git20180829.0-0rcnee0~stretch+20180830]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[    1.044626] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[    1.045829] gpio-of-helper ocp:cape-universal: ready
END
 

Robert Nelson

unread,
Sep 17, 2018, 12:04:41 PM9/17/18
to Beagle Board, Anton Nikiforov
On Mon, Sep 17, 2018 at 10:59 AM Anton Nikiforov <Antox...@gmail.com> wrote:
>
> git:/opt/scripts/:[73593ebe3b7d3cc381eeb502d45ccb33a6ec5e78]
> eeprom:[A335BNLT00C02814BBBK2738]
> model:[TI_AM335x_BeagleBone_Black]
> dogtag:[BeagleBoard.org Debian Image 2018-08-30]
> bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
> bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2015.10-00001-g143c9ee]:[location: dd MBR]

The really old version of U-Boot in the eMMC is blocking overlays from
working properly..

Just run:

sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100

and reboot..

Anton Nikiforov

unread,
Sep 17, 2018, 12:11:17 PM9/17/18
to BeagleBoard


понедельник, 17 сентября 2018 г., 18:02:10 UTC+3 пользователь TJF написал:
I want to use PRU for Bitbanging and i wish i would try as much tools as i can for it. So i'm interested in it.

Anton Nikiforov

unread,
Sep 17, 2018, 12:17:54 PM9/17/18
to BeagleBoard


понедельник, 17 сентября 2018 г., 19:04:41 UTC+3 пользователь RobertCNelson написал:
Got it : 
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied
What it was? Now i can follow https://markayoder.github.io/PRUCookbook/  for some examples, right?

Robert Nelson

unread,
Sep 17, 2018, 12:20:22 PM9/17/18
to Beagle Board, Anton Nikiforov
> Got it :
> 100+0 records in
> 100+0 records out
> 104857600 bytes (105 MB, 100 MiB) copied
> What it was?

Old version of u-boot, blocking the newer u-boot on the microSD from
doing the u-boot overlay method..

> Now i can follow https://markayoder.github.io/PRUCookbook/ for some examples, right?

Correct..

Anton Nikiforov

unread,
Sep 17, 2018, 12:25:14 PM9/17/18
to BeagleBoard
Thanks a lot

понедельник, 17 сентября 2018 г., 19:20:22 UTC+3 пользователь RobertCNelson написал:

TJF

unread,
Sep 20, 2018, 2:48:37 AM9/20/18
to BeagleBoard
Hi Anton!
I added two new examples to the library: pruss_add and pruss_toggle. Find details in the documentation. The example pruss_toggle is close to your bitbanging target. it configures a PRU-GPIO output, toggles that pin and measures the pulse train by libpruio CAP feature. (Reduced toggling speed in order to get good measurements.)

Note: single source! All code in one file (pinmuxing, firmware, PRUSS control), running at user space (no administrator privileges necessary).

Anton Nikiforov

unread,
Sep 22, 2018, 2:31:01 AM9/22/18
to BeagleBoard


четверг, 20 сентября 2018 г., 9:48:37 UTC+3 пользователь TJF написал:
Thanks, i'll try it today, hope it will work properly with last Kernel.

Anton Nikiforov

unread,
Sep 22, 2018, 2:41:38 AM9/22/18
to BeagleBoard


понедельник, 17 сентября 2018 г., 19:20:22 UTC+3 пользователь RobertCNelson написал:
> Got it :


I tried some examples from this PRUCookbook and encountered a following problem:

I'll try to refactore code if there will be no answer for the issue. Maybe there some more examples for PRU for last Kernel?
 

TJF

unread,
Sep 22, 2018, 8:26:30 AM9/22/18
to BeagleBoard

I forgot to mention it (even in the documentation). You can find further information about the PRUSS and the prussdrv-like libpruio functions at the following link:

Reply all
Reply to author
Forward
0 new messages