Beagleboard gsoc 2019 bi-directional progress

Revision as of 03:22, 22 June 2019 by Pranav083 (talk | contribs) (Date : 20 June 2019)
Jump to: navigation, search

About Me

IRC: pranav_kumar
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

Important sites

Part A:

  • Command explanation for converting device tree in readable format:
  • A get start guide:
  • Outdated but fine source on pru:
  • A basic guide to pru programming:
  • A online to understand kernel structure of beaglebone on the device tree:

Part B:

  • For using the prussdrv technique in pru programming through asssembly language: through you have to make couple of changes to get it working.
  • basic PRU example :
  • pin P8 header:
  • pin P9 header :
  • for undersading gpio functionality :
  • pru pin modes register etc. :
  • Function use while compiling through prussdrv technique:
  • learning vim with ease :

Part C:
  • device tree generation :
  • Easy Go through example on device tree(usart pins):

Part D:

Sites with error

  • error404: 

reference from page

  • device tree generator

Common Commannd

  • To decompile the device tree blob(/boot/dtbs/4.11.xx):
sudo dtc -I dtb -O dts -o am335x-boneblack.dts am335x-boneblack.dtb
  • To recompile the device tree(/boot/dtbs/4.11.xx):
sudo dtc -I dts -O dtb -o file.dtb file.dts
  • To compile dtbo file(/lib/firmware/):
sudo dtc -O dtb -o file.dtbo -b 0 -@ file.dts
  • To complile a normal pasm code (assembly code) :
sudo pasm -b file.p 

It will generate a file.bin file in the same directory

  • To compile it using pruss technique :
 sudo arm-linux-gnueabihf-g++ pru.cpp prussdrv.c -o file_out

For the above given file go to the given repository
Note: Always remember to make changes in the device tree file located in /lib/firmware/ directory

  • Run the program by the following command
sudo ./file_out 

(reference from the above file output)

Daily progress :

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

  • 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 :
    • 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 :
    • Today is the meeting day and led a little discussion on which approach to use prussdrv or remoteproc.
  • 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

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

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

Date : 8 June 2019

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 (as i also dont know the commands)
  • Blocker
    • still not able to activate the gpio present in the p8 and p9 header through the assembly code
    • submitted my query to the mentors waiting for the reply

Date : 10 June 2019

  • Till Now
    • checking for the different techinique available for activating the gpio and as the resources available are a bit old so i have to find out resources from different place to make it work
    • digging deep into the datasheet in understanding the how the pins are getting activated through the pasm code
  • Blocker
    • same as above still no success on acquiring the pins

Date : 11 June 2019

  • Till Now
    • the mail received by the refernce to the derek molloy lecture in which he taught about the device tree understanding, compiling.
    • but it was for the kernel 3.8 and their is no folder named

in the recent kernel version

  • Blocker
    • able to change the file but the effect are visible on the board

Date : 12-13 June 2019

  • Till Now
    • some how able to change and understand how the device tree work and the procedure to activate according to the previous kernel
    • But to eliminate any error of possibility i shifted to beaglebone black Rev C .As many site give their preference to change the device tree located in the folder /file

and changing the file gives no effect on the board .so, to eliminate any error of possibility i shifted to the Black Rev C .As given in the guide

    • Repeat the example that studied earlier in hope that pru pins start working
    • not much work done in this day other than this.

Date : 14 June 2019

  • Till Now
    • while searching on the internet came acrooss a code which seems to be working. Through it doesnot have documentation but it is understandable excepts for few code
    • for the first time i was able to activate the gpio no p8_13 by under stand the code. And the few thing that i learnt that
   lbco r0, CPRUCFG, 4, 4   // read SYSCFG
   clr  r0.t4               // clear SYSCFG[STANDBY_INIT]
   sbco r0, CPRUCFG, 4, 4   // enable OCP master port;
  1. first enable ocp master port mode a
  2. then make changes to device tree in according to that
  3. make the output enable for the pin
  • Blocker
    • still not able to understand the following line on the above link (line 43,53)
SET r30, r30, 15
CLR r30, r30, 15 

- as r30 register means it is an output register in which their is no listing of p8_13 port if i take the reference from the page : - and if go through the command it means that it is manipulating P8_15 as given in the table. But the P8_13 pin is activated not that pin p8_15 which should be activated according the reference information

  • Blocker
    • To test these code started to make my own set of activated pins in the device tree in the folder

Date : 15 June 2019

  • Till Now
    • making the device tree for the program but the problem is that pin available from the pru is scatted as pins are their but some give functionality of both input and output is less.
    • here is the done work till now
    • Note: the above stated pins are now for demonstration reference purpose only. Just testing the derek molloy style of activating the ports of pru through the device tree.
    • But the problem that still remains that how the p8_15 will activated as previous day guide shows that p8_13 can be controlled with register r30 and bit no. 15.
    • made a little commit to my working directory on github.
  • Blocker
    • will raise the concern with my mentor about this and the project is going on slow speed i want to make the things a little bit fast.

Date : 16 June 2019

  • Till Now
    • My previous problem got solved regarding the p8_13 header pins. Its came out that the pin available is basically memory mapped and their is no need of line 43 and 53 as stated in the page link listed on 14 june 2019 on the.
    • Able to create devive tree file (*.dtbo) and also able to make changes in according that in the assembly code mainly working on the mode 7 of pin for now.hc
    • Now finally working on making assembly code for swift register 74hc595 now.

Date : 17-18 June 2019

Date : 19 June 2019

  • Till Now
    • As told by @ds2 made the table of pin that i had used in the during the working of shift register 74hc595. Through he did not recommend using mode 7 of the board as it is directly connected the ARM processor
    • Some suggestion is given by @abhishek_ on the pin mux and device tree overlay file
    • regarding wave(timing) of register diagram its is suggested by @hendersa to use
  • blocker
    • still not clear how to move further running the suggestion given by @abhishek still no success on accessing the pins using the pru
    • their is confussion regarding the device tree overlay to me i think.

Date : 20 June 2019

Date : 21 June 2019

  • Till Now