Quality RTOS & Embedded Software

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




Loading

Porting Problem with FreeRTOS v7.0.2 on IAR

Posted by Kyle on December 1, 2011
Hello.
I work to port FreeRTOS(v.7.0.2) to STM32F103 with Standard peripheral library ver 3.5.0.
I read your post. I think you can slove my problem, so I send you this mail.
Please, would you help me... See below.

<>
MCU : STM32F103VB
Compiler : IAR Ver 6.21
FreeRTOS V7.0.2
Std peripheral library version V3.5.0

<< Problems>>
My problems is below - 2 problems.

1. Compile Error on porting FreeRTOS.
File => portasm.s (Line. 57)
Message => Error[2]:Failed to open #include

I don't know why. I did several actions, but didn't catch error.

2. The task is not work.
for 1st problems, I uncommented including sentense(eg. // #include )
Then, I defined words needed in portasm.s
=========================================================================
#ifndef configMAX_SYSCALL_INTERRUPT_PRIORITY
  #define configMAX_SYSCALL_INTERRUPT_PRIORITY  191 /* equivalent to 0xb0, or priority 11. */
#endif  
=========================================================================
Then, it disappeared error message. and I made task to print out Simple MESSAGE.
I made Task1 that print out simple Message, but that's not work.

See below.
* Main function ===========================================================
int main(void)
{
  SYSTickInit();
  AppGPIOInit();
  AppUARTInit();
  printf("%s", MESSAGE1);
 
  /* Create Task */
  xTaskCreate( Task1, "Task1", /*TASK_SIZE*/ 240 , NULL, 1, /*&task1*/ NULL);       
  /* Start the scheduler. */
  vTaskStartScheduler();
  
  return 0;
}
* Task Function ===========================================================
void Task1( void *pvParameters ){
  portTickType gpio_Time; 
  
  gpio_Time = xTaskGetTickCount();    
  printf("%s ", MESSAGE1);
  while(1)
  {    
    GPIOB->ODR ^= GPIO_Pin_6;
    vTaskDelayUntil( &gpio_Time, 1000 );     
  }
  
}
* SysTick intialization Function  =====================================================
void SYSTickInit(void)
{
  /* Setup SysTick Timer for 1 msec interrupts  */
  if (SysTick_Config(SystemCoreClock/1000))
  { 
    /* Capture error */ 
    while (1);
  }  
}

CF)
Other UART, GPIO functions OK. I checked.

RE: Porting Problem with FreeRTOS v7.0.2 on IAR

Posted by Richard on December 1, 2011
I don't think this can be classed as porting, it is just setting up a new project to use the existing IAR/Cortex-M3 port. You should be able to take an existing IAR/Cortex-M3 project and just re-target it to your chip, then you would have the project set up correctly already.

“1. Compile Error on porting FreeRTOS.
File => portasm.s (Line. 57)
Message => Error[2]:Failed to open #include


Just like the compiler, you need to set the include path for your assembler so it can find the file. In the project options, choose the assembler category, then the preprocessor tab, and add "$PROJ_DIR$\" (without the quotes) to the "Additional Include Directories" - assuming FreeRTOSConfig.h is in the same directory as your IAR project file.


“2. The task is not work.”


* SysTick intialization Function  =====================================================
void SYSTickInit(void)
{
/* Setup SysTick Timer for 1 msec interrupts */
if (SysTick_Config(SystemCoreClock/1000))
{
/* Capture error */
while (1);
}
}


Do you ever call this function? If so, please don't!. The kernel needs exclusive access to the SysTick (including the interrupt) and configures the SysTick when when the scheduler is started. I presume you have installed the correct SysTick interrupt handler for the kernel? Again, if not, look at existing projects.


int main(void)
{
SYSTickInit();
AppGPIOInit();
AppUARTInit();
printf("%s", MESSAGE1);

/* Create Task */
xTaskCreate( Task1, "Task1", /*TASK_SIZE*/ 240 , NULL, 1, /*&task1*/ NULL);
/* Start the scheduler. */
vTaskStartScheduler();

return 0;
}


Does the printf() call after the call to AppUARTInit() work?

Regards.

RE: Porting Problem with FreeRTOS v7.0.2 on IAR

Posted by Kyle on December 1, 2011
Hi. This compiled right after adding path. And... Second question I got a hint. Thank you for your advice.^^


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists