FreeRtos did not work on stm32f103 & iar compiler

mohamadpb wrote on Thursday, November 30, 2017:

Hello.i using iar compiler,stm32f1 microcontroller and SPL library,i made a project my self for FreeRtos
download files from this link:
https://sourceforge.net/projects/freertos/files/FreeRTOS/
FreeRTOSv9.0.0.exe (16.1 MB)
my code just print hi in serial
and LED didnt blink
i tried to print something in tasks
but didnt work :frowning:
this is my project
thanks
https://www.dropbox.com/s/kpp5xysnd7kj4ey/Project%20F1Freertos.rar?dl=0

rtel wrote on Friday, December 01, 2017:

Apologies for the delay in replying.

Are you saying that toggling LEDs is working from different tasks, but
not printing? How is the print implemented? Does it work when the RTOS
is not running? If you are printing to a UART or other such device, are
you protecting access using a mutex (or other mechanism) to ensure only
one task accesses it at a time?

mohamadpb wrote on Saturday, December 02, 2017:

Thanks for your reply Mr.Real Time Engineer
in my project
i just config USART and GPIO
and define some functions
like:

void Blink2(void *p){
  for(;;){
    
                GPIO_SetBits(GPIOC, GPIO_Pin_13);
                vTaskDelay(500);
                GPIO_ResetBits(GPIOC, GPIO_Pin_13);
                vTaskDelay(500);
  }
}

and
before call the vTaskStartScheduler function i just print this

  put_str(" hi\n");

its work.print hi successfully
but,nothing happens after print “hi”
i tried everything
i comment USART config comment put_str function
just a basic blink with one task
just this:

void Blink2(void *p){
  for(;;){
    
                GPIO_SetBits(GPIOC, GPIO_Pin_13);
                vTaskDelay(500);
                GPIO_ResetBits(GPIOC, GPIO_Pin_13);
                vTaskDelay(500);
  }
}
int main(void)
{
  System_Init();
  xTaskCreate(Blink2,(const char*) "Blinker",configMINIMAL_STACK_SIZE,NULL,1,( xTaskHandle * ) NULL);
  vTaskStartScheduler();
}

and inits…
also try print a character with USART DR Register
nothing.didnt work :frowning: