Skip to main content
Associate II
Dec 16, 2024 10:58 AM UTC
Solved

Cross compiling a python program

Hello everyone,

I'm new to the STM32 and Linux environment and have a question.

I am using the STM32MP157d-dk1 and have been following the getting started guide

(see : https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Develop_on_Arm%C2%AE_Cortex%C2%AE-A7/Create_a_simple_hello-world_application ) and how to cross-compile with Developer-Package ( see : https://wiki.st.com/stm32mpu/wiki/How_to_cross-compile_with_the_Developer_Package#Adding_a_.22hello_world.22_user_space_example  ) and it all works fine. But I'd like to know how to do the same thing but using a .py file instead of .c file from my host machine as i want to mainly use python for my development. 

Thanks for your assistance.

Regards.

This topic has been closed for replies.
Andrew Neil
Andrew NeilBest answer
Super User
Dec 16, 2024 11:48 AM UTC

@Ozone wrote:

Not sure if something like 'pip' exists for the MP1s.


Looks like it should:

Solved: Control STM32MP157D-DK1 GPIO with python - STMicroelectronics Community

 

Some "getting started" tips for STM32MP157A-DK1 here:

Solved: Re: STM32MP157A-DK1 can run LINUX and Python code? - STMicroelectronics Community

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.

4 replies

Andrew Neil
Super User
Dec 16, 2024 11:08 AM UTC

Python is an interpreted language - you don't need to compile .py files.

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Ozone
Principal
Dec 16, 2024 11:22 AM UTC

As Andrew said, Python is an interpreted langauge.

So, you question morphs into - what Python libraries do you need, and if they are available / supported in ST's Yocto package.
Not sure if something like 'pip' exists for the MP1s.

Andrew Neil
Andrew NeilBest answer
Super User
Dec 16, 2024 11:48 AM UTC

@Ozone wrote:

Not sure if something like 'pip' exists for the MP1s.


Looks like it should:

Solved: Control STM32MP157D-DK1 GPIO with python - STMicroelectronics Community

 

Some "getting started" tips for STM32MP157A-DK1 here:

Solved: Re: STM32MP157A-DK1 can run LINUX and Python code? - STMicroelectronics Community

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate II
Dec 16, 2024 12:05 PM UTC

thanks i will check it out