I'd like to add support I2c to boards, running zephyr OS
I have MicroPython running on Galileo for example
Is there any reference how to add - import machine?
Then I would connect zephyr calls, but don't understand the flow yet
import machine returns error, even I've added to config file
#define MICROPY_PY_MACHINE (1)
Please help, any document or readme how to add import and maybe "machine" specific
Thanks
Porting to Zephyr RTOS (zephyrproject.org)
Re: Porting to Zephyr RTOS (zephyrproject.org)
Hello mishka27, thanks for bringing this discussion to forum from the email, and sorry for delay with the response and for confusion your post may have caused.
So, the current situation with Zephyr RTOS port is that:
Now answering your question, if you don't want to wait and would like to play with something now, you may want to look at Daniel Thompson's fork, specifically this is a commit which implements machine.Pin class: https://github.com/daniel-thompson/micr ... 74225dbba4 . Note that it will need rework before being merged to master. You can look at any other port to see how machine.I2C is implemented: stmhal, esp8266. If you're interested to learn basics of how to implement a module for MicroPython, looking in extmod/ subdir would give you few easy to follow, mostly self-contained modules, https://github.com/micropython/micropyt ... binascii.c is a good example.
So, the current situation with Zephyr RTOS port is that:
- There's a branch with a focus on supporting (TCP) networking features of Zephyr: https://github.com/pfalcon/micropython/tree/zephyr
- There's a branch with an initial, basic implementation of machine module, specifically Pin class: https://github.com/daniel-thompson/micr ... ree/zephyr
Now answering your question, if you don't want to wait and would like to play with something now, you may want to look at Daniel Thompson's fork, specifically this is a commit which implements machine.Pin class: https://github.com/daniel-thompson/micr ... 74225dbba4 . Note that it will need rework before being merged to master. You can look at any other port to see how machine.I2C is implemented: stmhal, esp8266. If you're interested to learn basics of how to implement a module for MicroPython, looking in extmod/ subdir would give you few easy to follow, mostly self-contained modules, https://github.com/micropython/micropyt ... binascii.c is a good example.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Porting to Zephyr RTOS (zephyrproject.org)
Some updates on Zephyr port: 1.8.5 release went with basic support for Zephyr port. Since then, "utime" module implementation was merged. machine.Pin support is next in queue.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Porting to Zephyr RTOS (zephyrproject.org)
Just as an update: Zephyr port is updated in mainline (should build with each last released Zephyr version), and maintained in my fork (https://github.com/pfalcon/micropython). There wasn't too much development of the port over last couple of years, but some was, e.g. Zephyr's Sensor API was wrapped into port-specific "zsensor" module. That for example allows to develop sensor devices communicating over network.
Here's example demo of an STM32 demo running a webserver with webapp showing sensor output:
https://www.youtube.com/watch?v=_CC6JJCSJiY
Here's example demo of an STM32 demo running a webserver with webapp showing sensor output:
https://www.youtube.com/watch?v=_CC6JJCSJiY
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/