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] [March 2009 Threads] FreeRTOS resets dsPIC30FPosted 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 dsPIC30FPosted 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 dsPIC30FPosted 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(;;) 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 dsPIC30FPosted 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 dsPIC30FPosted 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!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|