cancel
Showing results for 
Search instead for 
Did you mean: 

I am working on ZephyrRTOS framework and want to make debugging setup for target stm32mp157c-dk2 board in engineering mode. Want to debug ARM Cortex-M4 Core of the STM32MP1 Devices in engineering mode by using STLinkV2. Could you suggest!! Thanks!!

skuma.9
Associate II
 
5 REPLIES 5
ufo2ofu
Associate

To do so in command line:

  1. Install STM32CubeIDE (it comes with OpenOCD and the good config files)
  2. Listen to this. It will show you the basics of setup up a debug session using STM32CubeIDE.
  3. Like in the video, in the menu 'Debug Configurations' -> 'Debugger (tab)' you will find a button titled 'Show Command Line'. Copy this line.
  4. Execute this cmd line in a terminal.
  5. Start GDB in another terminal window. At GDB prompt you should enter something like:
(gdb) target remote localhost:3333

 You should now be connected and be able to debug your m4 firmware using GDB

skuma.9
Associate II

Getting this after running these command:

0693W00000WHS48QAH.png0693W00000WHS3oQAH.png 

Could you suggest if I am doing something wrong!!

ArnaudP
Senior

Hello,

The engineering mode is not supported in Zephyr for the stm32mp15 platform. It has been designed to work in production mode, means that the system is initialized by the Cortex-A and the cortex-M is acting as a coprocessor.

If you want to support the engineering mode, you will have first to implement the system_clock config (expecting that is sufficient).

You can have a look to stm32mp1 cube examples for guidance.

https://github.com/STMicroelectronics/STM32CubeMP1/blob/master/Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo/Src/main.c#L90

This wiki page can also help:

https://wiki.st.com/stm32mpu/wiki/STM32CubeMP1_development_guidelines

skuma.9
Associate II

Hello @ArnaudP​ ,

Thanks for Response!!

I am debugging with Eclipse using PyOCD in engineering mode by using STLinkV2 (on STM32MP1 Dev kit).

I am able to start with debugging but when breakpoint hits into thread and it goes to SPI driver inside Zephyr and it is getting stuck there and then throws an exception.

To debug Cortex M4 in production mode what configuration is required for the same environment (Zephyr) Could u suggest.

Thanks!

> I am debugging with Eclipse using PyOCD in engineering mode by using STLinkV2 (on STM32MP1 Dev kit).

> I am able to start with debugging but when breakpoint hits into thread and it goes to SPI driver > inside Zephyr and it is getting stuck there and then throws an exception.

look like your SPI peripheral is not well clocked, do you configure the clock tree (SystemClock_Config()) as mentioned in my previous comment?

> To debug Cortex M4 in production mode what configuration is required for the same environment (Zephyr) Could u suggest.

No specific configuration is needed on zephyr side.

on Linux side: you should need to use the resource manager ST framework on Linux side to assign SPI to the M4,

https://wiki.st.com/stm32mpu/wiki/How_to_configure_system_resources