Difference between revisions of "BeagleBoard/GSoC/node-beaglebone-boot"

From eLinux.org
Jump to: navigation, search
m
m
 
(36 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Category: BeagleBoard]]
 +
[[Category: GSoC]]
 +
[[Category: GSoCProposal]]
 +
 +
 
=[[BeagleBoard/GSoC/node-beaglebone-boot|node-beaglebone-boot]] =
 
=[[BeagleBoard/GSoC/node-beaglebone-boot|node-beaglebone-boot]] =
{{#ev:<!--youtube|Jl3sUq2WwcY||right|BeagleLogic-->}} <!-- latest video will go here -->
+
<!--{{#ev:youtube|Jl3sUq2WwcY||right|BeagleLogic}}--> <!-- latest video will go here -->
 
+
Porting BeagleBone USB based bootloader server, BBBlfs(written in c) to JavaScript(node.js) and make a GUI interface.
A short summary of the idea will go here.
 
  
 
''Student'': [http://elinux.org/User:ravikp7 Ravi Kumar Prasad]<br>
 
''Student'': [http://elinux.org/User:ravikp7 Ravi Kumar Prasad]<br>
Line 15: Line 19:
  
 
=Proposal=
 
=Proposal=
 
+
Cross-compile and utilize version control software by creating a "Hello World" application and generating a pull request https://github.com/jadonk/gsoc-application/pull/60 <br>
 
==About you==
 
==About you==
 
''IRC'': ravikp7<br>
 
''IRC'': ravikp7<br>
''Github'': https://github.com/ravikp7<br>
+
''Github'': [https://github.com/ravikp7 ravikp7]<br>
''School'': Maharaja Agrasen Institute of Technology<br>
+
''School'': [https://www.mait.ac.in/ Maharaja Agrasen Institute of Technology]<br>
 
''Country'': India<br>
 
''Country'': India<br>
 
''Primary language'': English, Hindi<br>
 
''Primary language'': English, Hindi<br>
Line 25: Line 29:
  
 
==About your project==
 
==About your project==
''Project name'': BeagleBoot- BeagleBone USB based bootloader server in JavaScript (node.js)<br>
+
'''Project name: BeagleBoneBoot- BeagleBone USB based bootloader server in JavaScript (node.js)''' <br>
  
 
===Description===
 
===Description===
 +
Currently, the ways to flash images in BeagleBone hardware are not easy especially for beginners, SD card method takes up much time and manual configuration, BBBlfs flashing tool works but is CLI based, not much reliable and works on limited platforms, TI's Uniflash tool is also old and works only under older versions of Windows and Linux with a lot of manual configuration. <br>
 +
 
The project is to port the BeagleBone bootloader server BBBlfs(currently written in c) to JavaScript(node.js) and make a cross platform GUI flashing tool utilising the etcher.io project code. This will allow us to have single code base for a cross platform tool.<br>
 
The project is to port the BeagleBone bootloader server BBBlfs(currently written in c) to JavaScript(node.js) and make a cross platform GUI flashing tool utilising the etcher.io project code. This will allow us to have single code base for a cross platform tool.<br>
''Some changes are to be made in the port regarding the method of exposing the storage of block device over USB''<br>  
+
 
 +
'''Some changes are to be made in the port regarding the method of exposing the storage of block device over USB'''<br>  
 
The c server (BBBlfs) after transferring u-boot through tftp, currently utilizes the Kernel/RAMDISK approach to boot the beaglebone in USB mass storage class mode.<br>
 
The c server (BBBlfs) after transferring u-boot through tftp, currently utilizes the Kernel/RAMDISK approach to boot the beaglebone in USB mass storage class mode.<br>
 
Since u-boot has now the ums(USB Mass Storage) feature, it'll be utilized instead of Kernel/RAMDISK approach to boot it into USB mass storage class. To do this a PATCH for uboot is to be made which will run the ums command after loading u-boot.<p>
 
Since u-boot has now the ums(USB Mass Storage) feature, it'll be utilized instead of Kernel/RAMDISK approach to boot it into USB mass storage class. To do this a PATCH for uboot is to be made which will run the ums command after loading u-boot.<p>
  
Working of the new node.js server:<br>
+
===Working of the new node.js server===
 
1. The AM335x ROM in usb boot mode exposes RNDIS interface which can be a virtual ethernet link over USB.<br>
 
1. The AM335x ROM in usb boot mode exposes RNDIS interface which can be a virtual ethernet link over USB.<br>
 
2. The client(BB) broadcasts BOOTP request message containing its hardware address.<br>
 
2. The client(BB) broadcasts BOOTP request message containing its hardware address.<br>
Line 40: Line 47:
 
5. The server then receives an ARP request through an inendpoint bulk transfer over USB.<br>
 
5. The server then receives an ARP request through an inendpoint bulk transfer over USB.<br>
 
6. The server makes an ARP response by acknowledging the IP and hardware addresses of client and server.<br>
 
6. The server makes an ARP response by acknowledging the IP and hardware addresses of client and server.<br>
7. The server receives a TFTP request for the spl binary.<br>
+
7. The server receives a TFTP request for the SPL binary. SPL is a small binary config, generated from U boot source. SPL is used as due to its small size it fits in SRAM. As system RAM can’t be accessed yet.<br>
 
8. The SPL binary is transferred through tftp in blocks.<br>
 
8. The SPL binary is transferred through tftp in blocks.<br>
9. SPL runs on the ROM and now the rndis vip and pid changes to new spl ids as per PATCH in the uboot.<br>
+
9. SPL runs on the ROM and now the rndis vip and pid changes to new spl ids.<br>
 
10. The server now finds device as per new ids and applies same procedure to transfer the u-boot binary.<br>
 
10. The server now finds device as per new ids and applies same procedure to transfer the u-boot binary.<br>
 
11. U-boot runs on the client and ums command is run to get it into usb mass storage class mode.</p>
 
11. U-boot runs on the client and ums command is run to get it into usb mass storage class mode.</p>
 
<p>
 
<p>
''Plans for integration into etcher.io variant'' <br>
+
===Plans for integration into etcher.io variant===
 
The UI of etcher.io will be modified to make it a BeagleBone Flasher.<br>
 
The UI of etcher.io will be modified to make it a BeagleBone Flasher.<br>
 
A button will be added, whose click action would be to put BB into USB mass storage mode by running the above server.<br>
 
A button will be added, whose click action would be to put BB into USB mass storage mode by running the above server.<br>
Line 52: Line 59:
 
</p>
 
</p>
 
<p>
 
<p>
Changes required in u-boot PATCH used in BBBlfs:<br>
+
===Configuring u-boot for default ums mode===
1. Changes in /drivers/usb/gadget/ether.c PATCH to specify just SPL vid & pid as U-boot ids won't be required as kernel/Ramdisk is not used.<bR>
+
1. Firstly, u-boot needs to be configured through am335x_evm_usbspl_defconfig as this config supports SPL networking and dfu for NAND.<bR>
2. Changes in /include/configs/am335x_evm.h PATCH , now no need of specifying serverip, ipaddr, tftp commands. Only ums command will be used to boot the bb into usb mass storage class mode.<br>
+
2. Next, the .config needs to be modified through make menuconfig to run the ums command. In menuconfig-> CLI -> Device Access Commands-> UMS , this needs to be included. <br>
3. No changes in /include/configs/ti_armv7_common.h<br></p>
+
3. USB ids are added in /include/configs/am335x_evm.h . U-boot and SPL binaries can be build now with default ums mode.
  
 
===Timeline===
 
===Timeline===
Provide a development timeline with a milestone each of the 11 weeks. (A realistic timeline is critical to our selection process.)
 
  
2017-06-06: Milestone #1 Testing binary parser modules for JavaScript, making strategy to use node modules or do the parsing manually. Write code for RNDIS header and verify hardware address of BB from BOOTP request data packet received by server.<br>
+
'''Before Official coding time: ''' Analysing etcher.io code base including testing npm packages used in it and understanding its UI (AngularJS) and workflow.<br>
2017-06-13: Milestone #2 Writing code for packet headers to implement all network protocols used BOOTP, UDP, TFTP, IP, ARP, ETHER and do their basic testing.<br>
+
'''2017-06-06: Milestone #1'''
2017-06-20: Milestone #3 Writing code for BOOTP reply from server. Receive ARP request from client(BB) and ARP response from server.<br>
+
* Testing binary parser modules for JavaScript, making strategy to use node modules or do the parsing manually.
2017-06-27: Milestone #4 Writing PATCH for u-boot for configuration. Transferring SPL binary to BB.<br>
+
* Write code for RNDIS header and verify hardware address of BB from BOOTP request data packet received by server.<br>
2017-07-04: Milestone #5 Transferring u-boot binary and booting BB hardware into mass storage class mode. Testing the server for different BB hardwares Black, Blue etc. Testing flashing different images on different platforms through etcher.io tool.<br>
+
'''2017-06-13: Milestone #2'''
2017-07-11: Milestone #6 Creating UI for the all in one BeagleBone flasher.<br>
+
* Writing code for packet headers to implement all network protocols used BOOTP, UDP, TFTP, IP, ARP, ETHER and do their basic testing.<br>
2017-07-18: Milestone #7 Integrating the UI with etcher.io flasher backend and the node-beaglebone-boot server including an option to download images directly from tool.<br>
+
'''2017-06-20: Milestone #3'''
2017-07-25: Milestone #8 Testing the integrated tool on all target platforms. Building native electron based packages for all the target platforms and testing the native packages on all the platforms.<br>
+
* Writing code for BOOTP reply from server.
2017-08-01: Milestone #9 Asking people from community to test the tool and provide feedback. Fixing bugs.<br>
+
* Receive ARP request from client(BB) and ARP response from server.<br>
2017-08-08: Milestone #10 Documentation<br>
+
'''2017-06-27: Milestone #4'''
A buffer of one week has been kept for any unpredictable delays.<br>
+
* Modifying u-boot configuration for default ums mode and testing it.
 +
* Transferring SPL binary to BB.<br>
 +
'''2017-07-04: Milestone #5'''
 +
* Transferring u-boot binary and booting BB hardware into mass storage class mode.  
 +
* Testing the server for different BB hardwares Black, Blue etc.  
 +
* Testing flashing different images on different platforms through etcher.io tool.<br>
 +
'''2017-07-11: Milestone #6'''
 +
* Creating UI for the all in one BeagleBone flasher.
 +
* Testing npm packages used in etcher.io<br>
 +
'''2017-07-18: Milestone #7'''
 +
* Integrating the UI with etcher.io flasher backend and the node-beaglebone-boot server.
 +
* Include an option to download images directly from tool.<br>
 +
'''2017-07-25: Milestone #8'''
 +
* Testing the integrated tool on all target platforms.
 +
* Building native electron based packages for all the target platforms and testing the native packages on all the platforms.<br>
 +
'''2017-08-01: Milestone #9'''
 +
* Asking people from community to test the tool and provide feedback.
 +
* Fixing bugs.
 +
* Handling somewhat expected errors such as interface claim issue in OSX (due to HoRNDIS) etc. by providing guides for uninstallation and other improvements.<br>
 +
'''2017-08-08: Milestone #10'''
 +
* Documentation<br>
 +
'''A buffer of one week has been kept for any unpredictable delays.''' <br>
 
2017-08-15: Milestone #11<br>
 
2017-08-15: Milestone #11<br>
  
 
===Experience and approach===
 
===Experience and approach===
I want to do this project out of my passion. I was always intrigued by linux, bootloader, kernel since I used my Nokia N900(pocket linux PC). I'm a good learner and self motivated. I've experience of doing projects with Arduino, Raspberry Pi2 and IC programming. I've made a chrome extension to solve one of my problems:<br>
+
I want to do this project out of my passion. I was always intrigued by linux, bootloader, kernel since I used my Nokia N900(pocket linux PC). I'm a good learner and self motivated. I've experience of doing projects with Arduino, Raspberry Pi2 and IC programming. <br>
Chrome Web Store: https://goo.gl/YiWIH4 <br>
+
1. I cross-compiled u-boot for default ums mode, binaries here https://goo.gl/1oissp . <br>
 +
2. A pull request in BBBlfs project https://github.com/ungureanuvladvictor/BBBlfs/pull/31 which shows that I've become familiar with BBBlfs working and its code.<br>
 +
3. Cross-compile u-boot logs https://gist.github.com/ravikp7/770ff7df85f0e0588d3b112b32403697 <br>
 +
4. I did some basic testing of electron framework with node-usb and made a demo app https://goo.gl/554gt2<br>
 +
5. I've made a chrome extension to solve one of my problems:  
 +
Chrome Web Store: https://goo.gl/YiWIH4  
 
Source: https://github.com/ravikp7/Snap-Tabs <br>
 
Source: https://github.com/ravikp7/Snap-Tabs <br>
I did some basic testing of electron framework with node-usb and made a demo app https://goo.gl/554gt2<br>
 
 
More about me and my electronics projects at https://ravikp7.github.io , I've designed my website, so I can design the gui of flash tool.<br>
 
More about me and my electronics projects at https://ravikp7.github.io , I've designed my website, so I can design the gui of flash tool.<br>
 
I don't give up easily and make sure the problem gets solved.
 
I don't give up easily and make sure the problem gets solved.
  
===Tasks===
 
1. Cross-compile and utilize version control software by creating a "Hello World" application and generating a pull request https://github.com/jadonk/gsoc-application/pull/60 <br>
 
2. Cross-compile u-boot https://gist.github.com/ravikp7/770ff7df85f0e0588d3b112b32403697 <br>
 
3. A pull request in BBBlfs project https://github.com/ungureanuvladvictor/BBBlfs/pull/31 <br>
 
 
===Contingency===
 
===Contingency===
What will you do if you get stuck on your project and your mentor isn’t around?<br>
+
'''What will you do if you get stuck on your project and your mentor isn’t around?''' <br>
 
If I get stuck and mentor isn't around: <br>
 
If I get stuck and mentor isn't around: <br>
 
1. I'll seek help from BeagleBone community on IRC and mailing list.<br>
 
1. I'll seek help from BeagleBone community on IRC and mailing list.<br>
Line 93: Line 120:
  
 
===Benefit===
 
===Benefit===
If successfully completed, what will its impact be on the BeagleBoard.org community?<br>
+
'''If successfully completed, what will its impact be on the BeagleBoard.org community?''' <br>
 
This project project will be really helpful for everybody especially newbies, who would have a nice experience with flashing images easily and faster, so that they can focus on the more important stuff be it their robotics project, kernel development or some new PRU hack.<br>   
 
This project project will be really helpful for everybody especially newbies, who would have a nice experience with flashing images easily and faster, so that they can focus on the more important stuff be it their robotics project, kernel development or some new PRU hack.<br>   
Include quotes from BeagleBoard.org community members who can be found on http://beagleboard.org/discuss and http://bbb.io/gsocchat.<br>
+
'''Quotes from BeagleBoard.org community members''' <br>
Steve Arnold (nerdboy) : It would be easier for newcomers and other community people. Smooth deployment is always good. If you can get it working smoothly/equivalently across 3 (desktop) platforms it would be even better than fsl mfgtool.
+
'''Steve Arnold (nerdboy): '''  It would be easier for newcomers and other community people. Smooth deployment is always good. If you can get it working smoothly/equivalently across 3 (desktop) platforms it would be even better than fsl mfgtool.<br>
 +
'''Michael Welling (m_w): '''  It is certainly better than the TI programming tools (Uniflash v3.4.1 for AM335x) and also it worked only on older versions of Windows and linux only.
  
 
===Suggestions===
 
===Suggestions===
Is there anything else we should have asked you?<br>
+
'''Is there anything else we should have asked you?''' <br>
 
Yes, what help do I expect from mentor? I just want my mentor to answer my queries at mentor decided time. All the coding is my job :)<br>
 
Yes, what help do I expect from mentor? I just want my mentor to answer my queries at mentor decided time. All the coding is my job :)<br>
 
One more help, please send the hardware as soon as you decide to select my proposal. And even if this project is not taken by organisation in gsoc, please send me the hardware, I really want to do this project.
 
One more help, please send the hardware as soon as you decide to select my proposal. And even if this project is not taken by organisation in gsoc, please send me the hardware, I really want to do this project.

Latest revision as of 22:15, 1 April 2017


node-beaglebone-boot

Porting BeagleBone USB based bootloader server, BBBlfs(written in c) to JavaScript(node.js) and make a GUI interface.

Student: Ravi Kumar Prasad
Mentors: Jason Kridner
Code: https://github.com/beagleboard/node-beaglebone-boot
Wiki: http://elinux.org/BeagleBoard/GSoC/node-beaglebone-boot
GSoC: [NA GSoC entry]

Status

This project is currently just a proposal.

Proposal

Cross-compile and utilize version control software by creating a "Hello World" application and generating a pull request https://github.com/jadonk/gsoc-application/pull/60

About you

IRC: ravikp7
Github: ravikp7
School: Maharaja Agrasen Institute of Technology
Country: India
Primary language: English, Hindi
Typical work hours: (9AM-3PM and 7PM-12AM) IST or (11:30PM-5:30AM and 9:30AM-2:30PM) EST

About your project

Project name: BeagleBoneBoot- BeagleBone USB based bootloader server in JavaScript (node.js)

Description

Currently, the ways to flash images in BeagleBone hardware are not easy especially for beginners, SD card method takes up much time and manual configuration, BBBlfs flashing tool works but is CLI based, not much reliable and works on limited platforms, TI's Uniflash tool is also old and works only under older versions of Windows and Linux with a lot of manual configuration.

The project is to port the BeagleBone bootloader server BBBlfs(currently written in c) to JavaScript(node.js) and make a cross platform GUI flashing tool utilising the etcher.io project code. This will allow us to have single code base for a cross platform tool.

Some changes are to be made in the port regarding the method of exposing the storage of block device over USB
The c server (BBBlfs) after transferring u-boot through tftp, currently utilizes the Kernel/RAMDISK approach to boot the beaglebone in USB mass storage class mode.

Since u-boot has now the ums(USB Mass Storage) feature, it'll be utilized instead of Kernel/RAMDISK approach to boot it into USB mass storage class. To do this a PATCH for uboot is to be made which will run the ums command after loading u-boot.

Working of the new node.js server

1. The AM335x ROM in usb boot mode exposes RNDIS interface which can be a virtual ethernet link over USB.
2. The client(BB) broadcasts BOOTP request message containing its hardware address.
3. The server receives the BOOTP request through an inendpoint bulk transfer over USB.
4. The server then sends BOOTP packet with IP addresses of client, server, UDP port numbers, SPL filename and hardware address of server through an outendpoint bulk transfer over USB.
5. The server then receives an ARP request through an inendpoint bulk transfer over USB.
6. The server makes an ARP response by acknowledging the IP and hardware addresses of client and server.
7. The server receives a TFTP request for the SPL binary. SPL is a small binary config, generated from U boot source. SPL is used as due to its small size it fits in SRAM. As system RAM can’t be accessed yet.
8. The SPL binary is transferred through tftp in blocks.
9. SPL runs on the ROM and now the rndis vip and pid changes to new spl ids.
10. The server now finds device as per new ids and applies same procedure to transfer the u-boot binary.

11. U-boot runs on the client and ums command is run to get it into usb mass storage class mode.

Plans for integration into etcher.io variant

The UI of etcher.io will be modified to make it a BeagleBone Flasher.
A button will be added, whose click action would be to put BB into USB mass storage mode by running the above server.
Next flashing image selection option will only be enabled only after putting BB into USB mass storage mode.

Configuring u-boot for default ums mode

1. Firstly, u-boot needs to be configured through am335x_evm_usbspl_defconfig as this config supports SPL networking and dfu for NAND.
2. Next, the .config needs to be modified through make menuconfig to run the ums command. In menuconfig-> CLI -> Device Access Commands-> UMS , this needs to be included.
3. USB ids are added in /include/configs/am335x_evm.h . U-boot and SPL binaries can be build now with default ums mode.

Timeline

Before Official coding time: Analysing etcher.io code base including testing npm packages used in it and understanding its UI (AngularJS) and workflow.
2017-06-06: Milestone #1

  • Testing binary parser modules for JavaScript, making strategy to use node modules or do the parsing manually.
  • Write code for RNDIS header and verify hardware address of BB from BOOTP request data packet received by server.

2017-06-13: Milestone #2

  • Writing code for packet headers to implement all network protocols used BOOTP, UDP, TFTP, IP, ARP, ETHER and do their basic testing.

2017-06-20: Milestone #3

  • Writing code for BOOTP reply from server.
  • Receive ARP request from client(BB) and ARP response from server.

2017-06-27: Milestone #4

  • Modifying u-boot configuration for default ums mode and testing it.
  • Transferring SPL binary to BB.

2017-07-04: Milestone #5

  • Transferring u-boot binary and booting BB hardware into mass storage class mode.
  • Testing the server for different BB hardwares Black, Blue etc.
  • Testing flashing different images on different platforms through etcher.io tool.

2017-07-11: Milestone #6

  • Creating UI for the all in one BeagleBone flasher.
  • Testing npm packages used in etcher.io

2017-07-18: Milestone #7

  • Integrating the UI with etcher.io flasher backend and the node-beaglebone-boot server.
  • Include an option to download images directly from tool.

2017-07-25: Milestone #8

  • Testing the integrated tool on all target platforms.
  • Building native electron based packages for all the target platforms and testing the native packages on all the platforms.

2017-08-01: Milestone #9

  • Asking people from community to test the tool and provide feedback.
  • Fixing bugs.
  • Handling somewhat expected errors such as interface claim issue in OSX (due to HoRNDIS) etc. by providing guides for uninstallation and other improvements.

2017-08-08: Milestone #10

  • Documentation

A buffer of one week has been kept for any unpredictable delays.
2017-08-15: Milestone #11

Experience and approach

I want to do this project out of my passion. I was always intrigued by linux, bootloader, kernel since I used my Nokia N900(pocket linux PC). I'm a good learner and self motivated. I've experience of doing projects with Arduino, Raspberry Pi2 and IC programming.
1. I cross-compiled u-boot for default ums mode, binaries here https://goo.gl/1oissp .
2. A pull request in BBBlfs project https://github.com/ungureanuvladvictor/BBBlfs/pull/31 which shows that I've become familiar with BBBlfs working and its code.
3. Cross-compile u-boot logs https://gist.github.com/ravikp7/770ff7df85f0e0588d3b112b32403697
4. I did some basic testing of electron framework with node-usb and made a demo app https://goo.gl/554gt2
5. I've made a chrome extension to solve one of my problems: Chrome Web Store: https://goo.gl/YiWIH4 Source: https://github.com/ravikp7/Snap-Tabs
More about me and my electronics projects at https://ravikp7.github.io , I've designed my website, so I can design the gui of flash tool.
I don't give up easily and make sure the problem gets solved.

Contingency

What will you do if you get stuck on your project and your mentor isn’t around?
If I get stuck and mentor isn't around:
1. I'll seek help from BeagleBone community on IRC and mailing list.
2. I'll crawl the internet with google :) and stackoverflow community is always there to help.
3. I believe that since all the code and machines ever are made by humans, so there's no reason I being a human too can't solve the problem. Surely, it can take time, but it isn't impossible.

Benefit

If successfully completed, what will its impact be on the BeagleBoard.org community?
This project project will be really helpful for everybody especially newbies, who would have a nice experience with flashing images easily and faster, so that they can focus on the more important stuff be it their robotics project, kernel development or some new PRU hack.
Quotes from BeagleBoard.org community members
Steve Arnold (nerdboy): It would be easier for newcomers and other community people. Smooth deployment is always good. If you can get it working smoothly/equivalently across 3 (desktop) platforms it would be even better than fsl mfgtool.
Michael Welling (m_w): It is certainly better than the TI programming tools (Uniflash v3.4.1 for AM335x) and also it worked only on older versions of Windows and linux only.

Suggestions

Is there anything else we should have asked you?
Yes, what help do I expect from mentor? I just want my mentor to answer my queries at mentor decided time. All the coding is my job :)
One more help, please send the hardware as soon as you decide to select my proposal. And even if this project is not taken by organisation in gsoc, please send me the hardware, I really want to do this project.