← index #5515Issue #3941
Off-topic · high · value 1.723
QUERY · ISSUE

Got "mpy-cross : Malformed Mach-o file" error when make firmware on MacOS Catalina

openby pointcloudAIopened 2020-01-10updated 2020-01-22

I want to build firmware on MacOS Canalina but got "Malformed Mach-o file" error.

The problem is from "mpy-cross"

My detail process as below :

I had set up ~/edp-idf and ~/esp/xtensa-esp32-elf

On ~/.bashrc :
export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH export IDF_PATH=~/esp/esp-idf
Then go to ports/esp32 and perform "make V=1", but got "Malformed Mach-o file" error as below :
../../mpy-cross/mpy-cross -o build/frozen_mpy/flashbdev.mpy -s flashbdev.py modules/flashbdev.py make: ../../mpy-cross/mpy-cross: Malformed Mach-o file make: *** [build/frozen_mpy/flashbdev.mpy] Error 1

Then , i try :
cd mpy-cross
make clean make

The result as below:
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity. rm -f mpy-cross rm -f mpy-cross.map rm -rf build CC gccollect.c LINK mpy-cross BFD: mpy-cross: unknown load command 0x32 text data bss dec hex filename 130999 13512 860 145371 237db mpy-cross
Then perform :
"./mpy-cross --help"
But got
Killed: 9

CANDIDATE · ISSUE

Having issues building the firmware for STM32F4

closedby HaidStefanopened 2018-07-12updated 2018-07-13

Hello,

I have tried to build the firmware on the current master branch for the STM32F4 discovery board. My goal is to extend the firmware with some custom c-libraries, but at first i wanted to try to just build and flash the unchanged firmware.

I cloned the git repo and used the git submodule update --init command as described in some tutorials.

First i tried to build it on Windows 10 with CMD using GNU Tools Arm Embedded Toolchain.
To build the Firmware i used the command: make BOARD=STM32F4DISC
but i receive the following error:

LINK mpy-cross
strip: 'mpy-cross': No such file
make[1]: *** [../py/mkrules.mk:134: mpy-cross] Error 1
make[1]: Leaving directory 'C:/workdir/github_python/micropython/mpy-cross'
make: *** [../../py/mkrules.mk:108: ../../mpy-cross/mpy-cross] Error 2

I searched a lot but sadly could not find a working solution.

The second try was using MINGW64. I have installed the latest MSYS2 and updated everything using
pacman -Syu .

After i wanted to install the mingw-w64-arm-none-eabi-gcc package but with pacman -S mingw-w64-arm-none-eabi-gcc it didn't work.
I tried to build the toolchain myself (https://github.com/kekyo/gcc-toolchain) and using the packages in "releases" but both did not work.

Does anyone know a possible solution for my issues? I My next try would be to set up a vm with linux...
I am thankful for every help because I really want to try to extend the firmware...

many thanks
cheers

Stefan

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied