BeagleBoard/GSoC/2019Proposal/PRUUserSpaceAPI-PratimUgale

=Proposal for PRU User Space API project=

This project aims to provide an API for different programming languages to load/unload firmware and communicate with the PRUs from User Space.

Student: Pratim Ugale Possible Mentors: Kumar Abhishek, Zubeen Tolani Wiki: https://elinux.org/BeagleBoard/GSoC/Ideas#PRU_User_Space_API GSoC: GSoC entry

=Status= This project is currently just a proposal.

=Proposal= I have completed the requirements listed on the ideas page and have opened a pull request here.

About you
IRC: pratimugale Github: Pratim Ugale School: Veermata Jijabai Technological Institute (VJTI), Mumbai Country: India Primary language: English Typical work hours: 08:00 to 21:00 IST (GMT+ 05:30) Previous GSoC participation: I haven't participated in GSoC before. Having used open source technologies and programming forums before to solve my problems, I want to start contributing back to the community through GSoC and then continue on my own.

About your project
Project name: PRU User Space API

Description

 * Introduction
 * This project will enable the control of the Beaglbone's PRUs from the Linux User Space on the ARM. PRU is a dual core micro-controller system present on the AM335x SoC (TI's ARM A8 based chip) which powers the BeagleBone. It meant to be used for high speed jitter free IO control. Being independent from the linux scheduler and having direct access to the IO pins of the BeagleBone Black, PRU is ideal for offloading IO intensive tasks.
 * The communications between PRU and ARM is done via RPMsg which uses a virtual ring buffer (VRING) which allows you to post messages to this buffer and then using interrupts to notify the PRU/ARM that messages are in the buffer.


 * My Deliverables/Goals
 * The project will use the new remoteproc driver for the ARM<->PRU communication.


 * The main task of the project is that different programming languages should be able to boot up the PRU and load/unload the firmware on it, while simultaneously being able to communicate with it using RPMsg. Also it will reduce the number of commands that the user will have to type to get the PRU up and running.


 * Deliverables


 * The project will consist of the following components:


 * The user space libraries for the API in different programming languages. The API will use UNIX sockets to communicate with the Daemon server.
 * The Daemon: Written in python, the daemon will listen to the requests, and use language bindings to call the appropriate remoteproc and RPMsg functions, and pass the return value back to the userspace program.


 * The remoteproc and RPMsg device drivers
 * The PRU firmware


 * Documentation
 * The documentation regarding the PRU remoteproc and RPMsg drivers is very scattered and it is very time consuming to get started with the PRUs. Also, there is a steep learning curve to program the PRUs. I plan to provide a beginner-friendly Documentation


 * Future Work

Timeline
Provide a development timeline with a milestone each of the 11 weeks. (A realistic timeline is critical to our selection process.)


 * Before Community Bonding (Until 6th May):
 * Study the documentation of Remoteproc and RPMsg as much as I can.
 * Figure out how I'll be structuring the API, the Daemon etc
 * Community Bonding Period(6th May - 26th May):
 * Week 1 (27th May - 2nd June):
 * Milestone #1
 * Week 2 (3rd June - 9th June):
 * Milestone #2
 * Week 3 (10th June - 16th June):
 * Milestone #3
 * Week 4 (17th June - 23rd June):
 * Milestone #4
 * Week 5 (24th June - 30th June):
 * Milestone #5
 * Week 6 (1st July - 7th July):
 * Milestone #6
 * Week 7 (8th July - 14th July):
 * Milestone #7
 * Week 8 (15th July - 21st July):
 * Milestone #8
 * Week 9 (22nd July - 28th July):
 * Milestone #9
 * Week 10 (29th July - 4th August):
 * Milestone #10
 * Week 11 (5th August - 11th August):
 * Milestone #11
 * Week 12 (12th August - 18th August):
 * Milestone #12
 * Milestone #12

Experience and approach
I am in my sophomore year of engineering, doing Information Technology. I am currently enrolled in a "Computer Organisation and Architecture" course which motivated me to learn more about the PRUs. I have worked with C, Python, Java, Makefiles, Vimscript before. I have learnt Linux driver development over the Internet in the past few months (I have implemented basic programs that can be found on my github profile here). I have worked with the Arduino UNO and ATMega boards before (made a self balancing and line following bot using PID algorithm). I have always been using Linux(Ubuntu) as my primary OS, so getting along with Embedded Linux won't be a problem. Hence, I am confident that I'll be able to complete the given project in due time.

Contingency
What will you do if you get stuck on your project and your mentor isn’t around?


 * Work on the Documentation
 * Testing more firmware examples with the project and Debugging

Benefit
If successfully completed, what will its impact be on the BeagleBoard.org community?

This project will allow larger programs to be developed in the programming language of the user's choice. Right now, to execute some code on the PRUs, intermediate knowledge about the remoteproc and RPMsg drivers is required.

Suggestions
Is there anything else we should have asked you?