This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Overlay problem with interrupt (with NOOL set)

I have a overlay problem:
I've got one function who is called from main and from my interrupt service routine.
When the interrupt calls the function my local variables point to an indefinite adress. I have the problem however I deactivate overlaing.
My programm:

void main (void)
{
...
eventChannelPtr = XSDevice_GetEventChanByID( &XSIM_DeviceGroups, groupID, chanID)}
}

void task_1ms(void) interrupt 1	using 1
{
...
eventChannelPtr = XSDevice_GetEventChanByID( &XSIM_DeviceGroups, groupID, chanID);
}

tXSEvent_ChannelPtr XSDevice_GetEventChanByID( tXSDevice_DeviceEntry* deviceEntryPtr, tXS_Group groupID, tXS_Channel chanID)
{
  tXSEvent_SourcePtr eventSrcEntry;
  tXSEvent_ChannelPtr retVal;
  ...
  eventSrcEntry = &deviceEntryPtr->eventListPtr[groupID];
}
the eventSrcEntry is at D:0x01. Is the function called by interrupt the data at D:01 has changed and I get a pointer to anywhere.

Parents
  • Right here:

    void task_1ms(void) interrupt 1	using 1
    

    Your XSDevice_GetEventChanByID function uses the default register bank (register bank 0), but your interrupt function switches to register bank 1.

    Also, if you use register bank 1, make sure you place your stack at some other location than the default value, because the default value places the start of the stack at the same address as register bank 1.

Reply
  • Right here:

    void task_1ms(void) interrupt 1	using 1
    

    Your XSDevice_GetEventChanByID function uses the default register bank (register bank 0), but your interrupt function switches to register bank 1.

    Also, if you use register bank 1, make sure you place your stack at some other location than the default value, because the default value places the start of the stack at the same address as register bank 1.

Children