Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

FreeRTOS is not working for STM32F103

Posted by Beja Nissim on 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.



RE: FreeRTOS is not working for STM32F103

Posted by Dave on 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?

RE: FreeRTOS is not working for STM32F103

Posted by Beja Nissim on 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.

RE: FreeRTOS is not working for STM32F103

Posted by Richard on 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.

RE: FreeRTOS is not working for STM32F103

Posted by Beja Nissim on 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.

RE: FreeRTOS is not working for STM32F103

Posted by Richard on 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.

RE: FreeRTOS is not working for STM32F103

Posted by Stefano Oliveri on 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:

:-)

void TheFirstTask(void* pvParameters)
{
register int pippo = 0;

for(;;) {
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

RE: FreeRTOS is not working for STM32F103

Posted by Beja Nissim on 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.

RE: FreeRTOS is not working for STM32F103

Posted by samuel on January 8, 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

RE: FreeRTOS is not working for STM32F103

Posted by Oscar Herrera on 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

RE: FreeRTOS is not working for STM32F103

Posted by MEdwards on October 22, 2009
Copy the examples - they do not call vPortSVCHandler() from within another function.

RE: FreeRTOS is not working for STM32F103

Posted by Oscar Herrera on October 22, 2009
Calling the portable handlers directly from the "startup.s" file was indeed the solution. Thank you.

RE: FreeRTOS is not working for STM32F103

Posted by Jeff Blauser on May 2, 2013
So if the STM32F103 - IAR does not support the STM3210E-EVAL board, which board does it support?


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS