PI 3 port: many classes missing from machine lib

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
megane72
Posts: 2
Joined: Wed May 18, 2022 3:00 pm

PI 3 port: many classes missing from machine lib

Post by megane72 » Wed May 18, 2022 3:02 pm

Hi to all, I compiled micropython on Rapsberry PI 3 in order to make some test waiting the arrival of a ESP32 board

Those the steps I hope to have followed right

/micropython/ports/unix
make clean
make submodules
make deplibs
make axtls

/micropython/mpy-cross
make

/micropython/ports/unix
make

no error whatsoever, after installing all the required components (some trial and error needed)
and micropython works fine, except there are many missing classes form "machine" lib, like the I2C that i strongly need

sys for example is complete
>>> import sys
>>> dir(sys)
['__class__', '__name__', 'argv', 'atexit', 'byteorder', 'exc_info', 'exit', 'implementation', 'maxsize', 'modules', 'path', 'platform', 'print_exception', 'stderr', 'stdin', 'stdout', 'version', 'version_info']

>>> from sys import stdin
>>>

machine no
>>> import machine
>>> dir(machine)
['__class__', '__name__', 'PinBase', 'Signal', 'idle', 'mem16', 'mem32', 'mem8', 'time_pulse_us']

>>> from machine import I2C
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: can't import name I2C

Maybe I missed some step? something to configured spcifically for that port? any suggestion is welcome

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: PI 3 port: many classes missing from machine lib

Post by Roberthh » Wed May 18, 2022 3:17 pm

The Unix port does not have the hardware related modules and classes in machine.

Post Reply