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

MPLAB X DSPIC FREERTOS CRASHES

Posted by albanana on September 2, 2014

hello i wrote this program but i does not work, and the dspic crashes and resets periodically i use a logic analyzer for watching the CLOCKOUT and GPIO, and the watchdog is disabled

the program counter never goes to the Blink task but the timer 1 interrupt handler runs

did i make a mistake ? plz help!!!

THANKS :) sorry for the bad formatting


define configUSE_PREEMPTION 1
define configUSEIDLEHOOK 1
define configUSETICKHOOK 0
define configTICKRATEHZ ( ( TickType_t ) 1000 )
define configCPUCLOCKHZ ( ( unsigned long ) 25000000 ) /* Fosc / 2 */
define configMAX_PRIORITIES ( 4 )
define configMINIMALSTACKSIZE ( 105 )
define configTOTALHEAPSIZE ( ( size_t ) 5120 )
define configMAXTASKNAME_LEN ( 4 )
define configUSETRACEFACILITY 0
define configUSE16BIT_TICKS 1
define configIDLESHOULDYIELD 1

/* Co-routine definitions. */

define configUSECOROUTINES 0
define configMAXCOROUTINE_PRIORITIES ( 2 )

/* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */

define INCLUDE_vTaskPrioritySet 1
define INCLUDE_uxTaskPriorityGet 0
define INCLUDE_vTaskDelete 0
define INCLUDE_vTaskCleanUpResources 0
define INCLUDE_vTaskSuspend 1
define INCLUDE_vTaskDelayUntil 1
define INCLUDE_vTaskDelay 1
define configKERNELINTERRUPTPRIORITY 0x01
define configUSEPORTOPTIMISEDTASKSELECTION 0
endif /* FREERTOSCONFIGH */

include
include
include
include

void vApplicationIdleHook( void ) { for(;;){

}

}

void Blink(void * p){ // unsigned long i;

for(;;){
    LATA=0xff;
    vTaskDelay(10);
    LATA=0;
    vTaskDelay(10);
}

}

/* * */ int main(int argc, char** argv) { TRISA=0;

xTaskCreate( Blink, "Blink", configMINIMAL_STACK_SIZE , NULL, 2, NULL );
vTaskStartScheduler();
for(;;){

}
return 0;

}


MPLAB X DSPIC FREERTOS CRASHES

Posted by rtel on September 3, 2014

crashes and resets periodically

That makes it sound like the tasks starts running, but crashes/resets after a while.

the program counter never goes to the Blink task

That makes it sound like the task never starts running at all.

So I am confused as to how far you get in your application before the problem occurs. However, do you have the MPLABDSPICPORT symbol defined in your build options to tell the pre-processor to use the dsPIC version of the code rather than the PIC24 version?

Regards.


MPLAB X DSPIC FREERTOS CRASHES

Posted by albanana on September 3, 2014

okay my mistake i declared #define MPLABDSPICPORT on top of FreeRTOSConfig.h and all works fine now. wrong assembly code caused exception and crash at switching context time.

problem solved THANKS


MPLAB X DSPIC FREERTOS CRASHES

Posted by albanana on September 3, 2014

MPLAB X DSPIC FREERTOS CRASHES

Posted by albanana on September 3, 2014


[ 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