I'll review the documentation, but I am posting this while I do so:
You are correct, the CONTEXT is a struct.
I wasn't entirely clear. It doesn't fail ON the cast, but when I call a function passing that pointer.
here is the rest of that function:
...
CONTEXT *pLinkContext = (CONTEXT *)pContext;
/* Initialize context */
pLinkContext->retryCount = 0;
pLinkContext->pTxDescriptor = pTxDescriptor;
/* Call function to send variable frame */
_sendVariableFrame(pLinkContext);
}
It goes into the misalign when it goes into _sendVariableFrame.
I cheated a bit to get it to work by changing the function declaration to only accept CONTEXT * instead of void * and this solved the problem and I have not seen a problem with this yet, but the change does scare me a little bit.