Can't make a delay inside a task

i am a new learner and i am using freeRTOS on ATmega32 to just flash 1 LED, I read many topics on this forum and other websites and my code is just the same but still doesn’t work correctly, it’s cause the led to stay on forever without flashing, can you help me?

#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>

#include "FreeRTOS.h"
#include "task.h"
#include "croutine.h"
#include "FreeRTOSConfig.h"
#include "semphr.h"
#include <avr/interrupt.h>

/* Define all the tasks */
static void ledBlinkingtask1(void* pvParameters);

int main(void) {
	/* Call FreeRTOS APIs to create tasks, all tasks has the same priority "1" with the
	same stack size*/
	xTaskCreate( ledBlinkingtask1,"LED1",

	// Start the RTOS kernel
	/* Do nothing here and just run infinite loop */	
	return 0;

static void ledBlinkingtask1(void* pvParameters){
	while (1)
      // LED on
      PORTB = 1;

      // LED off
      PORTB = 0;


Are you sure the writes to the PORTB are running the LED on and off as you expect? You can try that by just using those lines of code from main().

Is the first task starting? You can know that by setting a break point in the code to see if it is ever hit.

If you stop the code on the debugger, where is it? What is it doing?

Is you tick interrupt working? You can know that by setting a break point in xTaskIncrementTick() in FreeRTOS/Source/tasks.c, or otherwise viewing the xTickCount variable in the debugger.

after working through your advice:
portB works fine
the first task starting, but the problem is in first
it just doesn’t work, when the debugger reaches this statement it stops and debugger button goes all grey out except for reset button that’s why it keeps on and never go to the off statement.
vTaskDelay() is the problem I don’t know why I just used it as in the freertos book examples
regarding the xTaskIncrementTick() …the debugger never reaches it too…it greys out before stopping at the break point

It is going to be tricky unless you can get the debugger working. Can you step into the vTaskDelay() function to see where it gets to? I suspect it will execute all the way to the point where it attempts to yield to another task. If not, it might just execute until the tick interrupt occurs. If we can determine which it will give us a clue as to what to look at next.

There is a description of how context switches operate on AVR parts here

Also, have you done things like check for stack overflows? This page points to that and other useful debugging ideas: