This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-AM62: Execution error for the python

Part Number: SK-AM62

Hello Ti,

I have the python file on the host machine and I package the file with pyinstaller tool.

However, the packaged file cannot execute on the am62, here is the error message:

root@am62xx-evm:~# ./pyfile

-sh: ./pyfile: cannot execute binary file: Exec format error

BR

James

  • Hi James,

    according to the pyinstaller documentation https://pypi.org/project/pyinstaller/ it is not a cross-compile tool. I suspect what happened is you built the installer on a machine that is not compatible with the AM62x target environment. You can double-check this by running 'file pyfile' on the AM62x target and it will likely show an incompatible architecture. If you want to deploy a Python program you could always deploy it as source, or you need to build an executable installer using a compatible platform (or build it natively directly on the AM62x -- I've not tried that but I suppose if sufficiently motivated one can make this work).

    Regards, Andreas

  • Hi Andreas,

    Because of the limitation of the target memory, I have to use the cross-compile tool.

    Is there any other solution to comile the python file to execute on the target?

    BR

    James

  • Because of the limitation of the target memory, I have to use the cross-compile tool.

    I suppose you could use an ARM-based development platform such as many of the Chromebooks (https://www.linuxmadesimple.info/2019/08/all-chromebooks-with-arm-processors-in.html) to make a native ARMv8 pyinstaller build in a more resource-rich environment, and then copy the resulting executable over to the AM62x board.

    Another perhaps easier method could be using https://pypi.org/project/crossenv/ which I found after a quick websearch. Can you please review and perhaps try it out if that gets the job done.

    I've not tried those approaches myself but it's also a bit outside the scope what we can support here in our forum but I'd appreciate you reporting back if you find a workable solution.

    Regards, Andreas