cancel
Showing results for 
Search instead for 
Did you mean: 

How to debug M4 firmware based on "st_image_core" using the EV1 board?

Machilus
Associate III

hello all

i have a STM32MP157C-EV1, and I want to build an m4 core development and debugging environment in minimal "st-image-core".

M4 firmware created using "STM32CudeIDE" can be debugged in "st-image-weston", but an error occurs in "st-image-core".

​What items should be added to "st-image-core.bb" to work normally?

error message :

[ 100.552483] remoteproc remoteproc0: powering up m4

[ 100.555897] remoteproc remoteproc0: Direct firmware load for OpenAMP_TTY_echo_CM4.elf failed with error -2

[ 100.571270] remoteproc remoteproc0: request_firmware failed: -2

[ 100.575829] remoteproc remoteproc0: Boot failed: -2

I will wait for your reply.

1 ACCEPTED SOLUTION

Accepted Solutions
Olivier GALLIEN
ST Employee

Hi @Machilus​ 

I can not figure out why remote proc browse so many folders ?

What is the structure of the /lib/firmware on your target ?

Where /lib/firmware/updates/4.19.94/ come from ?

Where is the OpenAMP_TTY_echo_CM4.elf exactly before you start the firmware ?

If I got it right it's working with "st-image-weston". Can you share the succeeded trace of firmware start ?

Any difference in /lib/firmware folder structure ?

Hope it help,

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

11 REPLIES 11
Olivier GALLIEN
ST Employee

Hi @Machilus​ ,

By comparing with st-image-weston.bb, I guess adding "eclipe-debug" in IMAGE_FEATURES looks to be good candidate.

I will ask for confirmation from expert.

Does your traces come from a Debug session from STM32CubeIDE or a manual start of firmware from Linux ?

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Machilus
Associate III

^^:

Hi ​ @OlivierG (ST Employee)

Thank you for your reply.

Tracking is a kernel message when executing a debug session of "STM32CubeIDE".

Adding "eclipse-debug" to "st-image-core.bb" has not solved the problem.

IMAGE_FEATURES += "\

  package-management \

  ssh-server-dropbear \

  eclipse-debug    \

  "

Olivier GALLIEN
ST Employee

Hi @Machilus​ 

Your initial trace show an error due to fact that firmware is missing in /lib/firmware

STM32CubeIDE is using ethernet connection to copy the .elf to the target.

Ethernet service may likely miss in st-image-core ( check on going at my end)

Did you noticed something wrong during download of .elf with STM32CubeIDE ?

Could you try manual copy and start of firmware on target using this

https://wiki.st.com/stm32mpu/wiki/Linux_remoteproc_framework_overview#Remote_processor_boot_through_sysfs)

Thanks for feedback

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi ​ @OlivierG (ST Employee)

No download problems using "STM32CubeIDE".

When manually running firmware in the manner OlivierG suggested,

the following problems occurred.

<< Execution Message >>

root@stm32mp1-fiscal:/lib# echo start >/sys/class/remoteproc/remoteproc0/state

[ 1090.457191] remoteproc remoteproc0: powering up m4

[ 1090.460584] remoteproc remoteproc0: loading /lib/firmware/updates/4.19.94/FISCAL_CM4.elf failed with error -20

[ 1090.474820] remoteproc remoteproc0: loading /lib/firmware/updates/FISCAL_CM4.elf failed with error -20

[ 1090.484713] remoteproc remoteproc0: loading /lib/firmware/4.19.94/FISCAL_CM4.elf failed with error -20

[ 1090.494670] remoteproc remoteproc0: loading /lib/firmware/FISCAL_CM4.elf failed with error -20

[ 1090.503785] remoteproc remoteproc0: Direct firmware load for FISCAL_CM4.elf failed with error -20

[ 1090.511210] remoteproc remoteproc0: request_firmware failed: -20

[ 1090.520436] remoteproc remoteproc0: Boot failed: -20

<<Below is a message from OpenOCD using ST-LINK.>>

Open On-Chip Debugger 0.10.0+dev-01193-g5ce997d (2020-02-20-10:54)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

cortex_a interrupt mask on

cortex_a interrupt mask on

cortex_a domain access control fixup on

cortex_a domain access control fixup on

none separate

adapter speed: 8000 kHz

adapter_nsrst_assert_width: 200

adapter_nsrst_delay: 200

none srst_pulls_trst

srst_only srst_pulls_trst srst_gates_jtag srst_open_drain connect_deassert_srst

Info : Listening on port 6666 for tcl connections

Info : Listening on port 4444 for telnet connections

Info : STLINK V3J6M2B4S1 (API v3) VID:PID 0483:374F

Info : using stlink api v3

Info : Target voltage: 3.238171

Info : clock speed 8000 kHz

Info : SRST line released

Info : stlink_connect(connect)

Info : SWD DPIDR 0x6ba02477

Info : STM32MP151CAAx.cpu0: hardware has 6 breakpoints, 4 watchpoints

Error: Could not find MEM-AP to control the core

Info : Listening on port 3334 for gdb connections

Info : Listening on port 3333 for gdb connections

ap 0 selected, csw 0x10006000

Info : accepting 'gdb' connection on tcp/3333

Error: Target not examined yet

Info : New GDB Connection: 1, Target STM32MP157CAAx.cpu2, state: unknown

undefined debug reason 7 - target needs reset

Error: Target not examined yet

Error: Target not examined yet

Error: Target not examined yet

Error: Target not examined yet

Thank you for your interest in this problem.

Olivier GALLIEN
ST Employee

​Hi @Machilus​ 

I noticed very strange/abnormal traces in your OpenOCD log :

Info : STLINK V3J6M2B4S1 (API v3) VID:PID 0483:374F

Info : STM32MP151CAAx.cpu0: hardware has 6 breakpoints, 4 watchpoints

Definitly not matching an EV1 board !?

Can you clarify your setup ?

For which target did you compile the .elf ?

For manual start of firmware can you confirm the firmware is well present in /lib/firmware ?

Thanks

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi ​ @OlivierG (ST Employee)

Sorry.​

I sent the wrong message.

It was a message from a custom board made from a "STM32MP151C" chip based on the "STM32MP157C-EV1" board.

Recently, I debugging "OpenAMP_TTY_echo" firmware from created a "st-image-core" distribution on the "EV1" Board.

​It worked without error.

However, running the M4 firmware on the custom board based on "STM32MP151C" resulted in an error.

​This error does not occur in the "st-image-weston" distribution,

Error occurs only in "st-image-core" distribution.

<<Below is a message from OpenOCD using ST-LINK V3SET>>

Open On-Chip Debugger 0.10.0+dev-01193-g5ce997d (2020-02-20-10:54)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

cortex_a interrupt mask on

cortex_a interrupt mask on

cortex_a domain access control fixup on

cortex_a domain access control fixup on

none separate

adapter speed: 8000 kHz

adapter_nsrst_assert_width: 200

adapter_nsrst_delay: 200

none srst_pulls_trst

srst_only srst_pulls_trst srst_gates_jtag srst_open_drain connect_deassert_srst

Info : Listening on port 6666 for tcl connections

Info : Listening on port 4444 for telnet connections

Info : STLINK V3J6M2B4S1 (API v3) VID:PID 0483:374F

Info : using stlink api v3

Info : Target voltage: 3.234990

Info : clock speed 8000 kHz

Info : SRST line released

Info : stlink_connect(connect)

Info : SWD DPIDR 0x6ba02477

Info : STM32MP151CAAx.cpu0: hardware has 6 breakpoints, 4 watchpoints

Error: Could not find MEM-AP to control the core

Info : Listening on port 3334 for gdb connections

Info : Listening on port 3333 for gdb connections

ap 0 selected, csw 0x10006000

Info : accepting 'gdb' connection on tcp/3333

Error: Target not examined yet

Info : New GDB Connection: 1, Target STM32MP151CAAx.cpu2, state: unknown

undefined debug reason 7 - target needs reset

Error: Target not examined yet

Error: Target not examined yet

Error: Target not examined yet

Error: Target not examined yet

<< Execution Message >>

root@stm32mp1-fiscal:~# echo start > /sys/class/remoteproc/remoteproc0/state

[ 489.401238] remoteproc remoteproc0: powering up m4

[ 489.404634] remoteproc remoteproc0: loading /lib/firmware/updates/4.19.94/OpenAMP_TTY_echo_CM4.elf failed with error -20

[ 489.418946] remoteproc remoteproc0: loading /lib/firmware/updates/OpenAMP_TTY_echo_CM4.elf failed with error -20

[ 489.429594] remoteproc remoteproc0: loading /lib/firmware/4.19.94/OpenAMP_TTY_echo_CM4.elf failed with error -20

[ 489.440258] remoteproc remoteproc0: loading /lib/firmware/OpenAMP_TTY_echo_CM4.elf failed with error -20

[ 489.450382] remoteproc remoteproc0: Direct firmware load for OpenAMP_TTY_echo_CM4.elf failed with error -20

[ 489.460633] remoteproc remoteproc0: request_firmware failed: -20

[ 489.467095] remoteproc remoteproc0: Boot failed: -20

Regards

machilus

Olivier GALLIEN
ST Employee

Hi @Machilus​ 

I can not figure out why remote proc browse so many folders ?

What is the structure of the /lib/firmware on your target ?

Where /lib/firmware/updates/4.19.94/ come from ?

Where is the OpenAMP_TTY_echo_CM4.elf exactly before you start the firmware ?

If I got it right it's working with "st-image-weston". Can you share the succeeded trace of firmware start ?

Any difference in /lib/firmware folder structure ?

Hope it help,

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi ​ @OlivierG (ST Employee)

I solved this problem.

In "st-image-core", "/lib/firmware" is a file.

In "st-image-weston", "/lib/firmware" is a directory.

In "st-image-core," I solved the problem by making "/lib/firmware" a directory.

Naturally, firmware exists within the "/lib/firmware" directory.

Thank you for helping me solve the problem.

Best regards.

Machilus.