MicroPython installation for Maixduino

Hello,

First time here; apologies for asking a question that must have been answered previously but I couldn’t locate it in FAQ.

What are the steps to install Sipeed MicroPython (in Ubuntu 19.04) for use with Maixduino?

Thanks.

I think you are mixing up two different frameworks. Micropython allows you to program python on your board, Maixduino allows you to write arduino-style C-code. They can not be used simultaneously.

Are you asking for how to install MaixPy in Maixduino hardware?
just burn it into maixduino hardware, refer to maixpy.sipeed.com

Thank you for your kind reply. I have just a little of experience - I know enough about the difference between Arduino Sketch and MicroPython to be dangerously ignorant in these matters. :slight_smile: Please bear with me.

I have not been successful in running the standard Arduino Blink program with Maixduino without making any changes to the code (i.e. LED_BUILTIN == 13). Arduino IDE states that Upload complete but there is no blinking LED on the board. I simply wanted to know if the Maixduino board supports LED_BUILTIN (since no error was raised during the Verify/compile step). Of course, I could try the other RGB LEDs that are supposedly on the board (with pull-up resistors) in a circuit. But I feel that the issue will remain since the sketch output window seems to be hung. The board and port (and programmer) are correctly set under Arduino IDE. So the issue has to do something with my basic steps in reproducing the Blink program that I have used like a Hello World exercise with many diverse boards (UNO, MKR1xxx, RPi, AZ3166, NXP, TI). I think I know what the Blink program should do. I do not think that I know enough about the Maixduino board for this purpose. That was the reason for my request related to the expectations for running the Arduino Blink program on the Maixduino.

The MicroPython issue is totally unrelated to the Arduino issue. I want to use MicroPython with the Maixduino board (nothing to do with Arduino sketches). I cannot build the MicroPython library using the instructions at the sipeed.com site. The first make command (make ) fails! Is there any debugging assistance available for this purpose? How to build an instance of MicroPython on Ubuntu 19.04 platform for use with Maixduino? (I have not flashed anything to the board because I have not found any such documentation specific for the Maixduino at the Sipeed web sites.) The question here is: I have a new Maixduino board; what are the steps to get started with MicroPython? I could clone the GitHub repository but the first command to build is a make operation. This operation fails. I am using the instructions at https://github.com/micropython/micropython/wiki/Getting-Started for Debian, Ubuntu, Mint, and variants. The steps completed are:

  • List item Install prerequisite libraries (actually already installed in the desktop)

  • List item Clone the repository

  • List item Change directory to the Unix build directory

The step that did not work is (I checked and re-checked for typing mistakes; there is none):

  • List item make axtls

What do I have to do to continue with the “Getting Started” instructions?

Please accept my apologies for the confusion. I am a newbie to the Maixduino scene.

Kind regards.

Hello Zepan,

Thank you for your kind reply. Please allow me to summarize my current state:

  • List item Received Maixduino board

  • List item Connected board to Ubuntu (19.04) desktop without making any changes to Maixduino board except to connect display (:frowning: broke ribbon connector but display is working displaying Welcome to MaixPy) :slight_smile:

  • List item Using instructions from https://github.com/micropython/micropython/wiki/Getting-Started to install MicroPython executable for Ubuntu - no mention of sudo mode, so using regular desktop user account

  • List item Cannot make the executable using make axtls command
    My question is how to proceed forward with the rest of the Getting Started documentation?

Thank you once again for responding.

Kind regards.

Edit:
I think what you want is MaixPy. That will give you micropython on your sipeed board.

Original (not so interesting)
I’m using linux mint and had up to now been using an older version of micropython. So, reading your post, I tried the follow the instructions. But I too run into problems. ‘make axtls’ results in:

Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
make: Nothing to be done for ‘axtls’.

After that ‘make’ starts the compilation but stops with an error:

make: …/…/mpy-cross/mpy-cross: Command not found
…/…/py/mkrules.mk:112: recipe for target ‘build/frozen_mpy/upip_utarfile.mpy’ failed
make: *** [build/frozen_mpy/upip_utarfile.mpy] Error 127

In the older version I had to separately compile the mpy-cross, so that is what I did: go back up two directories to ‘micropython/mpy-cross’, then do ‘make’. This will compile the mpy-cross code. Then go back to the directory ‘micropython/ports/unix’ and do ‘make’ again. I noticed that during the compilation I see ‘…/…/lib/axtls/’ about 15 times. After a couple of seconds it finishes without problems and I have a working micropython on my linux desktop. (Not what I wanted, but hey, that’s what you get if you don’t read the whole manual :slight_smile:

Maybe you can use the pre-built versions from here?

You mention that your make of MaixPy failed. I remember that it did so for me as well.

Edit: (after some frantic searching, and basically just starting from scratch with maixpy to observe the error)
The problem I had is in the Makefile for the SDK that the maixpy installs itself (?why?). In ‘MaixPy/ports/k210-freertos/platform/sdk/Makefile’ on line 40 it says:

cd build && cmake …/$(SDK_DIR_NAME)/ -DPROJ=hello_world -DTOOLCHAIN=$(patsubst %/,%,$(dir $(CROSS_COMPILE))) && make -j${MAKE_J_NUMBER}

But, if I remember correctly, the patsubst does something weird. I have replaced it with the complete path for my SDK:

cd build && cmake …/$(SDK_DIR_NAME)/ -DPROJ=hello_world -DTOOLCHAIN=/home/j/bin/kendryte/kendryte-toolchain/bin && make -j${MAKE_J_NUMBER}

Don’t forget that you need a tab (not 4 spaces) in front of that line!

Now it works (for me)

Hello Sentry,

Yes the cmake command will do the trick. Thanks again for the suggestion and also for providing parameters for that command. That is extremely helpful too for me. Understand your comment about continuation line syntax.

I like your observation about the number of processors. Slightly off topic but an interesting observation for those who do not take advantage of your suggestion: it took me almost 42 hours to run make for OpenCV (pre 3.0) on a single core Raspberry Pi 2B. It took me less than 5 mins on my current desktop (which has only an 8th gen Intel CPU but 8 cores).

Kind regards.