Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasklist! #2

Closed
10 of 17 tasks
ladyada opened this issue Feb 7, 2018 · 11 comments
Closed
10 of 17 tasks

Tasklist! #2

ladyada opened this issue Feb 7, 2018 · 11 comments

Comments

@ladyada
Copy link
Member

ladyada commented Feb 7, 2018

This project is to 'port' the hardware API we use in CircuitPython as a python layer to MicroPython running on Pyboard or ESP8266. Since CircuitPython uses the same Python3 runtime, its just a matter of matching up the 'pyb' and 'esp' hardware commands for pins, i2c, spi, neopixels, etc.

Once complete, you should be able to run just-about-any CircuitPython library or project on a MicroPython board.
Here are the modules in circuitpython:
http://circuitpython.readthedocs.io/en/latest/shared-bindings/index.html#modules

Your tasks:

You will likely need to revision 'board' at this time and do some updates as you work on busio

  • Digital stuff done, you'll do a run on 'analogio' (analog in and output)

We'll evaluate our standing at this time and see if it makes sense to attack 'pulseio'

You'll need hardware that runs both MicroPython and CircuitPython:

@cefn
Copy link
Contributor

cefn commented Feb 19, 2018

Probably about time to get a steer if the direction is correct.

See https://github.com/cefn/Adafruit_Micropython_Blinka for the work-in-progress repository. I have put together package and test suite structure allowing test suites to be run against...

  • Feather M0 Express running CircuitPython
  • Feather Huzzah running CircuitPython
  • Feather Huzzah running Micropython with CircuitPython compatibility layer
  • Pyboard running Micropython with CircuitPython compatibility layer

A shallow description of the testing regime is at https://github.com/cefn/Adafruit_Micropython_Blinka/blob/master/notes/index.md although it has been very much in flux until recently, so documentation of the testing framework probably shouldn't be overdone right now.

This is not intended to be a test suite with extensive coverage, but it provides a useful structure for contributors to propose targets and demonstrate results as well as for project leaders to articulate differences and set directions for the work through test-driven development.

I have put some time into routines which selectively synchronize the relevant compatibility layers to the different platforms to accelerate testing, and I have some more days still in hand to work on this (roughly 5 days were set aside in total) so I am moving to have a go at I2C as proposed.

Note the issues at https://github.com/cefn/Adafruit_Micropython_Blinka/issues about completing PEP8 compliance and RST docstrings throughout but only if time remains after technical successes are achieved with the codebase so that it's seen to be worth doing this work. I will be led by your feedback.

So far the fundamentals of board, microcontroller and digitalio are operational in the compatibility layer, as indicated by the session documented at cefn#2 (comment) .

These have been recently tested on Huzzah and Pyboard, and I will return occasionally to M0 Express for conformance but the available memory was tight requiring tests to be run manually and individually on that platform, so I am waiting for the testing framework to be more settled before building frozen images and revisiting the M0 Express to verify conformance.

Before putting together a PR, I am aware you might want a different structure in the long run (only the compatibility layer - no testing or upload scripts, perhaps not a python directory). I don't want to pollute your working copy with the wrong structure but it's sure easier to operate with everything in one place right now. If you let me know what preferred structure I should PR I'm happy to do so.

Finally it's great to be working with you and I am very keen to ensure I deliver the right stuff, and welcome your thoughts and insights on what I could do better.

@ladyada
Copy link
Member Author

ladyada commented Feb 19, 2018

hey! looks good so far. yeah the m0 express is tight on memory, mpy helps but there's limited - im ok with occasional 'end of the task' tests to verify rather than trying to do constant checks.
we'll verify your work today so far with a pyb. but from what i can see this looks really good!

@ladyada
Copy link
Member Author

ladyada commented Feb 19, 2018

ok tested with a pyb and left some notes. really great so far! keep going :)

@tannewt
Copy link
Member

tannewt commented Feb 19, 2018

I added one comment on the microcontroller.pin stuff but looks good otherwise! Good work!

@cefn
Copy link
Contributor

cefn commented Feb 20, 2018

Soldered together all the bits, got familiar with relevant CircuitPython libs and I2C is now minimally functional on ESP8266 (BME280 attributes correctly populated) as of cefn@b73cdee Testing with Pyb tomorrow.

@ladyada
Copy link
Member Author

ladyada commented Feb 20, 2018

awesome! :)

@cefn
Copy link
Contributor

cefn commented Feb 22, 2018

Yesterday was Paragliding weather :).

For now I have put aside I2C test coverage for Pyboard etc. as a task to go back to as I think there will be a lot more needed to get substantial coverage anyway.

Right now want to make sure there are technical results across the piece to help us assess next steps, so was visiting SPI and UART.

Unfortunately I followed the link in the Tasklist which was (incorrectly?) linked to bitbangio so put some time into wrapping the bitbang implementation continuing from I2C. However, looking back at the task list, perhaps the title of the task bullet test should be respected, which said busio and would map to the hardware SPI instead.

Which one should I be looking at? The example file at https://github.com/adafruit/Adafruit_CircuitPython_RFM69/blob/master/examples/simpletest.py uses busio not bitbangio but I don't know if that's fundamental to RFM69.

@ladyada
Copy link
Member Author

ladyada commented Feb 22, 2018

woops typo on my part, i meant busio for all these (altho bitbangio has the same api, fyi, it just does the pin toggles by hand rather than depending on a built in hardware support peripheral)

@cefn
Copy link
Contributor

cefn commented Feb 23, 2018

Understood. Need to spin up into some other issues.

@cefn
Copy link
Contributor

cefn commented Feb 27, 2018

So there is now a PR fulfilling this Tasklist except...

  • BNO055 test authored but not successful (serving only zeroes - possibly hardware issue, can investigate further or hold off)
  • busio.SPI and bitbangio.SPI authored but not tested (libraries to service RFM69 reliant on descriptors unavailable in Micropython; investigating via No seamless workaround for missing descriptor support #6). Alternative scenario?
  • Not pursued oscilloscope-based tests. I'm hoping the BNC probe-cables for the oscilloscope in the new workshop should arrive imminently. I haven't much experience with an oscilloscope, honestly, but good to be nudged to start using the thing :) However, my early experimentation with the instrument could be unreliable, given my inexperience.

Can the oscilloscope trace indicate anything about the implementation choices made in the adafruit_blinka compatibility layer, or would I be investigating the timing-performance of Micropython's software/board hardware implementations. That might be beyond my expertise.

makermelissa pushed a commit that referenced this issue Jan 22, 2020
Rebase changes and point to latest Platform Detect
makermelissa added a commit that referenced this issue May 4, 2020
Add Orange PI 2 constant (Attempt #2)
makermelissa pushed a commit that referenced this issue Dec 9, 2020
makermelissa pushed a commit that referenced this issue Jan 4, 2021
BytEvil pushed a commit to BytEvil/Adafruit_Blinka that referenced this issue Mar 17, 2022
@makermelissa
Copy link
Contributor

Closing since to my knowledge code is all working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants