Debug Session Unexpected Halts Execution

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

Debug Session Unexpected Halts Execution

Jump to solution
2,295 Views
jimfell
Contributor III

My CodeWarrior 10.2 project unexepectly halts execution when in a debug session.  The message I see in the Debug pane states, "Thread [ID: 0x0] (Suspended: Signal 'Halt' received.  Description: User halted thread.)"  I did not halt target execution, so I don't know what it's talking about.  It doesn't give me any other meaningful information.  I'm new to CodeWarrior/Eclipse, so there's probably something obvious that I'm overlooking.  My target code is running version 4.0.2 of the Freescale USB stack, if that makes any difference.

 

I've attached a few screen captures.  It seems to randomly halt in different locations.  Any insight or suggestions would be appreciated.  Thanks.

 

2675_2675.jpgcapture.jpg

 

2676_2676.jpgcapture2.jpg

 

2677_2677.jpgcapture3.jpg

 

2678_2678.jpgcapture4.jpg

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
1,125 Views
jimfell
Contributor III

I think that I've been able to resolve the problem.  It's a bit complicated, but it seems that I was doing several things incorrectly. Thanks again!

View solution in original post

0 Kudos
Reply
4 Replies
1,125 Views
BlackNight
NXP Employee
NXP Employee

Hello,

unfortunately your screenshots have been compressed/blurred to the point that they are not really readable any more.

Looks like your CPU has been halted, and that might have multiple reasons, including an access error.

You could try to enable loggin in the connection settings:

2679_2679.png

that way you get more information.

You find that setting in your Launch/Debug Configuration, then press 'Edit' on the Connection in the 'Main' tab.

Hope this helps,

Erich

0 Kudos
Reply
1,126 Views
jimfell
Contributor III

I think that I've been able to resolve the problem.  It's a bit complicated, but it seems that I was doing several things incorrectly. Thanks again!

0 Kudos
Reply
1,125 Views
jimfell
Contributor III

I've been able to narrow this problem down a bit.  It seems that the USB stack (as CDC) fails to transmit.  I've traced the problem to the USB_DCI_Validate_Param primitive:

static uint_8 USB_DCI_Validate_Param (
    uint_8 ep_num,     /* [IN] Endpoint Number */
    uint_8 direction,  /* [IN] Endpoint direction */
    boolean odd        /* [IN] Odd or even buffer */
)
{
    /* Get bdt index mapped to endpoint number-direction and odd/even buffer */
    uint_8 bdt_index = USB_DCI_Get_BDT_Index(ep_num, direction, odd);

    if((bdt_index  != INVALID_BDT_INDEX) &&
        (g_bdt_elem[TRANSFER_INDEX(bdt_index)].len ==
        (uint_16)UNINITIALISED_VAL))
    {  
        /* Incase length in bdt_elem is uninitialised return invalid index */
        bdt_index = INVALID_BDT_INDEX;
    }
    return bdt_index;
}

It fails when checking the index length:

(g_bdt_elem[TRANSFER_INDEX(bdt_index)].len ==
        (uint_16)UNINITIALISED_VAL)

... to return INVALID_BDT_INDEX.

Any insight you can provide would be appreciated.  Thanks.

0 Kudos
Reply
1,125 Views
jimfell
Contributor III

Hi Erich.  I enabled logging, per your suggestion.  Where do I find the additional debugging information?  Thanks.

0 Kudos
Reply