STM32MP157 M4 Coprocessor programming

Started by Ste_trat, April 15, 2022, 09:36:07 PM

Previous topic - Next topic

Ste_trat

Hi!
i am currently looking for a way to program the M4 coprocessor (preferably with CubeIDE and CubeProgrammer), and i am reading trough all examples and wiki-pages from ST, but so far without any success.

Is there a way to enter a "production" or "engineering" mode with this board?
Also: What type of connection do you recommand to do so? (i ran into several issues trying to establish a connection with SWD and UART)

Thank you,
Stephan

LubOlimex

Bare metal programming of STM32STMP157 requires significant knowledge, the chip is meant to be used and programmed with operating system like Linux or RTOS.

If you still wish to see how it is done maybe check this effort here:

https://github.com/4ms/stm32mp1-baremetal

If you decide to go for Linux (as I would recommend you), then maybe check the resources related to Olimex board with the same chip like STMP157-OLinuXino-LIME2:

https://www.olimex.com/Products/OLinuXino/STMP1/STMP157-OLinuXino-LIME2/open-source-hardware
Technical support and documentation manager at Olimex

Ste_trat

Hi,

Update on this:
managed to enter debug mode with ST-Link V2.1.

i still would like to know if there is an easy way to change the device tree of the STMP157-board without the need to know about all the settings in CubeMX, so that i can program the M4 with the use of HAL lib.
 
The task is:
Use a M4 and it´s DAC + ADC for DSP stuff + PID control something, it doesn´t need to be bare-metal. + a µ-Processor for Python stuff.


SteffenFuchs

Hi,

have you in the end been able to control pins and other hardware from the M4? If so, what did you have to do?

Ste_trat

Hi,

If you have success in installing the stm32 tool chain, you can simply connect to the Cortex M4 for debugging with your st-link in production or engineering mode, and upload some test code to it, as .elf files.

Since olimex is not sharing the .ioc files for stm32 cube ide, you can painfully reverse engineer it and have there a starting point. Here you can dig anywhere in the device tree files and look up the plls und clock frequency etc. and enter them by hand in the stm32 cube mx.

after that you will be lucky to use the cube ide and assign the peripherals to the cortex m4 core, and even will be able to create a STM based yocto image.

From my understanding it should also be possible to use the cortex m4 without doing this, but with the risc of having allocated memory/ resources conflict, they should be assigned to only one core at a time.

Thats where i stopped last time, since i did not have enough the time to investigate this further in my free time ...

BR Stephan

PomaryLinea

Hi! Programming the M4 coprocessor on certain STM32 boards can be tricky, but it's definitely possible. Here's some info to help:

Entering "Production" or "Engineering" Mode:

Unfortunately, not all STM32 boards have dedicated modes like "production" or "engineering." These might be specific to certain lines or older models.
Check your board's datasheet or reference manual for details on any special programming modes and how to activate them (usually involving specific pin configurations or jumpers).
Connection Options:

SWD: This is the most common and recommended connection for programming and debugging STM32 MCUs. Double-check your connections ensure correct pinout and voltage levels.
UART: While also possible, UART is less common for programming and might require specific bootloader configurations. Refer to your board's documentation for UART programming details.