BeagleBoard/GSoC/2021 Proposal/Micropython for BeagleConnect Freedom
- 1 [Micropython for BeagleConnect Freedom]
- 2 Status
- 3 Proposal
- 3.1 About you
- 3.2 About your project
- 3.2.1 Description
- 3.2.2 Implementation
- 3.2.3 Possible extensions to the project
- 3.2.4 Timeline
- 3.2.5 Experience and approach
- 3.2.6 Contingency
- 3.2.7 Benefit
- 3.3 Misc
[Micropython for BeagleConnect Freedom]
Student: Szymon Duchniewicz
Mentors: Jason Kridner
Code: No code just yet
GSoC: GSoC entry
This project is currently just a proposal.
Please complete the requirements listed on the ideas page and fill out this template.
School: University College London
Country: United Kingdom/Poland
Primary language: Polish
Typical work hours: 8AM-5PM CET
Previous GSoC participation: I haven't participated before in GSoC but I am very intrigued by the idea of being able to work with an Open Source organization, as I always wanted to get involved with Open Source and this looks like a great place to start! Furthermore, I believe that through this project I could develop my current skill-set substantially both in software and hardware domains. As I have some previous experience in working with embedded systems such as Arduino and Rpi and programming them in Python, I thought that the idea of bringing Micropython to BeagleConnect Freedom is great and would fit my current capabilities quite well, while also posing an interesting challenge!
About your project
Project name: Micropython for BeagleConnect Freedom
The goal of this project is to enable Micropython for BeagleConnect Freedom along with basic GPIO, I2C, SPI, PWM, ADC drivers. MicroPython is a C implementation of the widely known and used Python3 language aimed specifically to run on a microcontroller. A ported MicroPython would allow for easy out-of-the-box development and prototyping with BeagleConnect Freedom, Python being an easy to learn and use language, with powerful capabilities at the same time being very concise. The drivers would be written in C as an extension and interface to MicroPython. The port itself along with additional extensions would be based on the official documentation by MicroPython for porting the language. Additionally after the MicroPython port and writing the basic drivers I could test them in practice using the supported MikroElectronika boards.
// Should CircuitPython also be ported to be more newbie-friendly, if porting MicroPython proves to be rather quick?
// Does the current port of MicroPython for Zephyr build correctly for BeagleConnect Freedom? (I assume it already has working drivers that Zephyr on Beagle can communicate with the MCU and use I2C SPI and GPIO)
// What other modules should be added to the minimal version of MicroPython? (Is GPIO, I2C SPI PWM and ADC all that would be necessary?)
This would be the starting point of the whole project. Before doing anything else, MicroPython itself needs to be ported to work on Zephyr RTOS and the BealgeConnect Freedom itself, as the rest of the project relies on a working ported version of it. A work-in-progress port for Zephyr would be the starting point for this part of the project. Ensuring that a minimal build with a simple REPL loop can be built and run on the BeagleConnect board would be the next step.
The basic drivers required by this project include GPIO, I2C, SPI, PWM and ADC, since they would allow many sensors interfacing with the BeagleConnect Freedom to be programmable and utilised via MicroPython. As Python in general is more space and time hungry than C, and given we have limited resources on the microcontroller, it is logical to write those basic drivers in C and create MicroPython interfaces for them.
In the current port of MicroPython for Zephyr a MicroPython module machine is already implemented with some basic submodules and functionalities for I2C and GPIO. Therefore these modules would need to be extended or rewritten to be able to interface with BeagleConnect Freedom as well as additional such drivers would be implemented for SPI, PWM and ADC.
Possible extensions to the project
After successfully completing a MicroPython port for the BeagleConnect Freedom and writing the minimal drivers, porting CircuitPython would be a good addition. Although CircuitPython is far less advanced than MicroPython, it is more newbie-friendly. This would allow beginners easier entry to the world of IOT and for experimenting with the BeagleConnect.
Adding more MicroPython modules to work with the BeagleConnect Freedom
There are many libraries (modules) implemented in the core version of MicroPython, ranging from libraries derived from original Python3 core libraries to MicroPython-specific libraries (such as machine module). Adding some of those libraries would give more possibilities when developing on BeagleConnect Freedom using MicroPython. An example would be to implement ubluetooth library which could be used by the BeagleConnect node device.
Provide a development timeline with a milestone each of the 11 weeks and any pre-work. (A realistic timeline is critical to our selection process.)
|Mar 29||Applications open, Students register with GSoC, work on proposal with mentors|
|Apr 13||Proposal complete, Submitted to https://summerofcode.withgoogle.com|
|May 17||Proposal accepted or rejected|
|Jun 07||Pre-work complete, Coding officially begins!|
|Jun 17||Milestone #1, Introductory YouTube video|
|June 24||Milestone #2|
|June 30||Milestone #3|
|July 12 18:00 UTC||Milestone #4, Mentors and students can begin submitting Phase 1 evaluations|
|July 16 18:00 UTC||Phase 1 Evaluation deadline|
|July 23||Milestone #5|
|July 30||Milestone #6|
|Aug 06||Milestone #7|
|August 10||Milestone #8, Completion YouTube video|
|August 16 - 26 18:00 UTC||Final week: Students submit their final work product and their final mentor evaluation|
|August 23 - 30 18:00 UTC||Mentors submit final student evaluations|
Experience and approach
In 5-15 sentences, convince us you will be able to successfully complete your project in the timeline you have described.
What will you do if you get stuck on your project and your mentor isn’t around?
If successfully completed, what will its impact be on the BeagleBoard.org community? Include quotes from BeagleBoard.org community members who can be found on http://beagleboard.org/discuss and http://bbb.io/gsocchat.
Pull request required for qualification can be found here.
Is there anything else we should have asked you?