Skip to main content
Associate II
August 19, 2024
Solved

Endless Loop when running SCB_EnableDCache()

  • August 19, 2024
  • 23 replies
  • 4463 views

I'm using stm32H750B-DK and i'm trying to send a frame via LIN protocole every one second .
but when i run the code nothing happen .
when debugging i found that the code blocked in an endless loop in SCB_EnableDCache() function 

This topic has been closed for replies.
Best answer by mƎALLEm

Thank you for sharing your project but I didn't reproduce the issue and the application passed SCB_EnableDCache() step and I see this screen (stepped over SCB_EnableDCache():(

image001.png

Your project is running well in debug and in standalone.

Try maybe to use the latest tools CubeMx/CubeIDE and clean/rebuild your project.

 

23 replies

mƎALLEm
ST Technical Moderator
August 19, 2024

Hello @Oussama_Baklouti and welcome to the community.

Where did you call SCB_EnableDCache()? before MPU config? if yes, need to move the call after the MPU config.

Could you please share your code?  you attached a rar containing only .cprojet file!

Please attach your complete projet.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Associate II
August 19, 2024

MPU config is called before SCB_EnableDCache
this .rar contain the hole project 

mƎALLEm
mƎALLEmBest answer
ST Technical Moderator
August 19, 2024

Thank you for sharing your project but I didn't reproduce the issue and the application passed SCB_EnableDCache() step and I see this screen (stepped over SCB_EnableDCache():(

image001.png

Your project is running well in debug and in standalone.

Try maybe to use the latest tools CubeMx/CubeIDE and clean/rebuild your project.

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
TDK
August 19, 2024

> MPU config is called before SCB_EnableDCache

So move it afterwards as @mƎALLEm suggested.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II
August 19, 2024

Does the frame was sent ?

 

 

mƎALLEm
ST Technical Moderator
August 19, 2024

Which frame?

Your problem was: "when debugging i found that the code blocked in an endless loop in SCB_EnableDCache() function"

So the issue was that your application was not even passing the first two lines in the main.

Did you already solve that issue or not? or it's a new one? if yes please close that thread and create a new one with a new description.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Associate II
August 20, 2024

The problem isn't solved ,the code blocked in an endless loop in SCB_EnableDCache() function .And while debugging this is what happen 

Associate II
August 20, 2024

Yes , i'm using the latest version of CubeMx/CubeIDE.
Could the problem be in the board ?

 

mƎALLEm
ST Technical Moderator
August 20, 2024
Could the problem be in the board ?

 

You need to confirm that with another board. 

Did you run a very simple code for example toggling a LED with this board?

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Associate II
August 20, 2024

i tried toggling a LED and it worked fine and when debugging  the SCB_EnableDCache()  take a lot of time so i stepped into the function and debugg it manually and it worked . But when i connected a logic analyzer to see if the frame of the LIN protocole was transmitted there is nothing 

Associate II
August 20, 2024

I created a new project and i called the SCB_EnableDCache() function 
and when i runned the code , the toggle works fine but when i debugg the SCB_EnableDCache() function takes a lot of time running . So when i stepped into the SCB_EnableDCache() function i found that it is working and decrementing its values but i didn't know why it takes a lot of time when debugging ?

 

mƎALLEm
ST Technical Moderator
August 21, 2024

So when i stepped into the SCB_EnableDCache() function i found that it is working and decrementing its values but i didn't know why it takes a lot of time when debugging ?

 


Why are you stepping into SCB_EnableDCache()? 

When you are in standalone mode (not in debug) are the two applications (toggling the LED and TouchGFX) are running without any stuck?

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Associate II
August 21, 2024

Yes,the two applications (toggling the LED and TouchGFX) are running without any stuck . 
but in the first project i send to you there a LIN code to send a frame that didin't work .
That's the main issue 

 

mƎALLEm
ST Technical Moderator
August 21, 2024

You didn't answer my question: Why are you stepping into SCB_EnableDCache()? There is no need for that. You need just to step over it (F6) not into it. And as I said your project is working well from my side.

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Associate II
August 21, 2024

When i step over it , it takes a lot of time running so i stepped into it to see what is the problem .

mƎALLEm
ST Technical Moderator
August 21, 2024

I didn't reproduce your behavior from my side by stepping over SCB_EnableDCache(). Do you have another board to do the same test?

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Associate II
August 21, 2024

No i don't But like i said toggling the led and TouchGFX are working fine .
But toggling the led didn't work unless i created a task and not in the while loop 

Associate II
August 22, 2024

There is no data sent from the touchGFX .But when i used the stlink port to send it worked but when i use the Arduino connectors TX/RX it didn't work 

 

mƎALLEm
ST Technical Moderator
August 22, 2024

This is a TouchGFX issue not related to the original question "endless loop in SCB_EnableDCache()".

You already created this new thread regarding this question: https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/problem-while-sending-a-lin-frame-from-touchgfx/td-p/711283

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.