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,
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,
and the system run normally,but it was no problem before, this confuses me, can anyone tell me why this is
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
Hi jay_heng,
Thanks for your reply, and the build target I am using is Internal RAM
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.
It's OCRAM for code,other ram for data,and no task hardware peripherals involved
OCRAM is effected by CACHE, what is the MPU setting of OCRAM in your project?
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?
The MPU is not configured at this point, the system crashes before I configure the MPU
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.
-------------------------------------------------------------------------------
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
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.
-------------------------------------------------------------------------------