PRU 2 0 memory addresses

108 views
Skip to first unread message

Vinicius Juvinski

unread,
Jan 3, 2021, 8:50:17 PM1/3/21
to BeagleBoard
Hi guys,

today to load the a code to PRU on BBB, BBG and Pocket we are using this addresses:

POCKET:
#define RCIN_PRUSS_RAM_BASE   0x4a301000
#define RCOUT_PRUSS_RAM_BASE 0x4a300000
#define RCOUT_PRUSS_CTRL_BASE 0x4a322000
#define RCOUT_PRUSS_IRAM_BASE 0x4a334000

BBB:
#define RCIN_PRUSS_RAM_BASE   0x4a303000
#define RCOUT_PRUSS_RAM_BASE 0x4a302000
#define RCOUT_PRUSS_CTRL_BASE 0x4a324000
#define RCOUT_PRUSS_IRAM_BASE 0x4a338000

Anyone please help me in what is the addresses for PRU2_0 for this addresses ? I tried all the addresses I found at AM5729 Reference manual and digging the filesystem I achived this addresses:
#define RCOUT_PRUSS_RAM_BASE      0x4b280000
#define RCOUT_PRUSS_CTRL_BASE     0x4b24000
#define RCOUT_PRUSS_IRAM_BASE     0x4b2b4000
#define RCIN_PRUSS_RAM_BASE       0x4b281000

But or the beagle freeze or there are sigbus error. I create a custom dtb and all pins are as expected.

Thanks for your help



This is the version script:

root@beaglebone:~/ardupilot# /opt/scripts/tools/version.sh
git:/opt/scripts/:[fa783d879c7ae9986f2d97977a8f8987bb16f72e]
model:[BeagleBoard.org_BeagleBone_AI]
dogtag:[BeagleBoard.org Debian Buster IoT TIDL Image 2020-11-30]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2020.10-rc1-00001-gc5bc0aaa70 (Aug 24 2020 - 16:42:42 -0500)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2020.10-rc1-00001-gc5bc0aaa70 (Aug 24 2020 - 16:42:42 -0500)]:[location: dd MBR]
kernel:[4.14.108-ti-r137]
nodejs:[v10.21.0]
device-tree-override:[dtb=am572x-juva1.dtb]
/boot/uEnv.txt Settings:
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20201221.0-0~buster+20201221]
pkg:[bb-customizations]:[1.20201105.0-0~buster+20201110]
pkg:[bb-usb-gadgets]:[1.20200504.0-0~buster+20200504]
pkg:[bb-wl18xx-firmware]:[1.20200813.1-0~buster+20200813]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.5-git20200715.0-0~buster+20200716]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input bluetooth netdev i2c gpio admin spi iio docker tisdk weston-launch xenomai cloud9ide pwm eqep remoteproc]
cmdline:[console=ttyS0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet]
dmesg | grep remote
[   10.000747] remoteproc remoteproc0: 58820000.ipu is available
[   10.042150] remoteproc remoteproc1: 55020000.ipu is available
[   10.054416] remoteproc remoteproc2: 40800000.dsp is available
[   10.055056] remoteproc remoteproc3: 41000000.dsp is available
[   10.113018] remoteproc remoteproc1: powering up 55020000.ipu
[   10.113037] remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4, size 3751356
[   10.201346] remoteproc remoteproc0: powering up 58820000.ipu
[   10.201367] remoteproc remoteproc0: Booting fw image dra7-ipu1-fw.xem4, size 7051536
[   10.234158] remoteproc remoteproc1: registered virtio0 (type 7)
[   10.234164] remoteproc remoteproc1: remote processor 55020000.ipu is now up
[   10.252833] remoteproc remoteproc0: registered virtio1 (type 7)
[   10.252845] remoteproc remoteproc0: remote processor 58820000.ipu is now up
[   10.419761] Modules linked in: omap_remoteproc virtio_rpmsg_bus rpmsg_core usb_f_ncm usb_f_mass_storage usb_f_rndis u_ether libcomposite uio_pdrv_genirq uio cmemk(O) spidev
[   10.420732] Modules linked in: omap_remoteproc virtio_rpmsg_bus rpmsg_core usb_f_ncm usb_f_mass_storage usb_f_rndis u_ether libcomposite uio_pdrv_genirq uio cmemk(O) spidev
[   10.421741] Modules linked in: omap_remoteproc virtio_rpmsg_bus rpmsg_core usb_f_ncm usb_f_mass_storage usb_f_rndis u_ether libcomposite uio_pdrv_genirq uio cmemk(O) spidev
[   10.590953] remoteproc remoteproc2: powering up 40800000.dsp
[   10.590972] remoteproc remoteproc2: Booting fw image dra7-dsp1-fw.xe66, size 21014532
[   10.649036] remoteproc remoteproc2: registered virtio2 (type 7)
[   10.649050] remoteproc remoteproc2: remote processor 40800000.dsp is now up
[   10.758789] remoteproc remoteproc3: powering up 41000000.dsp
[   10.758812] remoteproc remoteproc3: Booting fw image dra7-dsp2-fw.xe66, size 21014532
[   10.800268] remoteproc remoteproc3: registered virtio3 (type 7)
[   10.800276] remoteproc remoteproc3: remote processor 41000000.dsp is now up
[   16.681661] remoteproc remoteproc4: 4b234000.pru is available
[   16.688795] remoteproc remoteproc5: 4b238000.pru is available
[   16.690645] remoteproc remoteproc6: 4b2b4000.pru is available
[   16.693835] remoteproc remoteproc7: 4b2b8000.pru is available
dmesg | grep pru
[   16.498643] pruss 4b200000.pruss: creating PRU cores and other child platform devices
[   16.550295] pruss 4b280000.pruss: creating PRU cores and other child platform devices
[   16.681661] remoteproc remoteproc4: 4b234000.pru is available
[   16.681730] pru-rproc 4b234000.pru: PRU rproc node /ocp/pruss_soc_bus@4b226004/pruss@0/pru@34000 probed successfully
[   16.688795] remoteproc remoteproc5: 4b238000.pru is available
[   16.688867] pru-rproc 4b238000.pru: PRU rproc node /ocp/pruss_soc_bus@4b226004/pruss@0/pru@38000 probed successfully
[   16.690645] remoteproc remoteproc6: 4b2b4000.pru is available
[   16.690698] pru-rproc 4b2b4000.pru: PRU rproc node /ocp/pruss_soc_bus@4b2a6004/pruss@0/pru@34000 probed successfully
[   16.693835] remoteproc remoteproc7: 4b2b8000.pru is available
[   16.693894] pru-rproc 4b2b8000.pru: PRU rproc node /ocp/pruss_soc_bus@4b2a6004/pruss@0/pru@38000 probed successfully
dmesg | grep pinctrl-single
[    0.805236] pinctrl-single 4a003400.pinmux: 282 pins at pa fc003400 size 1128
dmesg | grep gpio-of-helper
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END


Dennis Lee Bieber

unread,
Jan 3, 2021, 11:41:09 PM1/3/21
to Beagleboard
On Sun, 3 Jan 2021 17:50:17 -0800 (PST), in
gmane.comp.hardware.beagleboard.user Vinicius Juvinski
<vinicius.juvinski-Re...@public.gmane.org> wrote:

>
>Anyone please help me in what is the addresses for PRU2_0 for this
>addresses ? I tried all the addresses I found at AM5729 Reference manual
>and digging the filesystem I achived this addresses:

I presume you are using a BB AI board then?

>#define RCOUT_PRUSS_RAM_BASE 0x4b280000
>#define RCOUT_PRUSS_CTRL_BASE 0x4b24000
>#define RCOUT_PRUSS_IRAM_BASE 0x4b2b4000
>#define RCIN_PRUSS_RAM_BASE 0x4b281000

Please cite the page/document in which you found these values.

Page 7394 has:
-=-=-
Table 30-57. PRUSS_PRU_CTRL Instance Summary
Module Name Base Address Size
PRUSS1_PRU0_CTRL 0x4B22 2000 48 Bytes
PRUSS1_PRU1_CTRL 0x4B22 4000 48 Bytes
PRUSS2_PRU0_CTRL 0x4B2A 2000 48 Bytes
PRUSS2_PRU1_CTRL 0x4B2A 4000 48 Bytes
-=-=-

0x4B2A2000 (PRU0; 0x4B2A4000 for PRU1) is quite different from
0x4B24000 (which isn't even 8 hex digits!)

THIS IS LIKELY THE MAIN PROBLEM -- THE OTHER VALUES ARE SOMEWHAT REASONABLE
PER THE FOLLOWING.

Though I'm not certain how you define your RCIN RAM base: 0x4B281000 is
in the middle of the RAM0 range, RAM1 is at 0x4B282000.


Page 397 has
-=-=-
PRU-ICSS1 0x4B20_0000 0x4B27_FFFF 512KiB PRU-ICSS1 configuration registers
PRU-ICSS2 0x4B28_0000 0x4B2F_FFFF 512KiB PRU-ICSS2 configuration registers
-=-=-

Using page 397 and page 418, PRU-ICSS2 RAM0 is at 0x4B280000 and RAM1
is at 0x4B282000. PRU-ICSS2 PRU0 Control is at 0x4B2A2000. PRU-ICSS2 PRU0
IRAM would be 0x4B2B4000.






Page 7362 has the example:
-=-=-
Example 3: DSP1 accesses the PRU0_IRAM in the global memory space to load
instructions to be executed by the PRU0 upon boot time:
• Because the DSP1 is an external host to PRU-ICSS1, it has to target at
first place the PRU-ICSS configuration and memory space in the L3_MAIN
space. For PRU-ICSS1, slave port the base address is 0x4B20_0000.
• According to the Table 30-10, the PRU0_PRUSS1_PRU0_IRAM_TARG offset is
0x0003_4000. Hereby the physical address that DSP1 must use to store the
PRU0 booting instructions to PRU0_IRAM is 0x4B23_4000.
-=-=-



--
Dennis L Bieber

Vinicius Juvinski

unread,
Jan 4, 2021, 4:41:04 PM1/4/21
to BeagleBoard
Hi Dennis,

thanks.
Im migrating a cape BBBMINI - Ardupilot cape for beaglebones.

I will test, thanks again.


Em segunda-feira, 4 de janeiro de 2021 01:41:09 UTC-3, Dennis Bieber escreveu:
On Sun, 3 Jan 2021 17:50:17 -0800 (PST), in
gmane.comp.hardware.beagleboard.user Vinicius Juvinski

Mark Lazarewicz

unread,
Jan 4, 2021, 4:55:40 PM1/4/21
to beagl...@googlegroups.com
Please rephrase the question 

You said you used AM5729 addresses on BBC and BIG this will confuse people.

You also said you find this below in code. It's possible that's an offset only 
#define RCOUT_PRUSS_RAM_BASE      0x4b280000

Stick what's in the reference manual and then verify that with any code accessing area you need as a cross check

Find the offset in manual cross check software offsets is my suggestion 

Mark 

--
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 beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/1dd1f368-c1f5-4426-b5ab-6f1794f21ea3o%40googlegroups.com.

Vinicius Juvinski

unread,
Jan 4, 2021, 5:47:30 PM1/4/21
to beagl...@googlegroups.com

Hi Mark,


My main question is how to use the offsets.
How 0x0002_2000 will become 0x4B2A2000?


For instance on the documents the 

Dennis Lee Bieber

unread,
Jan 5, 2021, 10:02:13 AM1/5/21
to Beagleboard
On Mon, 4 Jan 2021 19:46:53 -0300, in gmane.comp.hardware.beagleboard.user
Vinicius Juvinski
<vinicius.juvinski-Re...@public.gmane.org> wrote:


>
>My main question is how to use the offsets.

By adding them to the correct BASE address...

>How 0x0002_2000 will become 0x4B2A2000?

From my previous post:

> Page 397 has
>-=-=-
>PRU-ICSS1 0x4B20_0000 0x4B27_FFFF 512KiB PRU-ICSS1 configuration registers
>PRU-ICSS2 0x4B28_0000 0x4B2F_FFFF 512KiB PRU-ICSS2 configuration registers
>-=-=-

That's table 2-1 L3 MAIN memory map.

Page 418 table 2-12 PRU-ICSS memory map has
-=-=-
PRUSS_PRU0_CONTROL 0x0002_2000 0x0002_23FF 1KiB PRU-ICSS PRU0 control
-=-=-

... so for PRU-ICSS2 (second PRU module) base, PRU0 control (first PRU in
the module) you have

0x4B28_0000 + 0x0002_2000 => 0x4B2A_2000


--
Dennis L Bieber

Reply all
Reply to author
Forward
0 new messages