Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

FreeRTOS on sam3x8e reboot after 10s

Posted by funkystuff on December 2, 2015

Hi everyone! I'm novice on freeRTOS... i'm writing some code on sam3x8e and works great for the first 10s ... after this time freeRTOS seems to reboot and so on!!! any ideas for the problem!? thanks a lot. Tommaso


FreeRTOS on sam3x8e reboot after 10s

Posted by rtel on December 2, 2015

I'm afraid you will have to provide more information in order to get a helpful reply. As it is all we could do is list out 100 different possibilities from the power supply browning out to your code overwritting critical data to a watchdog not being kicked.

Places to start: http://www.freertos.org/FAQ-how-to-use-the-FreeRTOS-support-forum.html http://www.freertos.org/FAQHelp.html


FreeRTOS on sam3x8e reboot after 10s

Posted by funkystuff on December 2, 2015

okey....Well...

uController -> Atmel sam3x8e compiler -> ARM/GNU C compiler freeRTOS version -> 7.3.0 SDK -> Atmel studio 7.0 with ASF

My application it's composed by a simple task(sender) that create som messages and send theme to a specifica Queue and than it delete itself. To the other side there's a task(motor_manager) that recive the messages from the queue and do some stuff. There's the code:

Task sender:

void sender(void* pvParameters) { uint8t rxValue; motorcmd cmd2 = {10,CCW,1,START}; motorcmd cmd3 = {10,CCW,2,START}; motorcmd cmd4 = {10,CCW,3,START}; motorcmd cmd1 = {10,CCW,0,START}; uint8t carattere = 33; vTaskDelay(1000/portTICKRATEMS); xQueueSend(txqueue,&carattere,0); xQueueSend(incomingmessage,&cmd1,0); xQueueSend(incomingmessage,&cmd2,0); xQueueSend(incomingmessage,&cmd3,0); xQueueSend(incoming_message,&cmd4,0); while(1); }

Task motormanager: void motormanager(void* pvParameters) { portBASETYPE xStatus; motorcmd inmsg; for (int i = 0;i < 8;i++) { if(pwmchenable[i] == 1) { pwmchenabled[i] = i; nMotors[i].status = IDLE; nMotors[i].isEnabled = true; nMotors[i].cmdsteps = 0; nMotors[i].remaningsteps = 0; pioconfigurepin(CH0PIN + i,PIOTYPEPIOOUTPUT0); piosetpinlow(CH0PIN + i); xStatus = xTaskCreate(motorchannelmanager,"Gestorecanale",configMINIMALSTACKSIZE,&pwmchenabled[i],CHANNELTASKPRIORITY,NULL); if(xStatus != pdPASS) { A9488drv_fault = true; vTaskDelete(NULL); } } }

vTaskPrioritySet(NULL,(configMAX_PRIORITIES - 3));
while(1)
{
	if (uxQueueMessagesWaiting(incoming_message) > 0)
	{
		xQueueReceive(incoming_message,&in_msg,portMAX_DELAY);
		if(nMotors[in_msg.ch].isEnabled && nMotors[in_msg.ch].status == IDLE)
		{
			nMotors[in_msg.ch].cmd_steps = in_msg.n_steps*2;
			nMotors[in_msg.ch].remaning_steps = nMotors[in_msg.ch].cmd_steps;
			nMotors[in_msg.ch].rot = in_msg.direction;
			nMotors[in_msg.ch].status = RUNNING;
		}
	}
	taskYIELD(); 
}

}

the main:

int main (void) { sysclkinit(); boardinit(); irqinitializevectors(); cpuirqenable();

xTaskCreate(init_system_task,"Boot_task",configMINIMAL_STACK_SIZE,NULL,(configMAX_PRIORITIES - 2),NULL);
xTaskCreate(sender,"sender_task",configMINIMAL_STACK_SIZE,NULL,TX_PRIORITY,NULL);
vTaskStartScheduler();
while(1);

}

the code seems work great...but after 10s it crash and reboot.....i tryed to disable the WDT but nothing happends!!!...the only things i've changed in freeRTOSConfig.h is: configUSEMALLOCFAILED_HOOK (1 -> 0) because the compiler give me some errors. thanks Tommaso.


FreeRTOS on sam3x8e reboot after 10s

Posted by funkystuff on December 2, 2015

the problem doesn't appear during debug with atmel ICE JTAG!!!!!


FreeRTOS on sam3x8e reboot after 10s

Posted by davedoors on December 2, 2015

IAR JTAGs can run a script to config some registers before debugging starts. Does your ICE do the same?

Can you use a newer version so configASSERT() will be more useful to you?


FreeRTOS on sam3x8e reboot after 10s

Posted by alainm3 on December 2, 2015

So far ALL my problems of system rebooting after some time were due to stack overflow...

But that was easy to catch as I implemented the function supplied as an example that shows stack usage for each task. I also added main stack usage and free memory... That is really an invaluable tool

Alain

On 02-12-2015 09:24, Tommaso D'ippolito wrote: > > Hi everyone! > I'm novice on freeRTOS... > i'm writing some code on sam3x8e and works great for the first 10s ... > after this time freeRTOS seems to reboot and so on!!! > any ideas for the problem!? > thanks a lot. > Tommaso > > ------------------------------------------------------------------------ > > FreeRTOS on sam3x8e reboot after 10s > https://sourceforge.net/p/freertos/discussion/382005/thread/7304bc6a/?limit=25#0b0e > > ------------------------------------------------------------------------ > > Sent from sourceforge.net because you indicated interest in > https://sourceforge.net/p/freertos/discussion/382005/ > > To unsubscribe from further messages, please visit > https://sourceforge.net/auth/subscriptions/ >

Attachments

alternate (1882 bytes)

FreeRTOS on sam3x8e reboot after 10s

Posted by funkystuff on December 2, 2015

SOLVED..........it was a problem with the watch dog timer...... it wasn't correctly disabled...i don't no really why but disable the watch dog from a task won't wok....but disable it from the main works correctly!!!!!! thanks everyone for HELP. Tommaso.


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




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS