Week 7 :
(Got the week number wrong in the last post)
What has been achieved:
- Python API working
- Read up on testing transfer speeds
Issues:
- Fell ill.Was down for 4-5 days with mild conjunctivitis and fever.Am better now
- There is some issue with the multiple reads from a file in the c api that needs solving(rewind did not seem to solve it)
Weekly Goals(next week)
- Evaluating the speed of data transfer(pending from last week)
- Need to implement checks for data/input sanity
- Investigate possible applications of PRU-Bridge
Regards,
Apaar Gupta
Week 9 :
What has been achieved:
- Benchmarking mostly done
- Channel numbers increased and read in channels 9 and 10 flush the entire buffer in one go(theoretically to do away with the multiple syscalls for larger types thus reducing time taken per byte).
- Python API upgraded from single byte only to larger sizes
- Investigated/understood codebase for applications like porting PRU Speak
Benchmarking results :
Driver Side using the C Library : This is for writing and reading
- One byte at a time without printk logs in the driver : 12-15 μs per byte
- One byte at a time with printk in driver : ~20 - 25 μs per byte
- Four bytes(uint32_t) at a time without printk logs : 36-52 μs or 9-13 μs per byte
- 16 bytes(4 element integer array) at a time without printk logs : 97-114 μs or 6-7.2 μs per byte
- The channels 9/10 flush the entire buffer in one go(tested for 100,500 and 1000 bytes at a time) : ~5-7 μs per byte(only for reads and need more working on)
PRU-Bridge firmware library
- Four bytes per write : 352 clock cycles = 0.44 μs per byte but this is including cycles for calculating number of clock ticks between each write (code here)
- Did basic testing for jitter. Ran a code for the pru to continuously write and driver reading simultaneously for a while and there seems to be no jitter on pru side
Issues:
- Wrong base address resulted in a time lost and feeling extremely stupid once the issue was resolved(Issue found thanks to Abhishek
- Will be moving to hostel soon ,will be busy shifting for a bit and internet will be quite bad
Weekly Goals(next week)
- Porting PRU-Spreak and investigation further applications
- Code clean up currently there is limited documentation and licenses need to be added to the newer stuff
Regards,
Apaar Gupta
Final Report:
Aim : The aim of this project is to create a generic, multi channel bridge between userspace Linux and PRU, allowing developers to send and receive data seamlessly between ARM and PRU via creation of plugin driver.
What has been achieved in the GSoC Timeframe:
- PRU-Bridge driver coded and tested.It allows for passing of type agnostic data(data is passes byte by byte) via sysfs files to the PRU shared memory.
- The driver allows for creation up to 10 uni-directional channels of variable size(max size 11500 bytes)
- Userspace libraries in Python and C allow for extremely easy utilization of PRU-Bridge to pass data(Library details in readme)
- PRU side library allows for realtime data transfer at a performance of ~30 cycles a write(it gets better as the size of data being passed increases)
- Code is decently documented and the readme updated
- PRU-Speak ported testing shows that the port seems to break in some cases still working on that one
I have learned a lot while working on this project tried to accomplish as much as i could during the GSoC coding period.Some areas like creation of more example apps/programs and porting the new pruss framework will be worked on after GSoC as in the proposal. Code repository can be found here.
I would like to thank Alexanderhiam ,ds2, Karki,Abhishek and the rest of the community for helping me with the rather interesting albeit at times stupid errors and issues i faced
and for their support.This experience has been extremely insightful and enjoyable and i would love to continue enhancing/improving PRU-Bridge and contributing to the Beagleboard community 
Regards,
Apaar Gupta