"invalid arch" error

I am building lv_micropython on NXP iMX.8 under Debian Linux.

When I run make -C ports/unix/ I am getting:

make: Entering directory '/root/lv_micropython/ports/unix'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
MPY imagetools.py
error compiling /root/lv_micropython/lib/lv_bindings/lib/imagetools.py:
Traceback (most recent call last):
  File "imagetools.py", line 33, in <module>
SyntaxError: invalid arch
make: *** [../../py/mkrules.mk:142: build-standard/frozen_content.c] Error 1
make: Leaving directory '/root/lv_micropython/ports/unix'

Please help!

It’s not clear to me if you are trying to build the unix port or some other port.
You wrote that you are building NXP iMX.8 but the log you sent says:

make: Entering directory '/root/lv_micropython/ports/unix'

Currently we are actively supporting the following ports: unix, esp32, stm32, js (to some extent)
Other ports can also work, but would require a little bring-up effort for integrating the display/touch drivers and the LVGL bindings code.

  • What port are you trying to build?
  • Did you make mpy-cross, as explained in the build instructions?

Yes, I did make mpy-cross as explained.

I am trying to build unix port of lv_micropython on the MaaXBoard (iMX.8) under Debian Linux OS. My plan is to build UI against its framebuffer.

I see.

The error you are getting is related to the native code emitter.
I guess that Micropython does not support native/viper code emitters under iMX.8.

As a workaround, you can comment all @micropython.native and @micropython.viper decorations on imagetools.py.

After doing that I don’t recommend using the PNG image decoder on your platform, as it would be very very slow when the conversion function are not native.
You can either directly use binary images or if you must use PNG you could rewrite the conversion function in C. Or implement a Micropython native/viper code emitter for your platform and contribute it to Micropython upstream if you are brave :wink:

Commenting @ directives helped! Thank you!

Can you point to where I can find what archs are supported by native/viper directives?

I am now getting another error from the C compiler:

main.c: In function ‘main_’:
main.c:595:22: error: variable ‘subpkg_tried’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
                 bool subpkg_tried = false;
                      ^~~~~~~~~~~~

Actually I’m not sure.
It’s best to ask that on the Micropython forum.

Again, not sure.
longjmp is used when raising Micropython exceptions.
You can try ignoring this warning and see if it’s working for you.

For now I would try removing -Werror. This code is only run when the -m option is used with MicroPython so it’s unlikely that you will run into a problem. In any case, the affected line is unmodified from upstream, so it’s probably worth opening an issue there.

Yes. removing -Werror helped and I was able to run micropython executable. Thank you!

WRT native/viper: looks like only ARMv7 is currently supported and iMX.8M is an ARMv8.

Question: have you considered binding LVGL to a regular Python under embedded Linux?

Historically there was an effort creating a Python bindings, but it is not maintained.
lv_micropython is mostly targeted for embedded devices, so the focus is Micropython and not Python.

For more details have a look at:

This thread answers my question. Thank you!

Also found the issue tracking the warning I got: https://github.com/micropython/micropython/issues/6636