FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [June 2017 Threads]
Hi, I want to combine the interrupt timer on STM32F4 Discovery with FreeRTOS task. But unfortunatelly the task is not executed, but when I disable my interrupt timer the task is works well. Does anyone know why this is happend?
Regards
Rama
Would you mind to show some of the source code? Both of the "interrupt timer", as well as the task that doesn't run
Hi there, here is the code for my Interrupt Timer
~~~
void TIM2Config(){
TIMTimeBaseInitTypeDef TIMTimeBaseStructure;
RCCPCLK1Config(RCCHCLKDiv16);
RCCAPB1PeriphClockCmd(RCCAPB1PeriphTIM2,ENABLE);
TIMTimeBaseStructure.TIMPrescaler = 42000-1;
TIMTimeBaseStructure.TIMCounterMode = TIMCounterModeUp;
TIMTimeBaseStructure.TIMPeriod = 200-1;
TIMTimeBaseStructure.TIMClockDivision = TIMCKDDIV1;
TIMTimeBaseStructure.TIMRepetitionCounter = 0;
TIMTimeBaseInit(TIM2,&TIMTimeBaseStructure);
TIMCmd(TIM2,ENABLE);
}
void TIMITEnable(){
TIMITConfig(TIM2,TIMITUpdate, ENABLE);
}
void NVICConfig(){
NVICInitTypeDef NVICInitStrurture;
NVICPriorityGroupConfig(NVICPriorityGroup0);
NVICInitStrurture.NVICIRQChannel = TIM2IRQn;
NVICInitStrurture.NVICIRQChannelPreemptionPriority = 0x00;
NVICInitStrurture.NVICIRQChannelSubPriority = 0x00;
NVICInitStrurture.NVICIRQChannelCmd =ENABLE;
NVICInit(&NVICInitStrurture);
}
int nInterrupt=0,counter;
char buffer[32];
char buftmp[32];
void TIM2IRQHandler(){
if(TIMGetITStatus(TIM2,TIMITUpdate)!=RESET){
TIMClearITPendingBit(TIM2,TIMITUpdate);
//counter=TIMGetCounter(TIM6);
nInterrupt++;
//sprintf(buffer,"rke-%3dn",nInterrupt);
//USARTputs(buffer);
sprintf(buftmp,"%dn",tmp);
USARTputs(buf_tmp);
tamp = 0;
}
}
~~~
And I have 2 Task, 1 task for simple print and 1 task for networking (using LwIP)
~~~
void testprint(void)
{
TickTypet waketime,tamp1,tamp2;
const uint32t period = 100;
char buff[32];
wake_time = xTaskGetTickCount();
while(1)
{
USART_puts("aaaaaaaaaaa ");
//vTaskDelay(1000);
delay_dw(500);
tamp2 = xTaskGetTickCount();
sprintf(buff,"Tick2 = %u\n",tamp2);
USART_puts(buff);
vTaskDelayUntil(&wake_time,period);
}
}
void echotcp()
{
int c1,c2;
char clock[32];
tamp = 0;
while(1)
{
if(ETHCheckFrameReceived())
{
cyclestart();
c1 = getCycles();
LwIPPktHandle();
c2 = getCycles();
cyclestop();
tamp+= c2 - c1;
GPIO_SetBits(GPIOD,GPIO_Pin_12);
}
else
{
GPIO_ResetBits(GPIOD,GPIO_Pin_12);
LwIP_Periodic_Handle(LocalTime);
}
}
}
~~~
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.