RT1176 CACHE issue

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

RT1176 CACHE issue

1,737 Views
zyz
Contributor I

Recently, I encountered a very strange phenomenon during the development process, as follows:

My code itself can run normally. When I update some algorithm code (pure algorithm, no underlying hardware is involved), the system cannot be started. When I using keil debugging,it is found that the code can only be executed to this line, 

zyz_0-1649681544740.png

and cannot be executed further down, and the IDE will report an error if executed further down,

          CPU could not be halted

          Can not read register xxx while CPU is running

         ...

This made me very depressed, I searched for a long time and couldn't find the problem. Later,
I tried to comment out the lines of code that enable ICACHE and DCACHE in the SystemInit function,

zyz_1-1649681599899.png

and the system run normally,but it was no problem before, this confuses me, can anyone tell me why this is

0 Kudos
10 Replies

1,733 Views
jay_heng
NXP Employee
NXP Employee

Which build target are you debugging? Internal RAM or XIP Flash or external RAM?

If it is XIP Flash target, try to lower flash boot speed in project source FDCB header and set IDE optimization level to none before debugging

0 Kudos

1,727 Views
zyz
Contributor I

Hi jay_heng,

Thanks for your reply, and the build target I am using is Internal RAM 

0 Kudos

1,725 Views
jay_heng
NXP Employee
NXP Employee

Internal RAM, ITCM for code and DTCM for data? no OCRAM used?

Is there any other HW peripheral involved?

basically, TCM is not effected by CACHE.

0 Kudos

1,721 Views
zyz
Contributor I

It's  OCRAM for code,other ram for data,and no task hardware peripherals involved

0 Kudos

1,700 Views
jay_heng
NXP Employee
NXP Employee

OCRAM is effected by CACHE, what is the MPU setting of OCRAM in your project?

0 Kudos

1,694 Views
zyz
Contributor I

Does it mean that I need to configure the MPU before enabling the cache? But the official SDK first enabled the cache in the startup code, and I had no problem with this before, was it my luck before?

0 Kudos

1,697 Views
zyz
Contributor I

The MPU is not configured at this point, the system crashes before I configure the MPU

0 Kudos

1,708 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Please use the ITCM for code and DTCM for data and give it a debug again.
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

1,705 Views
zyz
Contributor I

I think you may not understand what I want to ask, what I want to know is the deep-seated reason for this phenomenon, because this problem did not exist before, and my code volume is relatively large, and ITCM is not enough, I want to ask the why, rather than try something else

0 Kudos

1,650 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
I was wondering if you can illustrate the steps of modification for the demos (such as hello_world) in the SDK library to replicate the phenomenon, as it can help me to figure it out.
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