Using WDEBUG with MCF5235

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

Using WDEBUG with MCF5235

511 Views
Ahlan
Contributor III

Hi,

 

I am try to generate an interrupt when a particular area of memory is written to.

The debug  support feature of the MCF5235 seems simple enough as described in chapter 32 of the RM

however I can't get it to work.

Perhaps I have misunderstood or missed something.

I would greatly appreciate if someone who uses this feature can tell me what I am doing wrong.

 

I set the debug control registers using the WDEBUG (A1) command where A1 contains the address of  64 bit long word aligned record. The first 16 bits contain 0x2C80 plus the register number and the next two 16 bit words contain the MSW and the LSW of the value to be written to the register.

 

In my code I first set the TDR to zero.

Then set ABLR to the start address of the block of memory to be watched

and the ABHR to the last address.

I then set TDR to 0x8000_2008 (EBL, EAR first level trigger and TRC=10 - Debug interrupt.

 

When I write into the memory area covered by ABLR/ABHR nothing happens.

 

Has anyone any ideas what i am doing wrong?

 

Best wishes,

Ahlan

Labels (1)
0 Kudos
2 Replies

320 Views
TomE
Specialist II

> Has anyone any ideas what i am doing wrong?

 

Not immediately. We use wdebug on our MCF5329 to set CSR[PCD] to disable the clock pin and that works for us.

 

Make sure you're not trying to test this with the debugger connected as it may have set CSR[IPW].

 

See if you can find the simplest thing you can do with wdebug that can be seen "externally". I'd suggest setting CSR[NPL] and see if the CPU slows down.

 

Then try setting a program counter breakpoint as it may be simpler.

 

I think you've missed setting TDR[EBL] the Global Enable. I think you also have to set PBMR if you don't want to match the data bus as well.

 

Tom

 

 

 

0 Kudos

320 Views
Ahlan
Contributor III

Dear Tom,

 

MCF5235 hasn't got a CSR[IPW] but you gave me a good tip that I should try setting the PC breakpoint.

When this worked it gave me confidence that I what I was doing was fundamentally correct.

My problem was that I forgot to set the AATR register.

This isn't required for PC breakpoints but is required to stop on memory writes becuase

the default is longword supervisor reads.

 

Best Wishes,

Ahlan

0 Kudos