| 
     
      
      
      From: Matthias W. <mat...@we...> - 2018-02-22 09:53:18
      
     
   | 
On Donnerstag, 22. Februar 2018 10:29:46 CET Thomas Doerfler wrote:
> Am 22.02.2018 um 10:04 schrieb Matthias Welwarsky:
> > On Donnerstag, 22. Februar 2018 09:36:19 CET Thomas Doerfler wrote:
> >> Hi Matthias,
> >> 
> >> just a short note: It's the icache which bothers me, not the dcache...
> >> and therefore an i-cache invalidate would be sufficent.
> > 
> > Unfortunately not. The i-cache is on top of the d-cache, so to modify code
> > you need to clean&invalidate the d-cache to the point-of-unification
> > (which is RAM in our case), then modify the code, then invalidate the
> > i-cache
> 
> But does the JTAG/SWD IF really write into dcache? I thought the code
> modifications happen directly in RAM, so, at least for the breakpoint
> issue, syncing RAM with icache is sufficent (unless the CPU also tries
> to overwrite its own code... which is a rare issue, I guess).
Hmm, you might have a point there. There's some sample code in the ARM 
documentation for cache maintenance with self-modifying code which includes a 
d-cache clean for the affected range. But you're correct, since the memory 
access is directly to RAM and not touching the caches it's probably enough to 
invalidate the instruction cache (and the branch target buffer). I guess I'm 
too used to how things work on cortex-a.
> Anyway I understand, dcache must be synced with external RAM for debugging.
> 
> Another delicate thing I am not sure about: It's the famous open source
> "we". I germany, we often call it the nurse "we" ("we will get an
> medical injection now..."). Is there something I can do to get it
> properly integrated? I might change the openOCD code to sync the caches,
> but I am not quite sure whether my patch would be in an acceptable state
> for the project...
> 
> OTOH, I can definitively test solutions in our environment.
> 
> How can we proceed?
If you need a solution quickly, pay me :-)
But of course you can get involved yourself easily. Head over to the website 
(oh damn, it's down), or to #openocd on freenode.net and I can help you set up 
a gerrit account and also give you some hints towards how the solution could 
look like.
BR,
Matthias
> wkr,
> 
> Thomas.
 |