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

FreeRTOS task not run when interrupt timer active on STM32F4 Discovery

Posted by ramawidi on June 7, 2017

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


FreeRTOS task not run when interrupt timer active on STM32F4 Discovery

Posted by heinbali01 on June 7, 2017

Would you mind to show some of the source code? Both of the "interrupt timer", as well as the task that doesn't run


FreeRTOS task not run when interrupt timer active on STM32F4 Discovery

Posted by ramawidi on June 8, 2017

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);
		}
}

} ~~~


[ 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