I agree with edwards3 diagnosis in post 2. Did you check that? You can do by either setting a break point in the tick interrupt or simply letting the program run for a while then inspecting the xTickCount variable in FreeRTOS/Source/tasks.c
I think the tick interrupt is set correctly, I put an applicationtickhook handler and discovered strange behavior, I entered only one time in vapplicationtickhook or if I follow correctly I should enter each tick time ?
void vApplicationTickHook( void )
{
ul++;
if (ul == 2) {PORTDbits.RD2 = 1;} // ul == 1 yes greater never
I discovered strange things the init of tick timer int is done correctly as this : __attribute__(( weak )) void vApplicationSetupTickTimerInterrupt( void )
{
const unsigned long ulCompareMatch = ( ( configCPU_CLOCK_HZ / portTIMER_PRESCALE ) / configTICK_RATE_HZ ) - 1;
if the tick hook is hit once then the interrupt install must be ok and clearing the interrupt or peripheral seems to be the cause. it can be that the config bits get set in the IDE not the source code, check your project to see which. normally projects should not need any changes to run.
I’m not sure which is the latest, but using V1.80 I have just taken a clean download, opened the PIC24 project, set the debugger to use the simulator, built and started a debug session. The result is that - without having made any changes other than setting the debugger to use the simulator - the timer’s interrupt service routine is being hit and the tick count is being incremented.
Many thanks to all for you support I finally solved my problem and I wanted to share the solution with you, after hours and hours of searching I came to the conclusion that the Interrupt was never called due to some bad information during linking.
I have to precise that I am not using same pic of FreeRtos demo which is P24FJ128GA010, my pic with my own hardware is P24FJ256GA106, so when importing in MPALB X version 1.85 the whole demo I was oblige to tell the linker that GLD file is different and I imported the one provided in microchip library BUT this file is wrong it has bad entry for IVT and alternate IVT, I finally decided to copy and paste all the IVT and alt IVT section from freertos demo and the Interrupt is now working…
I did not contacted yet Microchip for this problem.