Beagleboard gsoc 2019 bi-directional progress

About Me
IRC: pranav_kumar Github: https://github.com/pranav083 E-Linux Username: pranav083 School: UIET,Panjab University,Chandigarh Country: India Primary language: English,Hindi Typical work hours: 9:30 - 23:00 IST GMT/EST/PST to Adjusted Time Previous GSoC participation: This is my first time participation in gsoc .I got intrested for it by seeing the vast amount of development for open source hardware around the world .And i also want to become a part of it. Skills: C,Python,ROS,OpenCV,Embeddded C,Electronics Prototying,circuit designing

Tools(proficient): Git, Linux, C Experience: C, Python, OpenCV, Arduino

Hardware Skills: Raspberry Pi, ICs, Circuit Designing, Atmel chips, I2C, circuit designing, circuit debugging.

Reference Design For A GPIO-based Parallel Bi-Directional Bus
Project name: Reference Design For A GPIO-based Parallel Bi-Directional Bus

Student: Pranav Kumar Mentors: Andrew Henderson, Kumar Abhishek, Hunyue Yau Code: https://github.com/pranav083/pocket_beagle-work Wiki: https://elinux.org/index.php?title=/BeagleBoard/GSoC/GPIO-parallel-bi-dir-bus

Important sites
for undersading gpio functionality : https://credentiality2.blogspot.com/2015/09/beaglebone-pru-gpio-example.html
 * command explanation for converting device tree in readable format : https://stackoverflow.com/questions/36090929/modifying-the-device-tree-for-the-beaglebone-black
 * A get start guide : https://zeekhuge.me/post/a_handfull_of_commands_and_scripts_to_get_started_with_beagleboneblack/
 * Outdated but fine source on pru : https://www.element14.com/community/community/designcenter/single-board-computers/next-gen_beaglebone//blog/2013/05/22/bbb--working-with-the-pru-icssprussv2
 * A basic guide to pru programming : https://markayoder.github.io/PRUCookbook/
 * A online to understand kernel structure of beaglebone on the device tree : http://git.ti.com/ti-linux-kernel/ti-linux-3-8-y-kernel/trees/master/arch/arm/boot/dts
 * For using the prussdrv technique in pru programming through asssembly language : https://github.com/hendersa/bes through you have to make couple of changes to get it working.
 * basic PRU example : https://www.ofitselfso.com/BBBCSIO/Help/BBBCSIOHelp_PRUBlinkUSR3LEDExamplePASMCode.html
 * pin P8 header: http://exploringbeaglebone.com/wp-content/uploads/resources/BBBP8Header.png
 * pin P9 header : http://exploringbeaglebone.com/wp-content/uploads/resources/BBBP9Header.png
 * pru pin modes register etc. : https://elinux.org/Ti_AM33XX_PRUSSv2#Beaglebone_PRU_connections_and_modes
 * Function use while compiling through prussdrv technique: http://processors.wiki.ti.com/index.php/PRU_Linux_Application_Loader_API_Guide#prussdrv_exec_program
 * learning vim with ease : https://www.openvim.com/

Date : 31 May 2019

 * First I made an introductory youtube video of my project
 * Purchased hardware related to this project like 8-bit logic analyzer ,logic level converter
 * Understand about the code structure on making kernel module Beagleboard and understanding the beaglelogic code docs
 * Read a little bit about kernel module development from this page.

Date : 1 June 2019

 * Till now made the circuit based on the GitHub link withh shift register circuit diagram.
 * Made the circuit for testing the board see the circuit drive link
 * Further work is to implement first user space program then PRU assembly code program.
 * completed studing kernel module developnment from site as suggested by my mentor and further looking into makefile

Date : 2 June 2019
I think i should also include blocker and goals in my further work


 * Till Now
 * Today I studied more about kernel module development and try to understand the code base starting from docs, then kernel folder and firmware folder
 * Try to complete the first week commitment of making the video for the different interfacing circuit but faces some problem due to less understanding assembly code in PRU
 * As i was working earlier in the User space so i was comfortable to make the program their but i want to submit the video and code with the assembly code
 * Blockers:
 * During navigating through the code of beaglelogic .asm file are less understandable for me.
 * Less understaning of the PRU assembly code to tackle that i watched again pru video from beagle bone site.
 * came across a github page during my search for barebone pru programming on pocket_beagle_samples
 * And downloaded the Sitara PRU but it was too big to be understable to me.

Date : 3 June 2019

 * Till Now
 * Got guidance from @Jkrinder and @Hendersa through the IRC channel on the documentation regarding the PRU that are from the TI
 * As PRU have very little assembly code instruction set (There is around 40+ instruction set ) for the pru on this guide page : https://www.ti.com/lit/ug/spruij2/spruij2.pdf
 * And the guide for c/c++ complier for t=your assembly code : https://www.ti.com/lit/ug/spruhv6c/spruhv6c.pdf
 * Clone and Made the changes in the file as suggested for the file : https://github.com/hendersa/bes/blob/v0.1/src/pru.cpp by deleting line 57 and line 58 and adding " || 1 " on the line 60
 * Ran the program but got error as the main function was not there


 * Blocker
 * Building the program was not successful send my issue to my mentor
 * reading the datasheet stated above but very less success with it

Date : 4 June 2019

 * Till Now
 * while waiting for the response from the mentors started to study the assembly guide as found from different websites
 * completed the video training course on the pru programming and its different aspects through : https://training.ti.com/PRU-training-series
 * Setup ccs studio in a hope for running the pru through assembly codes


 * Blocker :
 * Still exploring the right way to program the pru in the beagle bone
 * Compile the code with out the main function and got bus error
 * Though found a way program as stated on most of the sites through the ti ccs studio but it is not the right way to continue

Date : 5 June 2019

 * Till Now
 * Got reply from the mentor and it worked after including main function and by compiling
 * starting every thing from new by re flashing the os image on the beaglebone black wireless
 * unable to install the library from the site : https://github.com/beagleboard/am335x_pru_package
 * Today is the meeting day and led a little discussion on which approach to use prussdrv or remoteproc.

 As the project progress a little bit i thing of writing a blog on enabling pru in beagle board as the most of the sources are outdated 
 * Blocker
 * Still dont know how to get the system working through the assembly code and then come through the setup guide of complier form
 * Tried the method again of enabling pru from element14 site

Date : 6 June 2019

 * Till Now
 * Changed the uEnv.txt for enabling remotproc pru system in beaglebone
 * Today finally get the pru assembly code working most of thanks to @hendersa guidance
 * Because till now from my side i had searched most of the resources that i can avail from web, beaglebone google group,etc.
 * But learn many things about its working and structure in the mean time.


 * Blocker
 * Most of the earlier problrm that i was facing is over for now now testing to run assembly code.

Date : 7 June 2019

 * Till Now
 * while working on the example from this site :https://credentiality2.blogspot.com/2015/09/beaglebone-pru-gpio-example.html and folowing the example given my beaglebone some how refuse to connect through the cable
 * after reflashing the image and installing and making the desired changes it get up and running
 * Blocker
 * most of the days ran out in debugging the beaglebone

Date : 8 June 2019

 * Till Now
 * after testing some other sites.I go through the https://www.ofitselfso.com/BBBCSIO/Help/BBBCSIOHelp_PRUInterruptHostExamplePASMCode.html
 * It started to work working by following the stated steps
 * Made changes in the bes file provided by https://github.com/hendersa/bes/ and compile that in one folder to make it easy to use in the future aseembly code compiling
 * Blocker
 * not able to under how the address is getting mapped for different register values and how the banks are used in the working solutions
 * Through the solution provided by https://credentiality2.blogspot.com/2015/09/beaglebone-pru-gpio-example.html is get understood by me but it was not a working solution.
 * As i am still not able to make chnages in the device tree and the change

Date : 9 June 2019

 * Till Now
 * reading out the device tree and resource table generation
 * updated the done work on my github (through for this time it is very less :( .)
 * I was getting problem in navigating through vim .so,i Practice it from https://www.openvim.com (as i also dont know the commands)