I have the same problem, I guess, when trying to give a semaphore from an interrupt.
If I then call portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); after the xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken )
the same problem occurs, this has however nothing to do with ADC default handlers, even though it points there initialy
you need to trap the Hardfault_Handler (place code in main.c)
void HardFault_Handler(void)
{
int systemControlBlock = SCB->HFSR; //should be 0x40000000 = FORCED hard fault, check CFSR
int configurableFaultStatusReg = SCB->CFSR; // xmc ref manual 2-75 (p.131)
__ASM volatile("BKPT #01"); // enter breakpoint
while(1);
}
there you can check the registers, and it is actualy an INVPC-Event which causes that Problem "Invalid PC load Usage Fault, caused by an invalid EXC_RETURN value"
I have no idea how to solve this however (XMC4500 HexagonKit AB-stepping). If I do not call portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); there is no problem, but it then only switches to the newly unblocked task with the next Systick, which is of course unacceptable in a realtime system.
If I then call portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); after the xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken )
the same problem occurs, this has however nothing to do with ADC default handlers, even though it points there initialy
you need to trap the Hardfault_Handler (place code in main.c)
Quote:
void HardFault_Handler(void)
{
int systemControlBlock = SCB->HFSR; //should be 0x40000000 = FORCED hard fault, check CFSR
int configurableFaultStatusReg = SCB->CFSR; // xmc ref manual 2-75 (p.131)
__ASM volatile("BKPT #01"); // enter breakpoint
while(1);
}
I have no idea how to solve this however (XMC4500 HexagonKit AB-stepping). If I do not call portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); there is no problem, but it then only switches to the newly unblocked task with the next Systick, which is of course unacceptable in a realtime system.