Build a custom Duo image with MicroPython + other features

Hi, I just ordered a Milk-V Duo online and I’m hoping to get it soon. In the meantime I’ve been working to put together a custom image and I keep hitting roadblocks. The process of trying to figure out how to add stuff like Python/MicroPython to the buildroot is getting rather frustrating. I did manage to compile an image with the apps but when I booted it in QEMU I kept getting Illegal Instruction errors like the files weren’t even executable, along with some other errors.
image

Could someone walk me through the process of compiling an image with additional apps installed? Thanks.

To add python3 I edited the file: /duo-buildroot-sdk-develop/buildroot-2021.05/configs/milkv_duo_musl_riscv64_defconfig and added the following lines to the end of the file:
BR2_PACKAGE_LIBFFI=y
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON3_PYC_ONLY=y

I then recompiled to make a new image.
I have python3 working on a milkv-duo board

you mentioned about micropython,can u run it or share the way how u build it?for me,i added mpy at buildroot but in system it can’t run even fix the so.1 problem ,it report IO error.

It seems to compile, but doesn’t run last I checked. It would probably be better off if someone wrote a standard Python library like the one that the Raspberry Pi uses for interacting with GPIO.

On another note, I’ve been attempting to get Python pip running but have been running into issues mostly with an error where it can’t import the xml module.

yes,many modules can’t run (like mpy) even they r in the buildroot,as a casual Linux user i also hope to use simple python scripts to controll the board.
I am trying to pack a machine module in python to control the /sys/devices/ filesystem,but the work is far form finishing(only gpio and i2c had been done)

I wanted to see if I could get it to run the Duino coin miner as more of a test as Duino is worth absolutely nothing nowadays, but since pip doesn’t really work you don’t really have many other options.

Though I just had a bit of an idea to use a pre-compiled Python 3.9.5 install and venv to install all the modules I need and maybe port the venv instance over. I’ll have to test that at some point.

The latest firmware now includes python and pip tool, You can give it a try first.

1 Like