I am using a BeagleBone Black Wireless system to do some A/D work. The output of version.sh is at the end of this message.
This question may be out of scope for the TI forum but I wanted to give it a try. Thanks in advance for any help.
I have four 1-D arrays declared in the PRU's shared memory space and they work fine. However, my code would be better if I used 2-D arrays instead.
However I am struggling to declare these in the shared memory space using C.
Here is how they are declared as 1D arrays.
#define E_RING_BUFFER_SIZE 200
#define E_YES 1
#define E_NO 0
volatile unsigned int *DetBSampleSet = (unsigned int *) SHARE_MEM;
volatile unsigned int *DetTSampleSet = (unsigned int *) (SHARE_MEM + (E_RING_BUFFER_SIZE * sizeof(unsigned int)));
volatile unsigned int *TimeSampleSet = (unsigned int *) (SHARE_MEM + (E_RING_BUFFER_SIZE * sizeof(unsigned int))*2);
volatile unsigned int *PressureSampleSet = (unsigned int *) (SHARE_MEM + (E_RING_BUFFER_SIZE * sizeof(unsigned int))*3);
It has been suggested that I define the memory in the linker command file but don't know how to do that so if there's a resource you can point me to I will give that a try. I have the TI PRU Optimizing Compiler manual so maybe I just haven't found this in there. I really need a tutorial on it to learn it.
debian@beaglebone:/var/lib/cloud9$ sudo /opt/scripts/tools/version.sh
[sudo] password for debian:
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLTBWA52027BBWG0227]
model:[TI_AM335x_BeagleBone_Black_Wireless]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BBBW-WL1835-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
UBOOT: Loaded Overlay:[BB-I2C2-RTC-DS3231]
UBOOT: Loaded Overlay:[BB-W1-P9.12-00A2]
kernel:[4.19.94-ti-r61]
nodejs:[v10.15.2]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr4=/lib/firmware/BB-W1-P9.12-00A0.dtbo]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
uboot_overlay_options:[dtb_overlay=/lib/firmware/BB-I2C2-RTC-DS3231.dtbo]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210401.0-0~buster+20210401]
pkg:[bb-wl18xx-firmware]:[1.20200322.0-0rcnee0~buster+20200322]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.4-git20190227.1-0rcnee0~buster+20190327]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[ 69.444537] remoteproc remoteproc0: wkup_m3 is available
[ 69.731914] remoteproc remoteproc0: powering up wkup_m3
[ 69.731947] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[ 69.732222] remoteproc remoteproc0: remote processor wkup_m3 is now up
[ 71.971917] remoteproc remoteproc1: 4a334000.pru is available
[ 71.982645] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[ 71.971917] remoteproc remoteproc1: 4a334000.pru is available
[ 71.972101] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[ 71.982645] remoteproc remoteproc2: 4a338000.pru is available
[ 71.982788] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[ 0.951277] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 0.964973] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END