Monday, May 21st 2018, 5:27am UTC+2

You are not logged in.

  • Login
  • Register

Mnksh

Beginner

Date of registration: Oct 27th 2011

Posts: 6

1

Monday, November 7th 2011, 3:36pm

OS_CREATETIMER working, whereas OS_CREATETIMER_EX is not

Hello,
I tried modifying the Start project slightly to check the timer functions. When I create a timer using OS_CREATETIMER or OS_CreateTimer it is working fine. I am able to see the created timers in the Timers window in my IAR embedded workbench. But when I try to create a timer using OS_CREATETIMER_EX or OS_CreateTimerEx am not pretty sure whether the timer is getting created or not, because my Timers window is empty. But I am not getting any errors too. My code looks like this:

OS_STACKPTR int StackHP[1024], StackLP[1024]; /* Task stacks */
OS_TASK TCBHP, TCBLP; /* Task-control-blocks */
OS_TIMER TIMER100;

void Timer100(void* index) {
BSP_ToggleLED((int) index); /* Toggle LED */
OS_RetriggerTimerEx(&TIMER100); /* Make timer periodical */
}

OS_VALUE HPTask(void* Time) {
OS_CREATETIMER_EX (&TIMER100, Timer100, 100, (void*) 0);
while (1) {
OS_Delay ((OS_TIME) Time);
}
}

OS_VALUE LPTask(void* Time) {
while (1) {
BSP_ToggleLED(1);
OS_Delay ((OS_TIME) Time);
}
}

int main(void) {
OS_IncDI(); /* Initially disable interrupts */
OS_Init(); /* Initialize OS */
OS_InitHW(); /* Initialize Hardware for OS */
BSP_Init(); /* Initialize LED ports */
/* You need to create at least one task before calling OS_Start() */
OS_CreateTask_Ex (&TCBHP, "HP Task", 100, HPTask, StackHP, 1024, 1, 50);

OS_CreateTask_Ex (&TCBLP, "LP Task", 50, LPTask, StackLP, 1024, 1, 200);
OS_Start(); /* Start multitasking */
return 0;
}

Could you please help me find out whether my extended timers are created or not? I am using IAR embedded workbench for ARM 6.21.3 and J-Link ARM version 8.0 on STM3240G-EVAL board (STM32F4xx).

Thanks.

SEGGER - Til

Super Moderator

Date of registration: Nov 14th 2007

Posts: 271

2

Monday, November 7th 2011, 6:33pm

Helllo,

I can reproduce this issue and I guess it could be a problem with the IAR embOS plugin.
Your extended embOS software timer is created, but it seems that it is not shown in the IAR embOS plugin.
We will investigate it in more detail.

Please be aware that the control structure for extended software timer is OS_TIMER_EX and not OS_TIMER.

Regards,
Til

Mnksh

Beginner

Date of registration: Oct 27th 2011

Posts: 6

3

Tuesday, November 8th 2011, 10:01am

Hello Til,

Thanks for the response. Please keep me updated when you correct the IAR embOS plugin.