diff --git a/portable/MPLAB/PIC32MX/port.c b/portable/MPLAB/PIC32MX/port.c index fa5c3d414..386b98b0f 100644 --- a/portable/MPLAB/PIC32MX/port.c +++ b/portable/MPLAB/PIC32MX/port.c @@ -159,7 +159,9 @@ const StackType_t * const xISRStackTop = &( xISRStack[ ( configISR_STACK_SIZE & */ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) { - /* Ensure byte alignment is maintained when leaving this function. */ + /* Ensure 8 byte alignment is maintained when the context is popped from + * stack. The size of the context is 33 words (132 bytes). */ + pxTopOfStack--; pxTopOfStack--; *pxTopOfStack = (StackType_t) 0xDEADBEEF;