FreeRTOS is not working for STM32F103

bejanissim wrote on Sunday, December 14, 2008:

Dear All,

First, i’m new to FreeRTOS.

I’m using the STM3210E-EVAL board and i tried using both FreeRTOSV5.1.0 and FreeRTOSV5.1.1 versions.

I use the relevant demo project (CORTEX_STM32F103_IAR).

It seems that demo application is not working. I believe that the scheduler is not  functioning as it should and that is why no task is running.

Can someone can help me please?

Thanks. 

davedoors wrote on Sunday, December 14, 2008:

This forum is here to help, but cannot do anything unless you provide enough information as to what your problem is.

You are not using the same hardware as the demo. Did you have to make any changes to take this into account?

How far does the demo get through the code? What happens then?

bejanissim wrote on Sunday, December 14, 2008:

Dear Dave,

First, let me thank you for your quick response.

As for the problem:
-------------------
I know i’m not using the same hardware but the STM32 uController is likley the same (there are minor differences which are not relevant for that matter).
I created a new project which is based on the demo one.

Through debuging the code i noticed the following:
--------------------------------------------------
vPortStartFirstTask() calls SVC to start the first task, but there is no code inside
SVCHandler ISR function. from this point the the system got stucked. No task is being handeled. I no this since i added breakpoint inside each task (basically i have 2 tasks besides the idle tasks).

attached the main function of my project:

int main(void)
{
  /* Initialize the JIG */
  JIG_SetupHardware();

  /* Create the queue used by the LCD task. 
     Messages for display on the LCD are received via this queue. */
  psLCDQueue = xQueueCreate(LCD_QUEUE_SIZE, sizeof(LCD_MESSAGE));
 
  /* Create the queue used by the Menu Managment task. 
     Messages for Menu Managment are received via this queue. */
  psKeyQueue = xQueueCreate(KEY_QUEUE_SIZE, sizeof(u8));
   
  /* Create a new task and add it to the list of tasks that are ready to run. */
xTaskCreate(LCD_Task,"LCD",configMINIMAL_STACK_SIZE,NULL,tskIDLE_PRIORITY,NULL);
xTaskCreate(MENU_MNG_Task,"MENU_MNG",configMINIMAL_STACK_SIZE,NULL,tskIDLE_PRIORITY,NULL);

  /* Start the scheduler. */
  vTaskStartScheduler();
 
  /* Will only get here if there was not enough heap space to create the idle task. */
  return 0;
}

Hope it halped.
Nissim.

rtel wrote on Sunday, December 14, 2008:

You need to populate the SVC, PendSV and SysCall interrupt vectors.  Use the demo application vector table as a guide, or better still just use the demo application as a starting point.

Regards.

bejanissim wrote on Sunday, December 14, 2008:

Dear Richard,

I’m using the application vector table (stm32f10x_vector.c - version 1.1.2) but the problem
still occurs. Is there something else that i’m missing?

Thanks
Nissim.

rtel wrote on Sunday, December 14, 2008:

So this should have vPortSVCHandler() already installed.  When SVC is called you should go directly to whatever is installed in the SVC handler location, which should be vPortSVCHandler().  Where do you go if not there?

Are you moving the vector table, or keeping it at its default location of 0?

Regards.

stf12 wrote on Monday, December 15, 2008:

Dear All,

this summer I developed a "nothing doing" demo of FreeRTOS running on STM3210E-EVAL. In fact it is not a demo! It just runs the following single task:

:slight_smile:

void TheFirstTask(void* pvParameters)
{
  register int pippo = 0;
 
  for(;:wink: {
    vTaskDelay(500 / portTICK_RATE_MS);
   
    ++pippo;
  }
}

It is based on IAR v4.42 and FreeRTOS v4.4. If it should be useful I can send a copy via e-mail.

Regards,
Stefano

bejanissim wrote on Monday, December 15, 2008:

Dear Richard,

I had to make a few adjustments in the vector table file (stm32f10x_vector.c)
and it worked as expected.

Thank you for lighting my eyes.

Nissim.

vr_ec wrote on Thursday, January 08, 2009:

Dear Nissim.

Hi, I have as same problem with Propox MiniStm32F103VE. please You can say me that modifies let were in stm32f10x_vector.c

Best reagards.
Samuel

oscarherrera wrote on Wednesday, October 21, 2009:

I am encountering the same problem.  I am using Rowley CrossWorks, but I do not expect that matters. 
I have a call to vPortSVCHandler from with SVCHandler(), but after execution of the portable call I still land in the DebugMonitor() with the SVC interrupt bit set.  I have not messed with the vector table at all.  My expectation was that the portable call would clear the SVC interrupt.  Is this an incorrect expectation?   I am using the ST standard peripheral library v3.12 and FreeRTOS v5.3.1

edwards3 wrote on Thursday, October 22, 2009:

Copy the examples - they do not call vPortSVCHandler() from within another function.

oscarherrera wrote on Thursday, October 22, 2009:

Calling the portable handlers directly from the "startup.s" file was indeed the solution.  Thank you.

jblauser wrote on Thursday, May 02, 2013:

So if the STM32F103 - IAR does not support the STM3210E-EVAL board, which board does it support?