Task was not blocked immediately after call vTaskDelay

Hi,
Im trying to run FreeRtos on RL78/F14 (R5F10PPJ).
Almost everything working as I espected. But when i call vTaskDelay the Task is not blocked until the OS tick counter will not incremented.
I found this problem after I connected the osciloscope to toggled output.
Every call of task negating output. At the task i put counter incremented on every call. After increment to 1000 i put the breakpoint. In fact Ticks counter of Rtos works properly, but counter inside the task going too fast.

At the attachemnt is picture with almost 1 ms toggeling of output. even i dont know what part of code should i share, because this is realy basic code. Only 2 task with only vTaskDelay. FreeRtos was downloaded from this page. FreeRTOS Kernel V10.4.6.

This isn’t my first contac with FreeRtos, but i’v never got this kind of problem.

Hello @st4chuu,

Welcome to FreeRTOS-forum!

It is an interesting issue that you point to. If I understand correctly, when you call vTaskDelay, the code doesn’t stop running and continues to toggle the output. Is that correct?

Can you please share the code of the task? It would be helpful to us to understand what is happening and why.

Thanks,
Aniruddha

Yes, when i call vTaskDelay code still running until the tick of RTOS will increment. I mean when i call vPortTickISR from interupt. I see that vPortYield is never called at code.

static void vLED_2_Task( void *pvParameters )
{

		PM4_bit.no5=0;
		volatile uint32_t tempTick=0;
		volatile uint32_t counter=0;
		for( ;; )
		    {
			vTaskDelay(500);
			tempTick=xTaskGetTickCount()/500;
			P4_bit.no5=!P4_bit.no5;
			counter++;
			if(!(counter%10000))
			{

				NOP();
			}
		    }
}

tempTick is to check how many times the task should run, NOP() is only as a trap for a breakpoint.

I think that problem was solved. When i debugging i see that sometimes was called interrupt BRK (software interrupt) and when i call from this interrupt vPortYield at the same way like vPortTickISR from timer interupt, every thing working correctly.