vPortStartFirstTask() for STM32L + FreeRTOS

anuradha123 wrote on Thursday, December 02, 2010:

Hello all,

I have changed the FreeRTOS demo for STM32F103 in order to work with STM32L. This is my main.c.

int main()
{
  
  prvSetupHardware();
  
  xTaskCreate(vLEDTask,( signed char * )"LED1",configMINIMAL_STACK_SIZE, NULL,mainFLASH_TASK_PRIORITY,(xTaskHandle*) NULL );
  xTaskCreate(vLEDTask2,( signed char * )"LED2",configMINIMAL_STACK_SIZE, NULL,(mainFLASH_TASK_PRIORITY+1),(xTaskHandle*) NULL );
  
  /* Start the scheduler. */
  vTaskStartScheduler();
  
  
  return 0;
}

Hard Fault exception occurs within the vTaskStartScheduler(); function.

As I noticed by the step running the exception occurs after the vPortStartFirstTask on portasm.s.

Have anybody any idea on how to configure this function so that the scheduler will start the first task?

Thank you.

anonymous wrote on Thursday, December 02, 2010:

Hi,
have you checked the name of the exception handler used by FreeRTOS?
- SVC_Handler (vPortSVCHandler)
- PendSV_Handler (xPortPendSVHandler)
- SysTick_Handler (xPortSysTickHandler)

Are the same defined in the vector table?

Regards,
Stefano

anuradha123 wrote on Thursday, December 02, 2010:

Hello, Further to previous post,

I want to know how to change the “Constants required to manipulate the NVIC” defined in the port.c.
Should they be same for all ARM CM3 ports???

davedoors wrote on Thursday, December 02, 2010:

Should they be same for all ARM CM3 ports???

I think that has been answered already, and the answer is Yes.

Please keep your related posts in a single thread.

anuradha123 wrote on Thursday, December 02, 2010:

Thanks STF12

it worked :smiley:

anuradha123 wrote on Tuesday, December 07, 2010:

Hello,
In the “CORTEX_STM32F103_IAR” FreeRTOS port the vector table is defined in stm32f10x_nvic.c.
Is there a special reason for using that file instead of using the provided startup files (startup_stm32f10x_cl.s etc) ?

Thank you.