Quality RTOS & Embedded Software
About   Contact   Support   FAQ

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

Last site update June 02 2015

Embedded TCP/IP stack for RTOS advert


FreeRTOS resets dsPIC30F

Posted by Martin Stuber on March 16, 2009
Hello everybody,
I need help with the FreeRTOS running on a dsPIC30F4013. It is working except of a reset problem. I tried to solve the problem and reduced the application to one task. The task just contains a for-loop which is limited to 9 cycles. After finishing the nine cycles the device is rebooted. But why is it rebooted? Shouldn’t the idle task hold the device in an infinite running state? A software reset seems to be responsible for the reboot (RCONbits.SWR is set to 1). The watchdogtimer is disabled. Please help me solving this problem. It seems to be the FreeRTOS but I have no idea.
Thank you in advance

RE: FreeRTOS resets dsPIC30F

Posted by MEdwards on March 16, 2009
The idle task would only run if you other task blocked, unless it is running at the same priority as the idle task. Can you post the code for your task?

RE: FreeRTOS resets dsPIC30F

Posted by Martin Stuber on March 17, 2009
I tried running the task with the same priority than the idle task but there is no difference.
Here is the code for the task and the initialization of the task:

void StartTaskOne( void )
xTaskCreate( (pdTASK_CODE) TaskOne, ( signed portCHAR * ) "TaskOne", configMINIMAL_STACK_SIZE*1, NULL, tskIDLE_PRIORITY + 3 , NULL );

void TaskOne (void)
char i;
UART_Init(); //Initialize the UART module to communicate with the COM port

portTickType xLastExecutionTime;

xLastExecutionTime = xTaskGetTickCount();

for(i =0;i < 9;i++)
vTaskDelayUntil( &xLastExecutionTime, 1000 );

LATDbits.LATD2 = ~ LATDbits.LATD2;

The stack size of the task is 400 Byte. This should be enough. What can cause this (software) reset?
Thank you

RE: FreeRTOS resets dsPIC30F

Posted by Dave on March 17, 2009
You cannot exit a task by returning from the function. If you change your for loop to be an infinite loop then it should be ok (provided your UART is not causing a reset). I recommend reading the eBook.

RE: FreeRTOS resets dsPIC30F

Posted by Martin Stuber on March 17, 2009
Hello Dave,
You are right. This was my mistake. My real application has three tasks with infinite for-loops. I tried to reduce the complexity of my application and ran into this mistake.
The reset was due to UART and ADC interrupts. I don't know exactly why, but the interrupts caused the reset. When I disabled the interrupts everything was fine. Now I changed the CPU Interrupt Priority Level from 1 (as default) to 0 and everything is ok. Can anybody tell me how the interrupt priority influences the reset of my device?
Thank you very much for your help!

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

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2015 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 - New Book Edition!

Receive a complimentary pre-release pdf of our up-coming book "Mastering the FreeRTOS Real Time Kernel, a Hands-On Tutorial Guide" with every purchased copy of the existing "Using the FreeRTOS Real Time Kernel" book.

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

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