From adb69e4380f13fb1b26b4f50165650a838565e3b Mon Sep 17 00:00:00 2001 From: richardbarry Date: Sun, 23 Mar 2008 16:58:34 +0000 Subject: [PATCH] Add SVC handler to startup and recursive mutexes to the list of test tasks. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@259 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/Makefile | 6 ++++-- Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c | 18 +++++++++++++++++- .../CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/startup.c | 3 ++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/Makefile b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/Makefile index f7a238947..0279ba854 100644 --- a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/Makefile +++ b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/Makefile @@ -39,7 +39,8 @@ CC=arm-none-eabi-gcc OBJCOPY=arm-none-eabi-objcopy LDSCRIPT=standalone.ld -LINKER_FLAGS=-nostartfiles -Xlinker -oRTOSDemo.axf -Xlinker -M -Xlinker -Map=rtosdemo.map +# should use --gc-sections but the debugger does not seem to be able to cope with the option. +LINKER_FLAGS=-nostartfiles -Xlinker -oRTOSDemo.axf -Xlinker -M -Xlinker -Map=rtosdemo.map -Xlinker --no-gc-sections DEBUG=-g OPTIM=-O0 @@ -48,7 +49,7 @@ OPTIM=-O0 CFLAGS=$(DEBUG) -I . -I $(RTOS_SOURCE_DIR)/include -I $(RTOS_SOURCE_DIR)/portable/GCC/ARM_CM3 \ -I $(DEMO_INCLUDE_DIR) -D GCC_ARMCM3_LM3S102 -D inline= -mthumb -mcpu=cortex-m3 $(OPTIM) -T$(LDSCRIPT) \ -D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -D sprintf=usprintf -D snprintf=usnprintf -D printf=uipprintf \ - -I $(UIP_COMMON_DIR) -I ./webserver -ffunction-sections -fdata-sections -Wl,--no-gc-sections -I $(LUMINARY_DRIVER_DIR) + -I $(UIP_COMMON_DIR) -I ./webserver -ffunction-sections -fdata-sections -I $(LUMINARY_DRIVER_DIR) SOURCE= main.c \ timertest.c \ @@ -64,6 +65,7 @@ SOURCE= main.c \ $(DEMO_COMMON_DIR)/semtest.c \ $(DEMO_COMMON_DIR)/GenQTest.c \ $(DEMO_COMMON_DIR)/QPeek.c \ + $(DEMO_COMMON_DIR)/recmutex.c \ ./webserver/uIP_Task.c \ ./webserver/emac.c \ ./webserver/httpd.c \ diff --git a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c index cdbcb01cc..7622caca2 100644 --- a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c +++ b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c @@ -97,6 +97,7 @@ #include "bitmap.h" #include "GenQTest.h" #include "QPeek.h" +#include "recmutex.h" /* Hardware library includes. */ #include "hw_memmap.h" @@ -214,6 +215,7 @@ int main( void ) vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY ); vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY ); vStartQueuePeekTasks(); + vStartRecursiveMutexTasks(); /* Start the tasks defined within this file/specific to this demo. */ xTaskCreate( vOLEDTask, ( signed portCHAR * ) "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); @@ -303,6 +305,10 @@ static unsigned portLONG ulTicksSinceLastDisplay = 0; else if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) { xMessage.pcMessage = "ERROR IN MATH"; + } + else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) + { + xMessage.pcMessage = "ERROR IN REC MUTEX"; } else if( ulIdleError != pdFALSE ) { @@ -321,6 +327,7 @@ xOLEDMessage xMessage; unsigned portLONG ulY, ulMaxY; static portCHAR cMessage[ mainMAX_MSG_LEN ]; extern unsigned portLONG ulMaxJitter; +unsigned portBASE_TYPE uxUnusedStackOnEntry, uxUnusedStackNow; /* Functions to access the OLED. The one used depends on the dev kit being used. */ @@ -329,6 +336,9 @@ void ( *vOLEDStringDraw )( const portCHAR *, unsigned portLONG, unsigned portLON void ( *vOLEDImageDraw )( const unsigned portCHAR *, unsigned portLONG, unsigned portLONG, unsigned portLONG, unsigned portLONG ); void ( *vOLEDClear )( void ); + /* Just for demo purposes. */ + uxUnusedStackOnEntry = uxTaskGetStackHighWaterMark( NULL ); + /* Map the OLED access functions to the driver functions that are appropriate for the evaluation kit being used. */ switch( HWREG( SYSCTL_DID1 ) & SYSCTL_DID1_PRTNO_MASK ) @@ -356,6 +366,8 @@ void ( *vOLEDClear )( void ); vOLEDStringDraw( " POWERED BY FreeRTOS", 0, 0, mainFULL_SCALE ); vOLEDImageDraw( pucImage, 0, mainCHARACTER_HEIGHT + 1, bmpBITMAP_WIDTH, bmpBITMAP_HEIGHT ); + uxUnusedStackNow = uxTaskGetStackHighWaterMark( NULL ); + for( ;; ) { /* Wait for a message to arrive that requires displaying. */ @@ -437,6 +449,10 @@ void vApplicationIdleHook( void ) " .align 2 \n" "ulIdleErrorConst: .word ulIdleError" ); } +/*-----------------------------------------------------------*/ - +void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName ) +{ + for( ;; ); +} diff --git a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/startup.c b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/startup.c index 4593d3f43..c01ae4d88 100644 --- a/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/startup.c +++ b/Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/startup.c @@ -43,6 +43,7 @@ static void IntDefaultHandler(void); extern int main(void); extern void xPortPendSVHandler(void); extern void xPortSysTickHandler(void); +extern void vPortSVCHandler( void ); extern void Timer0IntHandler( void ); extern void vEMAC_ISR(void); @@ -78,7 +79,7 @@ void (* const g_pfnVectors[])(void) = 0, // Reserved 0, // Reserved 0, // Reserved - IntDefaultHandler, // SVCall handler + vPortSVCHandler, // SVCall handler IntDefaultHandler, // Debug monitor handler 0, // Reserved xPortPendSVHandler, // The PendSV handler -- 2.39.5