Skip to main content
Associate II
December 16, 2024
Solved

Cross compiling a python program

  • December 16, 2024
  • 2 replies
  • 1023 views

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.

Best answer by Andrew Neil

@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

2 replies

Andrew Neil
Super User
December 16, 2024

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
December 16, 2024

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
December 16, 2024

@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
December 16, 2024

thanks i will check it out