This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F: GAP_RegisterForMsgs results in reset to main

Part Number: CC2640R2F


I have a custom project that is heavily based on the simple_peripheral example provided in version 1_50_00_58 of the SDK.  I am currently trying to move it across to version 2_40_00_32 and have followed the migration guides to get it to successfully build.  I have replaced all references to the previous stack version with the new version and have replaced the old stack project with the stack project from the new simple_peripheral example.

When my RTOS task starts up and I call GAP_RegisterForMsgs(), something is causing my code to jump back to main. I've tried to look at the software interrupts using the TI-RTOS plugin for IAR and it appears that the data is being trashed.  This is happening every time I try to run the code.

The problem appears to occur inside ICALL_SYNC_HANDLE_PEND_WM(taskentry->syncHandle, timeout) on line 3651 of icall.c.  If I put a breakpoint here I can see it is called once before GAP_RegisterForMsgs is called, with no problem.  However, when it is called as a result of GAP_RegisterForMsgs I see the reset issue.

IAR also gives me the following error: "The processor has escalated a configurable-priority exception to Hard Fault.  An instruction executed with an invalid EPSR.T or EPSR.IT field".

Can someone give me a few pointers as to what might be causing this issue?  Have I missed something in the migration?