Microcontroller restarts at boot time when I activate the configUSE_TASK_FPU_SUPPORT

To save the FPU context, I set configUSE_TASK_FPU_SUPPORT to 1 in the FreeRTOS configuration (I am using the latest version of FreeRTOS). The problem is that when I enable configUSE_TASK_FPU_SUPPORT, the microcontroller reboots at boot time. The problem seems to occur when I activate more than one timer (I have 2 tasks that use a timer: if I activate only one task, there is no problem). The problem occurs even if the portTASK_USES_FLOATING_POINT() function is never called. I use microchip PIC32MZ2048EFM100.

When I enable configUSE_TASK_FPU_SUPPORT, I set configISR_STACK_SIZE to 1400 (instead of 400) and I checked values of configKERNEL_INTERRUPT_PRIORITY and configMAX_SYSCALL_INTERRUPT_PRIORITY

If I disable all C code and enable ASM code, problem occure… I don’t undestand because in this configuration, there isn’t task/interrupt. Structure of my .S files is :

//Dependencies
#include <xc.h>
#include <sys/asm.h>
#include "FreeRTOSConfig.h"
#include "isr_support.h"

#define APPx_TIMER_VECTOR    _TIMER_xxx_VECTOR

.extern  appXTimerIrqHandler
.global appXTimerIrqWrapper

   
// Ensure correct instructions is used
.set  nomips16
.set  nomicromips
.set  noreorder
.set  noat

#if (APPx_TIMER_VECTOR == _CORE_TIMER_VECTOR)
    .equ     __vector_dispatch_0, appXTimerIrqWrapper
    .global  __vector_dispatch_0
    .section .vector_0, code, keep
#elif (APPx_TIMER_VECTOR == _TIMER_1_VECTOR)
    .equ     __vector_dispatch_4, appXTimerIrqWrapper
    .global  __vector_dispatch_4
    .section .vector_4, code, keep
#elif (APPx_TIMER_VECTOR == _TIMER_2_VECTOR)
    .equ     __vector_dispatch_9, appXTimerIrqWrapper
    .global  __vector_dispatch_9
    .section .vector_9, code, keep
#elif (APPx_TIMER_VECTOR == _TIMER_3_VECTOR)
    .equ     __vector_dispatch_14, appXTimerIrqWrapper
    .global  __vector_dispatch_14
    .section .vector_14, code, keep
#elif (APPx_TIMER_VECTOR == _TIMER_4_VECTOR)
    .equ     __vector_dispatch_19, appXTimerIrqWrapper
    .global  __vector_dispatch_19
    .section .vector_19, code, keep
#elif (APPx_TIMER_VECTOR == _TIMER_5_VECTOR)
    .equ     __vector_dispatch_24, appXTimerIrqWrapper
    .global  __vector_dispatch_24
    .section .vector_24, code, keep
#elif (APPx_TIMER_VECTOR == _TIMER_6_VECTOR)
    .equ     __vector_dispatch_28, appXTimerIrqWrapper
    .global  __vector_dispatch_28
    .section .vector_28, code, keep
#elif (APPx_TIMER_VECTOR == _TIMER_7_VECTOR)
    .equ     __vector_dispatch_32, appXTimerIrqWrapper
    .global  __vector_dispatch_32
    .section .vector_32, code, keep
#elif (APPx_TIMER_VECTOR == _TIMER_8_VECTOR)
    .equ     __vector_dispatch_36, appXTimerIrqWrapper
    .global  __vector_dispatch_36
    .section .vector_36, code, keep
#elif (APPx_TIMER_VECTOR == _TIMER_9_VECTOR)
    .equ     __vector_dispatch_40, appXTimerIrqWrapper
    .global  __vector_dispatch_40
    .section .vector_40, code, keep
#endif
    
    
.ent appXTimerIrqWrapper

//timer interrupt
appXTimerIrqWrapper:
    //Save the current task context
    portSAVE_CONTEXT
    //Call interrupt handler
    jal appXTimerIrqHandler
    nop
    //Restore the context of the next task to execute
    portRESTORE_CONTEXT

    .end appXTimerIrqWrapper

To build my project with this configuration, I create empty IRQ handler functions :

void __attribute__( (interrupt(IPLxxxAUTO), vector(_TIMER_xxx_VECTOR))) appXTimerIrqHandler( void );

void appXTimerIrqHandler(void){}

What could be the reason (why isn’t there problem when configUSE_TASK_FPU_SUPPORT = 0 ?) ?

Could this just be a stack overflow? Do you have configCHECK_FOR_STACK_OVERFLOW set to 2? Do you have configASSERT() defined? See https://freertos.org/FAQHelp.html. Also, are you using the correct compiler options to use the floating point unit?

Yes,
configCHECK_FOR_STACK_OVERFLOW is set to 2
and #define configASSERT(x) if((x) == 0){taskDISABLE_INTERRUPTS(); for( ;; );}

I don’t know If I’m using correct compiler option but floating point libraries are enabled… If I disable those libraries in IDE configuration, I have build errors

Does this mean it works if you use the assembly file entry point for the ISRs? Or that it doesn’t work with either? The assembly entry points allow interrupts to nest, which could be a clue as you say it works if there is only one time - only one timer means there is nothing to nest.

It doesn’t work if I build my project with assembly files and I don’t activate interrupts for this elements.
All interrupts have a different subpriority.
I don’t know how to fix if it is a nest problem

Did this work for you or are you still facing this problem? Where did you get the FreeRTOS port from? Can you share a sample project to help us repro it?