cancel
Showing results for 
Search instead for 
Did you mean: 

Intermittent debugging error with STM32MP257F-DK and STM32CubeIDE

rdmikkelsen
Associate III

I am trying to debug a project I have created in STM32CubeMX and edited in STM32CubeIDE with the STM32MP257F-DK. I am seeing an intermittent error which is mentioned in the troubleshooting grid, but it's not clear to me how to fix it. 

 

After it builds with no errors, I get a familiar message:

Error in final launch sequence:

Failed pre launch
Failed pre launch
Firmware remoteproc load failed, please:
1. make sure that /lib/firmware on your target has space
2. make sure that /lib/firmware has write access

> you can open a Console View for this..

When I check dmesg on the board, I see the lines

[ 58.546876] remoteproc remoteproc0: powering up m0
[ 58.628708] remoteproc remoteproc0: Booting fw image Project_Name_CM33.elf, size 3097880
[ 58.631958] remoteproc remoteproc0: bad phdr da 0x80100000 mem 0x540
[ 58.638236] remoteproc remoteproc0: Failed to load program segments: -22
[ 58.645251] remoteproc remoteproc0: Boot failed: -22

This "bad phdr" line is mentioned in Table 1 of the troubleshooting grid, but it's not clear to me what I need to do to fix it. I have noticed that sometimes it works and sometimes it doesn't, so I will need to hit the reset button and wait to reconnect a few times until I get it to work without the error, but I don't have a repeatable way to actually fix the problem. 

Is there something I can do to fix this issue more reliably? I am just using the project as imported from STM32CubeMX with only minimal code changes made in the IDE. 

This is a different error than what I had posted about before, although the error message is similar. The guide I have been using is the same ST page as before, although some things look slightly different. I am on the most recent versions of STM32CubeIDE and STM32CubeMX for Linux (Ubuntu). 

3 REPLIES 3
shivam203
ST Employee

Hi @rdmikkelsen ,

I  work on windows but I can give you some steps to debug.
Please check the following.
1. Are you building example for CM33 or CM0+? Because your log shows "Powering up CM0".

2. These logs means
[ 58.546876] remoteproc remoteproc0: powering up m0
[ 58.628708] remoteproc remoteproc0: Booting fw image Project_Name_CM33.elf, size 3097880
[ 58.631958] remoteproc remoteproc0: bad phdr da 0x80100000 mem 0x540
[ 58.638236] remoteproc remoteproc0: Failed to load program segments: -22
[ 58.645251] remoteproc remoteproc0: Boot failed: -22

You are loading at the wrong core.
Please check whether you flashed correct image or not.
                                                                                                                                                                                
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.

Hello, 

Thank you for taking a look at this. I have the project set up to use CM33, so it seems odd that sometimes it would use CM0. Is there a place I need to specify this in the project or debug settings so it doesn't change?

Please check you .tsv file.. there are chances that you are using wrong .tsv.
For ex:) I usually use FlashLayout_sdcard_stm32mp257f-dk-ca35tdcid-ostl-m33-examples-optee.tsv for CM33 related work.

                                                                                                                                                                                
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.