Update 2, Week 1 [21st May - 28th May]
What has been achieved:
-
First version of the PRU firmware for both the PRUs: PRU0 PRU1
-
Proof-of-concept 100 MHz sampling of 16 channels one-shot [8 MB, 4Msamples, 40ms]*
-
*Actual sample rate is now limited by the memory bandwidth and signal integrity at the PRU Inputs shared with the HDMI framer.- First cut for a continuous sampling firmware, using two 4 MB buffers alternately in the PRU shared RAM
-
Firmware also tested for 25MHz, 50 MHz and 20 MHz frequencies [inserting NOPs appropriately]
Issues:
-
UIO kernel driver cannot allocate more than 8 MB shared memory for the PRU
-
Workaround suggested by Charles Steinkuehler: Boot linux with memmap= option to reduce available physical memory for the kernel- Tradeoff between buffer size and interrupts in userspace while attempting memcpy from the shared area to user area [continuous sampling]:
-
Small ring buffer size, faster memcpy but interrupts come in faster than they can be handled in userspace
-
Large ring buffer size [4 MB], interrupts are OK but memcpy is slower, also part in due to bus traffic on L3 [PRU → DDR writes].
-
Issues with ARM NEON memcpy implementation, stack corruption
Plans for the week ahead: -
Explore kernel space implementation of the LA core to address interrupt latency and memory issues. Userspace seems to inappropriate for anything but one-shot sampling.
-
Prepare the libsigrok bindings with everything but data transfer functions.
-
RLE implementation in PRU firmware to increase data storage in the same bandwidth [4-count or 16-count RLE depending on the number of bits used].
The update is also posted to my blog: http://www.theembeddedkitchen.net/gsoc2014/beaglelogic-week-1-building-the-pru-firmware/
Kumar Abhishek