[softwarelist] Re: DPScan + ARMini -> crash?

  • From: Jeremy Nicoll - zf freelists <jn.fr.lsts.74@xxxxxxxxxxxxxxxxxxxx>
  • To: davidpilling@xxxxxxxxxxxxx
  • Date: Fri, 8 Jul 2011 18:41:46 +0100

David Pilling <flist@xxxxxxxxxxxxxxxxxxx> wrote:

> The crash occurs with the program counter pointing at the last 
> instruction below:
> 
> ADD     R13,R13,#4
> LDR     R6,&0008FB24
> LDR     R5,&00090490
> CMP     R0,#0
> BLT     &00090480

Ah! A BLT - must be a fatal sandwich error!  Misaligned filling?

> From this we deduce that code executing 8 bytes back was what caused the 
> address exception.

Are there any times when that's not true (it's ages since I read anything
about ARM assembler).  ISTR it's something to do with pipelining in the CPU?
 Might that work differently in the ARMini's processor?

> We know that the LDR R6 executed correctly from the register dump and
> being able to read off the contents of the location it is loading from.
> (Thanks Martin for this).

So the LDR R5... is the instruction being executed?   If you put these two
LDR instructions in the opposite order does the crash happen 4 bytes earlier
(as you'd expect if the instruction itself or the address it references is
the problem)?


 
> Both the LDRs are loading words from memory addresses in the program's 
> RunImage - good legal memory addresses.
> 
> This code is executed in the main poll loop, so before the crash it has 
> been executed 100's of times. From dumping the program's memory we know 
> that the code has not been corrupted.
> 
> There is the external change theory, the memory has been paged out or 
> read protected - seems unlikely unless the ARMmini has a 1K page size.

Why 1K?

To me, the thing that's striking about the memory locations in these two
instructions is that the LDR R6 refers to address &0008FB24 (just a bit less
than &8FFFF) whereas the LDR R5 has &00090490, which is just a bit higher in
memory?  Any multiple of &10000 is a 64K boundary so presumably a 1K, 2K,
4K, 8K, 16K... or 64K page size boundary could be relevant? 

 
> An interrupt/software event? would have to be one that was fine tuned to 
> take place after a save.
> 
> I am inclined to revert to crude debugging techniques, plaster the code 
> with printf's and see what happens.

Would using !Reporter's SWIs be friendlier? 

-- 
Jeremy C B Nicoll - my opinions are my own
To unsubscribe or subscribe goto: //www.freelists.org/list/davidpilling

Other related posts: