Page 1 of 1

mpy-cross for stm32 exist ??

Posted: Thu Jun 18, 2020 1:00 pm
by bellad
hello,
i try mpy-cross.exe windows for stm32

Code: Select all

MicroPython v1.12-513-g51fd6c977-dirty on 2020-06-08; MCUDEV STM32F407VE with STM32F407VE
but when import

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid syntax for number
mpy-cross version :

Code: Select all

 MicroPython v.1.12 on 2019-12-21;mpy-cross emitting mpy v5

Re: mpy-cross for stm32 exist ??

Posted: Fri Jun 19, 2020 11:31 am
by bellad
i ask me if i have the good firmware
because :

Code: Select all

>>> import gc
>>> gc.collect()
>>> gc.mem_free()
33488
>>> 
MPY: sync filesystems
MPY: soft reboot
MPY: can't mount SD card
MicroPython v1.12-513-g51fd6c977-dirty on 2020-06-08; MCUDEV STM32F407VE with STM32F407VE
Type "help()" for more information.
>>> 
33488 ???

Re: mpy-cross for stm32 exist ??

Posted: Mon Aug 24, 2020 3:54 am
by ws1088
I come across the my question. What options should I use to create mpy files for STM32 boards?
I just simply want to byte-compile my python files into mpy files so I can load them (using import command) on the STM32 boards...

Re: mpy-cross for stm32 exist ??

Posted: Mon Aug 24, 2020 4:37 am
by pythoncoder
mpy-cross --help is your friend.

Re: mpy-cross for stm32 exist ??

Posted: Mon Aug 24, 2020 5:48 am
by ws1088
pythoncoder wrote:
Mon Aug 24, 2020 4:37 am
mpy-cross --help is your friend.
Unfortunately mpy-cross and me are still getting to know each other. I don't know about the arch to use (archv7?) etc...

Re: mpy-cross for stm32 exist ??

Posted: Mon Aug 24, 2020 10:23 am
by pythoncoder
See the docs. It'll be xtensa or xtensawin but the doc explains how to determine it.

Re: mpy-cross for stm32 exist ??

Posted: Sun Aug 30, 2020 8:31 pm
by ws1088
thanks, I was able to study the help page and follow the instructions and cross compile my py files. I also compared the 1st 4 bytes of what i generated and what is there already to make sure it is correct before I uploaded to the board. thanks!