Nuvoton M481SE8AE (Cortex M4F)

Hello everyone who read this.

I wanna use 2 hardware timers of MCU to my specifical purpose thru interrupts
Today i succeseful compiled build thru arm-none-eabi-gcc
But when i run my code on MCU only 2 hardware timers (TIMER1 and TIMER2, not TIMER0) works well.

xTaskCreate(check_disp_update, "routine", 4096, NULL, 3, NULL );
xTaskCreate(RTOS_Test, "test", 2048, NULL, 3, NULL);

I Created tasks and even run


Not even one tasks have been exectuted

So, question is: Can i use this timers in my own interrupt routine, or it someway hurts OS?

Did you define configASSERT and enable stack checking for development ?
This usually helps a lot to find out and fix initial issues running a FreeRTOS application.
Which FreeRTOS version and do you use ?
And do you know the valuable FreeRTOS FAQ - links to all RTOS FAQ pages ?

In FreeRTOSConfig.h yes, it’s defined

/* Normal assert() semantics without relying on the provision of an assert.h
header file. */
#define configASSERT( x ) if( ( x ) == 0UL ) { taskDISABLE_INTERRUPTS(); for( ;; ); }

Stack checking is

#define configCHECK_FOR_STACK_OVERFLOW			0
#define configMINIMAL_STACK_SIZE				( ( unsigned short ) 120 )

Ok. And is an assert being hit means when halting the target with the debugger do you end up in the configASSERT forever loop ?
If this is the case see the call stack in the debugger to find out where / which assert failed to find the problem. Which FreeRTOS version and which port (CM3 without using FPU or CM4F) do you use ?
Even though your stack sizes seem reasonable I’d propose to set

#define configCHECK_FOR_STACK_OVERFLOW			2

FreeRTOS and interrupts need to both be configured properly to work together.

First I’d consider executing the tasks without the hardware interrupts. The two tasks should work. If they do not, then you may have a bigger problem with how your tasks are written.

Then I’d take a look at your Timers interrupt priority as well as the configured SysTick and PendSV priorities (found here for the CM4F). If you’re expecting your hardware timer interrupt to fire and interrupt the FreeRTOS task running then you’ll need it to have a higher (logical) priority than the FreeRTOS SysTick and PendSV functions. In general you probably already have this.

Have you registered interrupt service routines (often called interrupt handlers) to go along with your interrupts?