This application just creates a single task to blink an LED, the LED state must be changed every 2000ms.

Code Example:

#include "bsp.h"

/*Function to act as task*/
static void vTask( void *parameters );

int main( void )
{
    HAL_Init( );     /*Inicializamos la librería*/

    /*enable RTT and system view*/
    SEGGER_SYSVIEW_Conf( );
    SEGGER_SYSVIEW_Start( );

    /*register task using the function vTask with (128*4) bytes de stack, no parameters
    priority of 1 and no task handler registered*/
    xTaskCreate( vTask, "Task", 128u, NULL, 1u, NULL ); 

    vTaskStartScheduler( );  /*run the RTOS scheduler*/
    
    return 0u;
}

/*Simple task that intialize one pin as output and toggle the pin state every 2000ms*/
static void vTask( void *parameters )
{
    GPIO_InitTypeDef GPIO_InitStruct;                   /* GPIO PIN Handler */
    __HAL_RCC_GPIOC_CLK_ENABLE( );                      /* Enable the clock for the port C */

    GPIO_InitStruct.Mode  = GPIO_MODE_OUTPUT_PP;        /* Configure the Pin as output */
    GPIO_InitStruct.Pull  = GPIO_NOPULL;                /* Configure pin as no pull up - no pull down */
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;       /* Configure frequency of pin as High */
    GPIO_InitStruct.Pin   = GPIO_PIN_0;                 /* Configure PIN 0 */
    HAL_GPIO_Init( GPIOC, &GPIO_InitStruct );           /* Initialize the GPIO */

    for( ; ; )                                          /* Loop of Task */
    {
        HAL_GPIO_TogglePin( GPIOC, GPIO_PIN_0 );        /* change the state of pin 0, port c */
        HAL_Delay( 2000u );                             /* Delay of 2000ms */
    }
}

SystemView Output

Document

The timeline shows the task execution, observe that the task is only
interrupted by the systick which is in charge of change the context
each 1ms, but this case just a Task is registered executing again.
At the init the task change the LED status and execute the delay
of 2000ms, this blocks the task running.

When the time delay elapsed the task will execute again. Notice that
in the image the change is not perceptible because task is always
running.
When the delay finishes the LED status changes and executes a delay
of 2000ms blocking task again.