- 1 Update to PyPRUSS
- 2 Status
- 3 Proposal
- 3.1 About me
- 3.2 About the project
- 3.2.1 Description
- 3.2.2 Implementation
- 3.2.3 Timeline
- 18.104.22.168 Week 1: May 14 - May 20
- 22.214.171.124 Week 2: May 21 - May 27
- 126.96.36.199 Weeks 3-4: May 28 - June 10, End of Phase I
- 188.8.131.52 Week 5: June 11 - June 17, Start of Phase II
- 184.108.40.206 Week 6: June 18 - June 24
- 220.127.116.11 Week 7: June 25 - July 1
- 18.104.22.168 Week 8: July 2 - July 8, End of Phase II
- 22.214.171.124 Week 9-10: July 9 - July 22, Start of Phase III
- 126.96.36.199 Week 11: July 22 - July 28
- 188.8.131.52 Week 12: July 29 - Aug 5
- 184.108.40.206 Final Week: Aug 6 - Aug 14
- 3.2.4 Experience and approach
- 3.2.5 Contingency
- 3.2.6 Benefit
- 3.2.7 Feedback
Update to PyPRUSS
PyPRUSS is a python binding/API for loading firmware and communicating with the PRUs easily. Currently, the project uses PASM which is no longer supported in latest versions and communicates over the older UIO interface.
School: Birla Institute of Technology and Science, Pilani
Primary language: English
Primary Email: firstname.lastname@example.org Typical work hours: 9:00 - 21:00 IST (GMT+5:30)
Previous GSoC participation: This is my first GSoC participation. I really like the open source ideology and have been using linux and open source hardware/software for some time. The power and impact of open source hardware/software became evident to me during the 'Arduino boom' and how it triggered the Maker Movement. I have always enjoyed doing DIY projects on community-supported platforms, so I feel that it's my turn now to contribute back to the community and GSoC is the ideal place to get started.
About the project
Project name: Update to PyPRUSS
The PyPRUSS is a python binding/API for controlling the PRUs. It abstracts the low level details and provides an easy to use python-based interface for loading firmware, controlling execution and interrupts/memory management for the PRUs, therefore shortening the learning curve for users new to PRU programming. Currently, the PyPRUSS uses PASM for its examples and communicates using the older Userspace IO (UIO) Driver. The goal of this project is to update the API to use the 'standard' remoteproc framework for communicating with the PRUs and port the existing examples to gnupru(since PASM is no longer supported by TI) to work on the latest images.
The project can be divided into the following stages
Update the pypruss source to use the remoteproc driver. This includes porting the API to use the remoteproc interface for basic PRU control, INTC (interrupt controller), and mmap() for some memory management functions.
Port the existing PASM examples to pru-as (the assembler in the gcc-pru toolchain. The gnupru is the unofficial gcc port for the PRUs. The community would like to eventually shift to gcc and this is a step in that direction. Though, I'm first planning to port the examples first to clpru as it is the official PRU Compiler supported by TI and has been tested extensively. pru-gcc is the unofficial PRU port and therefore i want to have some working remoteproc examples before starting to work on it. I'm planning to add a little more advanced C examples in addition to the assembly examples as well.
Test the examples with the API. Recieve mentor feedback, fix bugs.
Documentation & Cleanup
Documentation is a very crucial part of the project since it is intended for beginners. I would like to spend a significant amount of time for this. It'll include detailed explanation of the API functions, walkthrough of the examples, a quick start guide to programming the PRUs in assembly with gcc-pru (as it is not well documented as of now) as well as the setup/build instructions for the project.
Stretch Goal: RPMsg support
As a stretch goal, I would like to add a few message passing functions to the API using the RPMsg (virtio) protocol/framework.
Week 1: May 14 - May 20
- Go through the kernel documentation and the driver.
- Go through the PyPRUSS codebase thoroughly, github forks, look up existing bugs/issues.
Week 2: May 21 - May 27
- Implement basic PRU Control functions (power on/off, load firmware, reset, enable/disable).
Weeks 3-4: May 28 - June 10, End of Phase I
- Implement Data Memory Read/Write functions.
- Implement External Memory/DDR access functions.
- Implement the Interrupts/Event Control functions.
- Preliminary test the API with available examples.
By the Phase I evaluation, I would deliver a basic API tested with available remoteproc examples.
Week 5: June 11 - June 17, Start of Phase II
- Port the existing PASM examples to clpru (TI C Compiler).
- Test the examples on the API.
Week 6: June 18 - June 24
- Port the examples to pru-as (pru-gcc).
- Fix Bugs (Not exactly sure how complete pru-as is. I tried some working examples. Had a conversation with dinuxbg, according to him, pru-as and pru-ld are stable and also there is a major release coming up to align gnupru with the TI ABI). Nevertheless, I can use the buffer week to fix major bugs in pru-gcc (if any).
Week 7: June 25 - July 1
- Complete the work on pru-as examples.
- Work on a little more advanced additional (C) examples (demonstrating interrupt/events, shared memory).
Week 8: July 2 - July 8, End of Phase II
- Work on a script to generate resource table for basic examples (The basic examples have most of the part of the resource table similar. For interrupts/event control examples, the script will provide a beginner friendly way to generate the resource_table.h file taking in a few parameters required.)(Details will be included in the documentation).
By the Phase II evaluation, I would deliver a set of working assembly/C remoteproc examples to use with the API
Week 9-10: July 9 - July 22, Start of Phase III
Write Documentation, which will include
- Detailed explanation of the API functions
- Step-by-Step Walkthrough of the examples.
- Quick Start guide to start assembly programming with pru-as.
- Setup and build instructions for the project.
Week 11: July 22 - July 28
- Run Final Tests
- Receive Mentor Feedback, Final Bug Fixes.
- Cleaning/refactoring the code.
I would like to work on a stretch goal after the above has been done which is to add a few messages passing functions to the API using the RPMsg virtio framework.
Week 12: July 29 - Aug 5
Add a few message message passing functions to the API to send/receive messages from the PRUs using RPMsg virtio framework along with a demo example.
Final Week: Aug 6 - Aug 14
Experience and approach
I am a junior-year electronics engineering undergraduate and had a fair amount of coursework related to embedded development. I have experience with programming microcontrollers(AVRs, Arm Cortex M0/3) in C and I've also worked on BeagleBone Black . I have been using linux as my primary OS for some time now, so I can work my way around embedded linux quite easily. Most of my software related coursework has been done in C and python, & therefore I am fairly proficient in both these languages.
- Retro Snake Game using AVR Microcontroller : The classic snake game implemented using an Atmega, Dot Matrix Display & joystick and programmed in C. Project Page, github
- Python Based Information-Retrieval System with Sentiment Classification: In this project, a large corpus of tweets is indexed locally and the ranked retrieval of tweets is performed in response to a search query, with tweets classified according to their sentiment.
My summer break starts exactly from the GSoC start date and will go on until the first week of August, until when all the work will be essentially completed. I have no other engagements during the summer, so I can devote whole of my time to the project. I plan on dedicating 7-8 hrs per day for the project on weekdays and 4-5 hrs on weekend days which makes the time commitment around 45-50 hrs per week. Since I wont be starting from scratch, I think the timeline above is quite realistic and doable in the time available.
There is an abundance of quality documentation on PRUs and remoteproc/rpmsg like the PRU-ICSS guide, remoteproc/rpmsg kernel documentation, wiki, PRU Assembly Guide, etc. One can always resort to IRC/mailing list and also the community forums like TI E2E but the response time may be high. Though, sometimes a thoughtful google search may suffice.
PRUs are a tough nut to crack for beginners. The ARM to PRU communication is a somewhat complex process and users are expected to know about the low level details upto some level before starting to write any code. Also, using the remoteproc interface tends to be difficult and timetaking for beginners.This project attempts to shorten the learning curve for users new to programming with PRUs by providing an abstraction over the loading, control and communication process with the PRUs so that they can start focusing on the functionality/app instead and get started with minimum time and effort.
<-----Please provide your feedback here---->