"User halted thread" with no brealpoint

cancel
Showing results for 
Search instead for 
Did you mean: 

"User halted thread" with no brealpoint

Jump to solution
493 Views
GaryOlmstead
Senior Contributor I

 

Hi --
I have an MCS908QE128 and CodeWarrior 11.1 and Multilink Universal FX.
Port A is set up to be keyboard inputs, KBI1, on bits 0-3.
Port B is set up to be KBI1 on bits 2 and 3.
This code had worked for a very long time.
Recently, it has started acting like there is a breakpoint set at the
line that reads PTAD, even though there has never been a breakpoint there.
Every time it reads KBI1, it stops on the line, and generates:

"Thread [ID:0x0](Suspended: Signal 'Halt' received. Description: User halted thread."

I was using the code that Processor Expert wrote. I thought it must be
some sort of residual artifact, which made no sense, but I was only
calling it from one place, so I rewrote it inline. No difference.
I selected Run >> Skip All Breakpoints. No difference.

Port B, bits 2 and 3 are also keyboard interrupts, and are read in the
same routine. The program has no problem reading PTBD correctly.

I'm out of ideas. Any clues or suggestions?

 

0 Kudos
1 Solution
426 Views
GaryOlmstead
Senior Contributor I

Hi Vincent --

You were right.  I deleted all the code for that port, and rewrote it.  It works as expected now.

Thanks for your help.

Gary

View solution in original post

0 Kudos
9 Replies
444 Views
GaryOlmstead
Senior Contributor I

Hi Vincent --

 

OK, I created a new project that just reads KBI1, and prints the result.  It works fine. 

 

Do you think the problem might be in the original KBI1 module, or is it someplace else, and just leaks out to the outside world via the KBI1 module?

0 Kudos
430 Views
vicentegomez
NXP TechSupport
NXP TechSupport

I believe that the problem was the project

 

Regards

0 Kudos
427 Views
GaryOlmstead
Senior Contributor I

Hi Vincent --

You were right.  I deleted all the code for that port, and rewrote it.  It works as expected now.

Thanks for your help.

Gary

0 Kudos
417 Views
GaryOlmstead
Senior Contributor I

Well, not so fast.  Deleting and rewriting KBI1.C and KBI1.h worked for about two minutes. 

Here is the code in question (generated by Processor Expert):

byte KBI1_GetVal(void)
{
byte value = 0x00U;
 value |= PTAD & 0x01U;
 value |= PTAD & 0x02U;
 value |= PTAD & 0x04U;
 value |= PTAD & 0x08U;
 value |= (byte)((PTBD & 0x04U) << 2);
 value |= (byte)((PTBD & 0x08U) << 2);
return value;
}

PTAD is at address zero.  If I change "PTAD" to anything else, such as "PTADD" (address 1) or "PTAB" (address 2), it works as expected.  If I leave it at PTAD, but select Run instead of Debug, it works perfectly.

 

This is some of the first code written for this project, and had been working perfectly until recently.  I'm using CW for MCU version 11.1, which doesn't appear to have been updated since 2018, so it's probably not new software.

0 Kudos
446 Views
GaryOlmstead
Senior Contributor I

I'll give it a try.

0 Kudos
461 Views
GaryOlmstead
Senior Contributor I

Hi Vincent --

 

No, It won't execute anything after that.  I have to exit the debug session and start over.

I don't know any more than that right now.  I will try to find any other references to Port A Data, and see what happens there.

0 Kudos
467 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Hi

 

After the "breakpoint"  does the code continues running? or you get a reset

Would it be possible for you give me more information

 

thanks

  

0 Kudos
459 Views
GaryOlmstead
Senior Contributor I

Hi Vincent--

 

I'm sorry, my last answer was wrong.  The program does continue if I select the Go button. 

 

The code looks like this (auto generated by Processor Expert):

byte KBI1_GetVal(void)
{
byte value = 0x00U;
value |= PTAD & 0x01U;
value |= PTAD & 0x02U;
value |= PTAD & 0x04U;
value |= PTAD & 0x08U;
value |= (byte)((PTBD & 0x04U) << 2);
value |= (byte)((PTBD & 0x08U) << 2);
return value;
}

The program halts at every line with PTAD in it. 

This is the only place in the program that refers to PTAD.

If I run the program instead of debugging it, it runs fine.

 

0 Kudos
453 Views
vicentegomez
NXP TechSupport
NXP TechSupport

Can you please create a new code on a new workspace 

Maybe there is a problem with your workspace

 

Regards

 

0 Kudos