Does not work task

Hello everyone,

I work with FreeRTOSV9 for the STM32 family.
I added the code to display the message on the screen. The task itself compiles without errors, but the message is not displayed on the screen. I took a ready-made project and forged it under my STM32F103C4.

Please find below the code that I used :
main.c

   #include <stdint.h>
#include "FreeRTOSConfig.h"
#include "FreeRTOS.h"
#include "projdefs.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"

  // MMC module connections
sbit Mmc_Chip_Select           at GPIOA_ODR.B1;
// eof MMC module connections

unsigned long GLCD_DataPort_Input  at GPIOB_IDR;
unsigned long GLCD_DataPort_Output at GPIOB_ODR;

sbit GLCD_CS1           at GPIOB_ODR.B10;
sbit GLCD_CS2           at GPIOB_ODR.B11;
sbit GLCD_RS            at GPIOB_ODR.B12;
sbit GLCD_RW            at GPIOB_ODR.B13;
sbit GLCD_EN            at GPIOB_ODR.B15;
sbit GLCD_RST           at GPIOB_ODR.B8;

     void messageTask(void *pvParameters);
               
  void UART1_Write_Line(char *uart_text) {
  UART1_Write_Text(uart_text);
  UART1_Write(13);
  UART1_Write(10);
}

// Main function, which creates the tasks and starts the scheduler.
void main()
{
  xTaskCreate(
    (TaskFunction_t)messageTask,
    "Message Task",
    configMINIMAL_STACK_SIZE,
    NULL,
    10,
    NULL
);
 vTaskStartScheduler();

// Will never reach here.
while (1);
}

   void MessedgeTask(void *pvParameters)
{
 Glcd_Fill(0x00);
 GPIO_Digital_Output(&GPIOB_BASE, _GPIO_PINMASK_ALL);
Glcd_Write_Text("STM32F103C44", 5, 7, 2);
vTaskDelay(500);
}
}

FreeRTOSConfig.h

    #ifndef FREERTOS_CONFIG_H
    #define FREERTOS_CONFIG_H

    #define configUSE_PREEMPTION            1
    #define configUSE_IDLE_HOOK             0
    #define configUSE_TICK_HOOK             0
    #define configCPU_CLOCK_HZ              Clock_kHz() * 1000
    #define configTICK_RATE_HZ              ((TickType_t)1000)
    #define configSYSTICK_USE_CORE_CLOCK    1
    #define configSYSTICK_CLOCK_DIVIDER     1
    #define configSYSTICK_CLOCK_HZ                                                 \
        ((configCPU_CLOCK_HZ)/configSYSTICK_CLOCK_DIVIDER)
    #define configMAX_PRIORITIES            (16)
    #define configMINIMAL_STACK_SIZE        ((uint8_t)128)
    #define configTOTAL_HEAP_SIZE            ( ( size_t ) ( 5 * 1024 ) )
    #define configMAX_TASK_NAME_LEN         (16)
    #define configUSE_TRACE_FACILITY        0
    #define configUSE_16_BIT_TICKS          0
    #define configIDLE_SHOULD_YIELD         1

    #define configUSE_CO_ROUTINES           0
    #define configMAX_CO_ROUTINE_PRIORITIES (2)

    #define configUSE_MUTEXES                    1
    #define configUSE_COUNTING_SEMAPHORES        1
    #define configUSE_ALTERNATIVE_API            0
    #define configCHECK_FOR_STACK_OVERFLOW       0
    #define configUSE_RECURSIVE_MUTEXES          1
    #define configQUEUE_REGISTRY_SIZE            0
    #define configGENERATE_RUN_TIME_STATS        0

    #define INCLUDE_vTaskPrioritySet             1
    #define INCLUDE_uxTaskPriorityGet            1
    #define INCLUDE_vTaskDelete                  1
    #define INCLUDE_vTaskCleanUpResources        0
    #define INCLUDE_vTaskSuspend                 1
    #define INCLUDE_vTaskDelayUntil              1
    #define INCLUDE_vTaskDelay                   1

` #define configUSE_STATS_FORMATTING_FUNCTIONS        1`

    // This is the raw value as per the Cortex-M3 NVIC.
    // Values can be 255 (lowest) to 0 (1?) (highest).
    #define configKERNEL_INTERRUPT_PRIORITY             0xFF
    // !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
    // See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html.
    // Equivalent to 0xb0, or priority 11.
    #define configMAX_SYSCALL_INTERRUPT_PRIORITY        0x10

    // Normal assert() mechanics without relying on assert.h header file.
    #define configASSERT( x )                                                      \
        if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); while( 1 ); }

    #endif // FREERTOS_CONFIG_H

Thank you in advance for your help.

Do you have a debugger attached to find out why the task is not running ?
Then just halt the target and check if the program stopped due to configASSERT and what the call stack is (to get an idea what’s wrong with the calling code).
Also I strongly recommend to enable stack overflow checking for development/debugging besides defining configASSERT.

Using configMINIMAL_STACK_SIZE for a task is often not sufficient causing a stack overflow and any kind of problem.

Hello,

Isn’t this second curly bracket unnecessary?
It might not be the problem but it’s something to look at…