RT1064: SCB_DisableDCache gets stuck (IDE 11.4 / SDK 2.10)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT1064: SCB_DisableDCache gets stuck (IDE 11.4 / SDK 2.10)

Jump to solution
3,404 Views
steve_n
Contributor II

This is related to my last post but it deserves its own attention.

Running SCB_DisableDCache(); after turning on the cache (e.g. after BOARD_ConfigMPU()) causes it to get stuck in a loop for a loooong time (30 seconds +).

It seems to be this way on all optimization levels (I tried O0, O2, Og).

I created a new sdk project (I chose evkmimxrt1064_lpuart_edma_transfer) with sdk 2.10. Added

Should be easy to reproduce.

Labels (1)
0 Kudos
Reply
1 Solution
3,346 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your clarification.
I basically replicate the phenomenon, further, I see the @gusarambula promise he will escalate this to the SDK team.
So let us waiting for his response.
Have a great day.
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

6 Replies
3,366 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
According to your statement, I place two breakpoints just like the below figure shows.

jeremyzhou_0-1634096659893.png

jeremyzhou_1-1634096670501.png

I've not encountered the issue that the code will stick in SCB_DisableDCache(), even I change the hello_world's memory allocation, I use the SDRAM instead of SRAM_DTC as primary RAM.
The attachment is my demo code.
Have a great day.
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
3,354 Views
steve_n
Contributor II

Yes, using a break point after the SCB_DisableDCache() will have no issues.

You must use the Step Over function. Don't set any breakpoints and step over each function, when you step over SCB_DisableDCache() it will get stuck. Hopefully you will see the same.

I downloaded your code and did re-create it, with LinkServer and PE Micro Multilink FX.

0 Kudos
Reply
3,347 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your clarification.
I basically replicate the phenomenon, further, I see the @gusarambula promise he will escalate this to the SDK team.
So let us waiting for his response.
Have a great day.
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

3,308 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Jeremy and Steve_n!

Sure! I have added this to the escalation opened from the post below (I'm adding a link to it as reference)

https://community.nxp.com/t5/i-MX-RT/GCC-Optimization-Level-broken-by-core-cm7-h-in-SDK-2-10/td-p/13...

Both are at least indirectly related to the workaround for the issue mentioned at https://github.com/ARM-software/CMSIS_5/issues/620 so I think it does make sense to escalate them together.

Regards,
Gustavo

3,400 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
According to your statement, whether you mean code executing
performance will slow down after running SCB_DisableDCache().
Have a great day.
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
3,388 Views
steve_n
Contributor II

Sorry for the poor description. Let me clarify. The actual function call SCB_DisableDCache(); is the problem. Stepping over SCB_DisableDCache() takes about 2 minutes to complete.

To recreate: use mcuXpresso 11.4 with SDK 2.10.0 with MIMXRT1064xxxA. Create a new hello_world SDK project for the MIMXRT1064-EVK.

Add SCB_DisableDCache(); before the printf line. Debug the project and step over each line. Stepping over SCB_DisableDCache(); will take 2 minutes.

Here is an example of the code:

int main(void)
{
    char ch;

    /* Init board hardware. */
    BOARD_ConfigMPU();
    BOARD_InitBootPins();
    BOARD_InitBootClocks();
    BOARD_InitDebugConsole();
    
    /* stepping over SCB_DisableDCache takes 2 minutes! */
    SCB_DisableDCache();

    PRINTF("hello world.\r\n");

    while (1)
    {
        ch = GETCHAR();
        PUTCHAR(ch);
    }
}

 

This issue is discussed at https://github.com/ARM-software/CMSIS_5/issues/620

On line 2322 of core_cm7.h of SDK 2.10, it appears an attempt is being made to overcome this issue, but it doesn't seem to work.

Additionally, due to the issue I describe in this post ( https://community.nxp.com/t5/i-MX-RT/GCC-Optimization-Level-broken-by-core-cm7-h-in-SDK-2-10/m-p/135... ) the GCC Optimization levels are broken on all SDK 2.10 that uses core_cm7.h