Quality RTOS & Embedded Software

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


Loading

Help me to make this link error "vApplicationStackOverflowHook

Posted by immanuvel on October 16, 2013

Hi,

I am a beginner in freertos. Please Help me

When I compile this small below program it has compiled but it is not make.i am getting Link Error.

Link Error: Undefined: "vApplicationStackOverflowHook" Referenced from "vTaskSwitchContext" in.

(and i am using Coldfire MCF52259 Microcontroller)

include "FreeRTOS.h"
include "task.h"
include "queue.h"
include "timers.h"

void mytask(void *pvParameters) { while(1) { MCFGPIODDRTC=0x0F; MCFGPIOSETTC=0x0F; vTaskDelay( 500 / portTICKRATEMS); MCFGPIOCLRTC=0x0F; } } int main(void) {

xTaskCreate(mytask,(signed char*) "mytask", configMINIMAL_STACK_SIZE, NULL, 1, NULL);
return 0;

}


This is FreeRTOSConfig.h file which i have used for this above program

ifndef FREERTOSCONFIGH
define FREERTOSCONFIGH

/* Library includes. */

include "common.h"

/----------------------------------------------------------- * Application specific definitions. * * These definitions should be adjusted for your particular hardware and * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * * See http://www.freertos.org/a00110.html. *----------------------------------------------------------/

define configUSE_PREEMPTION 1
define configUSEIDLEHOOK 0
define configUSETICKHOOK 0
define configCPUCLOCKHZ ( ( unsigned long ) 80000000 )
define configTICKRATEHZ ( ( portTickType ) 100 )
define configMINIMALSTACKSIZE ( ( unsigned short ) 160 )
define configTOTALHEAPSIZE ( ( size_t ) (30* 1024 ) )
define configMAXTASKNAME_LEN ( 12 )
define configUSETRACEFACILITY 1
define configUSE16BIT_TICKS 0
define configIDLESHOULDYIELD 0
define configUSECOROUTINES 0
define configUSE_MUTEXES 1
define configCHECKFORSTACK_OVERFLOW 2
define configUSERECURSIVEMUTEXES 1
define configQUEUEREGISTRYSIZE 0
define configUSECOUNTINGSEMAPHORES 0
define configUSEMALLOCFAILED_HOOK 0
define configMAXPRIORITIES ( ( unsigned portBASETYPE ) 6 )
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 1
define INCLUDE_vTaskDelete 1
define INCLUDE_vTaskCleanUpResources 0
define INCLUDE_vTaskSuspend 1
define INCLUDE_vTaskDelayUntil 1
define INCLUDE_vTaskDelay 1
define INCLUDE_uxTaskGetStackHighWaterMark 1
define configYIELDINTERRUPTVECTOR 16UL
define configKERNELINTERRUPTPRIORITY 1
define configMAXSYSCALLINTERRUPT_PRIORITY 4

/* This demo makes use of one or more example stats formatting functions. These format the raw data provided by the uxTaskGetSystemState() function in to human readable ASCII form. See the notes in the implementation of vTaskList() within FreeRTOS/Source/tasks.c for limitations. */

define configUSESTATSFORMATTING_FUNCTIONS 1

void vApplicationSetupInterrupts( void );

/* Ethernet configuration. */

define configMAC_0 0x00
define configMAC_1 0x04
define configMAC_2 0x9F
define configMAC_3 0x00
define configMAC_4 0xAB
define configMAC_5 0x2B
define configIP_ADDR0 192
define configIP_ADDR1 168
define configIP_ADDR2 0
define configIP_ADDR3 11
define configGW_ADDR0 172
define configGW_ADDR1 25
define configGW_ADDR2 218
define configGW_ADDR3 3
define configNET_MASK0 255
define configNET_MASK1 255
define configNET_MASK2 255
define configNET_MASK3 0
define configNUMFECTX_BUFFERS 2
define configNUMFECRX_BUFFERS 4
define configFECBUFFERSIZE 1520
define configUSEPROMISCUOUSMODE 0
define configETHERNETINPUTTASKSTACKSIZE ( 320 )
define configETHERNETINPUTTASKPRIORITY ( configMAXPRIORITIES - 1 )
define configPHY_ADDRESS 1
if ( configFECBUFFERSIZE & 0x0F ) != 0
#error configFEC_BUFFER_SIZE must be a multiple of 16.
endif
endif /* FREERTOSCONFIGH */

Help me to make this link error "vApplicationStackOverflowHook

Posted by xz8987f on October 16, 2013

Hello, it is because you have asked to check for stack overflow in your FreeRTOSConfig.h: configCHECKFORSTACK_OVERFLOW Set it to 0 if you want Stack overflow disabled. Altough I recommend to have it enabled. Simply add something like this to your application:

void FRTOS1vApplicationStackOverflowHook(xTaskHandle pxTask, signed portCHAR pcTaskName) { / This will get called if a stack overflow is detected during the context switch. Set configCHECKFORSTACKOVERFLOWS to 2 to also check for stack problems within nested interrupts, but only do this for debug purposes as it will increase the context switch time. / (void)pxTask; (void)pcTaskName; taskDISABLE_INTERRUPTS(); / Write your code here ... */ for(;;) {} }

If you are using ColdFire V2 (MCF52259) with CodeWarrior, then you might have a look at my Processor Expert component for FreeRTOS: it supports many cores, including ColdFire: http://mcuoneclipse.com/2012/06/28/tutorial-freertos-on-demojm/ http://mcuoneclipse.com/tag/freertos/

I hope this helps.


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner