Quality RTOS & Embedded Software

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




Loading

Pic24 automatic Reset

Posted by amarjith on November 8, 2013

Automatic resetting occurs when i add/ create some tasks for example if i add xTaskCreate( vHandlerTask, "Handler", 500, NULL, 1, NULL);

in my program microcontroller will reset automatically

void vHandlerTask( void pvParameters ) { int i; / As per most tasks, this task is implemented within an infinite loop. / for( ;; ) { U1_puts( "Handler task .rn" ); / Use the semaphore to wait for an event. The semaphore was created before the scheduler was started so before this task ran for the first time. The task blocks indefinitely so the function call will only return once the semaphore has been successfully taken (obtained). There is therefore no need to check the function return value. / xSemaphoreTake( xBinarySemaphore, portMAX_DELAY ); / To get here the event must have occurred. Process the event. case processing is simply a matter of printing out a message. */ U1_puts( "Handler task - Processing event.rn" ); } }

Why this happening when adding some tasks?, if i delete or comment this task program will work. Please help

These are my Tasks if i put tasks as shown below "vMT_InitRepman" will execute first , it never enter in to vHandlerTask even its priority is 10.

    xTaskCreate( vMT_InitRepman, "vMT_InitRepman", 500, NULL, 3, &xInitHandle );

    xTaskCreate( vMT_Loging, "vMT_Loging", 500, 5, 1, &xLogingHandle);
    xTaskCreate( vMT_Upload, "vMT_Upload", 500, 20, 1, &xUploadHandle );
    xTaskCreate( vMT_ErrorHandler, "vMT_ErrorHandler", 500, NULL, 2, &xErrorHandle );

    xTaskCreate( vHandlerTask, "Handler", 500, NULL, 10, NULL);

And if put as shown below, microcontroller will reset continuously

     xTaskCreate( vHandlerTask, "Handler", 500, NULL, 10, NULL);
     xTaskCreate( vMT_InitRepman, "vMT_InitRepman", 500, NULL, 3, &xInitHandle );

    xTaskCreate( vMT_Loging, "vMT_Loging", 500, 5, 1, &xLogingHandle);
    xTaskCreate( vMT_Upload, "vMT_Upload", 500, 20, 1, &xUploadHandle );
    xTaskCreate( vMT_ErrorHandler, "vMT_ErrorHandler", 500, NULL, 2, &xErrorHandle );

Pic24 automatic Reset

Posted by richardbarry on November 8, 2013

Try all the usual things first - define configASSERT(), have the malloc failed and stack overflow hooks defined, etc. Then, if still no luck in trapping the error, step through the task in the debugger until the point at which the reset occurs to see what is causing it.

Regards.


[ 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