Illegal address detect reset after USB cable connections

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

Illegal address detect reset after USB cable connections

941 Views
Rona
Contributor I

Hi

We are working with MCF51JM128

Most of the time we are in STOP3 mode, waking once a second or on external interrupt.

As soon as we connect the device to a USB cable ( connected to a PC ot to a charger) we enconter Illegal address detect reset.

We have cheked all our vectors / pointers etc, but we do not see any of them that are not initilized properly.

Does anyone have an Idea why?

Thanks

Labels (1)
0 Kudos
3 Replies

499 Views
TomE
Specialist II

Can you runit with a debugger and put a breakpoint on the Illegal Interrupt interrupt service routine? That should tell you where in the code it failed and what it was doing. Otherwise, can you write a service routine for that interrupt that prints out the registers and the stack?

 

If it fails when you simply plug it into a power supply, maybe there's a voltage spike causing it?

 

Or maybe plugging it in causes a hardware interrut you don't have a service routine for.

 

Tom

 

0 Kudos

499 Views
Rona
Contributor I

Thanks

We ran some tests and we see that we get multiple USB interrupts by just plugging the USB cable into the PC or the USB charger.

We do not have a USB interrupt which do not have a service interrupt routine, but we get so many of them, so we probably gets out of stack limits.

We see noise on the D+, D- lines that should not be there, especially while connecting to USB charger without any communication.

Maybe this fact can direct to the problem?

0 Kudos

499 Views
TomE
Specialist II

> but we get so many of them, so we probably gets out of stack limits.

 

Isn't it frustrating that the hardware doesn't support checking for stack limit overflow? After all the PDP11 (which was the inspiration for the 68000 which begat the ColdFire) had this back in 1970.

 

Add a function to check your stack limit. Call it from the start of every interrupt service routine.

 

"So many of them...". But an interrupt routine shouldn't be able to be called while in the same service routine. These things shouldn't be re-entrant, and certainly not on limited-RAM machines. Add some tests for reentrancy (Check for a flag on entry to the routine, THEN set it, and clear on exit - fail if already set or simply return).

 

> We see noise on the D+, D- lines that should not be there, especially while connecting to USB charger without any communication.

 

I would expect noise. You're making intermittent high-current connections down cables right next to the data wires in the cable. Make sure you have the required resistors on those lines, but expect noise. Check it on other devices (that can be plugged into a charger) and see what they're seeing.

 

0 Kudos