From: richardbarry Date: Thu, 23 Dec 2010 11:03:07 +0000 (+0000) Subject: Complete the STM32L152 demo application functionality - it is still to be 'production... X-Git-Tag: V6.1.1~75 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=133797d5f57ecdc2f34a8fa64cbd953661d6e76f;p=freertos Complete the STM32L152 demo application functionality - it is still to be 'productionised'. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1182 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Demo/Cortex_STM32L152_IAR/FreeRTOSConfig.h b/Demo/Cortex_STM32L152_IAR/FreeRTOSConfig.h index ab9283838..a4aa0374f 100644 --- a/Demo/Cortex_STM32L152_IAR/FreeRTOSConfig.h +++ b/Demo/Cortex_STM32L152_IAR/FreeRTOSConfig.h @@ -78,9 +78,13 @@ #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 -#define configQUEUE_REGISTRY_SIZE 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 5 #define configGENERATE_RUN_TIME_STATS 1 #define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_RECURSIVE_MUTEXES 0 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 0 /* Co-routine definitions. */ #define configUSE_CO_ROUTINES 0 diff --git a/Demo/Cortex_STM32L152_IAR/RTOSDemo.ewp b/Demo/Cortex_STM32L152_IAR/RTOSDemo.ewp index 5696d39a4..6f8de65c3 100644 --- a/Demo/Cortex_STM32L152_IAR/RTOSDemo.ewp +++ b/Demo/Cortex_STM32L152_IAR/RTOSDemo.ewp @@ -1762,6 +1762,9 @@ $PROJ_DIR$\..\Common\Minimal\flash.c + + $PROJ_DIR$\..\Common\Minimal\GenQTest.c + System_and_ST_Code diff --git a/Demo/Cortex_STM32L152_IAR/main.c b/Demo/Cortex_STM32L152_IAR/main.c index ed78d1979..9329e6528 100644 --- a/Demo/Cortex_STM32L152_IAR/main.c +++ b/Demo/Cortex_STM32L152_IAR/main.c @@ -64,6 +64,7 @@ #include "flash.h" #include "dynamic.h" #include "comtest2.h" +#include "GenQTest.h" /* ST driver includes. */ #include "stm32l1xx_usart.h" @@ -75,6 +76,7 @@ #define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) #define mainLCD_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) #define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 ) +#define mainGENERIC_QUEUE_TEST_PRIORITY ( tskIDLE_PRIORITY ) #define mainLCD_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2 ) @@ -87,6 +89,10 @@ #define mainMESSAGE_BUTTON_SEL ( 5 ) #define mainMESSAGE_STATUS ( 6 ) +#define mainERROR_DYNAMIC_TASKS ( 2 ) +#define mainERROR_COM_TEST ( 3 ) +#define mainERROR_GEN_QUEUE_TEST ( 4 ) + /* Baud rate used by the comtest tasks. */ #define mainCOM_TEST_BAUD_RATE ( 9600 ) @@ -102,6 +108,7 @@ information. */ static void prvSetupHardware( void ); static void prvLCDTask( void *pvParameters ); static void vTempTask( void *pv ); +static void prvGenerateStatusMessage( char *pcBuffer, long lStatusValue ); unsigned long ulTIM6_OverflowCount = 0UL; @@ -129,6 +136,7 @@ void main( void ) vStartDynamicPriorityTasks(); vStartLEDFlashTasks( mainFLASH_TASK_PRIORITY ); vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); + vStartGenericQueueTasks( mainGENERIC_QUEUE_TEST_PRIORITY ); vTaskStartScheduler(); } @@ -142,7 +150,7 @@ static void prvLCDTask( void *pvParameters ) xQueueMessage xReceivedMessage; long lLine = Line1; const long lFontHeight = (((sFONT *)LCD_GetFont())->Height); -static char cBuffer[ 256 ]; +static char cBuffer[ 512 ]; /* This function is the only function that uses printf(). If printf() is used from any other function then some sort of mutual exclusion on stdout @@ -178,7 +186,7 @@ static char cBuffer[ 256 ]; own string to print out. */ sprintf( cBuffer, "%s", ( char * ) xReceivedMessage.lMessageValue ); break; - case mainMESSAGE_STATUS : sprintf( cBuffer, "Task status = %s", ( ( xReceivedMessage.lMessageValue ) ? "PASS" : "FAIL" ) ); + case mainMESSAGE_STATUS : prvGenerateStatusMessage( cBuffer, xReceivedMessage.lMessageValue ); break; default : sprintf( cBuffer, "Unknown message" ); break; @@ -190,6 +198,24 @@ static char cBuffer[ 256 ]; } /*-----------------------------------------------------------*/ +static void prvGenerateStatusMessage( char *pcBuffer, long lStatusValue ) +{ + switch( lStatusValue ) + { + case pdPASS : sprintf( pcBuffer, "Task status = PASS" ); + break; + case mainERROR_DYNAMIC_TASKS : sprintf( pcBuffer, "Error: Dynamic tasks" ); + break; + case mainERROR_COM_TEST : sprintf( pcBuffer, "Error: COM test" ); + break; + case mainERROR_GEN_QUEUE_TEST : sprintf( pcBuffer, "Error: Gen Q test" ); + break; + default : sprintf( pcBuffer, "Unknown status" ); + break; + } +} +/*-----------------------------------------------------------*/ + void EXTI9_5_IRQHandler( void ) { const xQueueMessage xMessage = { mainMESSAGE_BUTTON_SEL, ( unsigned long ) "Select Interrupt!" }; @@ -213,12 +239,17 @@ long lHigherPriorityTaskWoken = pdFALSE; /* Not used in this case as this is the { if( xAreDynamicPriorityTasksStillRunning() != pdPASS ) { - xStatusMessage.lMessageValue = pdFAIL; + xStatusMessage.lMessageValue = mainERROR_DYNAMIC_TASKS; } if( xAreComTestTasksStillRunning() != pdPASS ) { - xStatusMessage.lMessageValue = pdFAIL; + xStatusMessage.lMessageValue = mainERROR_COM_TEST; + } + + if( xAreGenericQueueTasksStillRunning() != pdPASS ) + { + xStatusMessage.lMessageValue = mainERROR_GEN_QUEUE_TEST; } xQueueSendFromISR( xLCDQueue, &xStatusMessage, &lHigherPriorityTaskWoken ); @@ -330,6 +361,11 @@ void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName for( ;; ); } +/*-----------------------------------------------------------*/ +void vApplicationMallocFailedHook( void ) +{ + for( ;; ); +} diff --git a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dbgdt b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dbgdt index 97c967e71..f3fbd8620 100644 --- a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dbgdt +++ b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dbgdt @@ -32,11 +32,11 @@ 1 1 - {W}Watch-0:tmppre1200151148100100200208100100100200110$PROJ_DIR$\TermIOInput.txt102001001001001001001503001001001001001001002001001 + {W}Watch-0:tmppre1200151148100100200208100100100200110$PROJ_DIR$\TermIOInput.txt102001001001001001001001503001001001001001001002001001 - + TabID-15530-21362 @@ -48,20 +48,20 @@ - 0TabID-10464-23570TasksTASKVIEW0TabID-31438-23586QueuesQUEUEVIEW0TabID-15541-875Terminal I/OTerminalIO0 + 0TabID-10464-23570TasksTASKVIEW0TabID-31438-23586QueuesQUEUEVIEW0TabID-15541-875Terminal I/OTerminalIO0 - TextEditor$WS_DIR$\serial.c095537253720TextEditor$WS_DIR$\main.c010246094609TextEditor$WS_DIR$\ParTest.c04738623862TextEditor$WS_DIR$\FreeRTOSConfig.h08648244840TextEditor$WS_DIR$\..\..\Source\list.c4013670247024TextEditor$WS_DIR$\system_and_ST_code\STM32L152_EVAL\stm32l152_eval.c03151157011570TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c012560236023TextEditor$WS_DIR$\..\Common\Minimal\comtest.c014600TextEditor$WS_DIR$\system_and_ST_code\STM32L1xx_StdPeriph_Driver\src\misc.c011744834483TextEditor$WS_DIR$\system_and_ST_code\CMSIS\CM3\DeviceSupport\ST\STM32L1xx\stm32l1xx.h089425142510100000010000001 + TextEditor$WS_DIR$\main.c0116488448840TextEditor$WS_DIR$\..\Common\Minimal\GenQTest.c05311820518238TextEditor$WS_DIR$\FreeRTOSConfig.h06143594359TextEditor$WS_DIR$\..\..\Source\portable\MemMang\heap_2.c021297759817TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c016170947094TextEditor$WS_DIR$\system_and_ST_code\stm32l1xx_it.c04522442244TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\portasm.s0100456745670100000010000001 - iaridepm.enu1debuggergui.enu1armjlink.enu1-2-2682369-2-2200200119048203666220833696538-2-2682435-2-2200200119048203666260119696538-2-21611682-2-216841631002381165988119048203666159-22321682-2159168473100238174338119048203666 + iaridepm.enu1debuggergui.enu1armjlink.enu1-2-2465369-2-2200200119048203666220833475560-2-2465435-2-2200200119048203666260119475560-2-23381682-2-216843401002381346232119048203666336-24491682-233616841131002381115071119048203666 diff --git a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dni b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dni index 0bb910e55..42f771af7 100644 --- a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dni +++ b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dni @@ -1,5 +1,5 @@ [DebugChecksum] -Checksum=317489748 +Checksum=-72575356 [DisAssemblyWindow] NumStates=_ 1 State 1=_ 1 diff --git a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.wsdt b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.wsdt index ed80139b9..3428edc3d 100644 --- a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.wsdt +++ b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.wsdt @@ -25,7 +25,7 @@ Workspace - RTOSDemoRTOSDemo/FreeRTOS_SourceRTOSDemo/Standard_Demo_Code + RTOSDemoRTOSDemo/FreeRTOS_SourceRTOSDemo/FreeRTOS_Source/PortableRTOSDemo/Standard_Demo_Code @@ -35,14 +35,14 @@ - TextEditor$WS_DIR$\serial.c095537253720TextEditor$WS_DIR$\main.c010246094609TextEditor$WS_DIR$\ParTest.c04738623862TextEditor$WS_DIR$\FreeRTOSConfig.h08648244840TextEditor$WS_DIR$\..\..\Source\list.c4013670247024TextEditor$WS_DIR$\system_and_ST_code\STM32L152_EVAL\stm32l152_eval.c03151157011570TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c012560236023TextEditor$WS_DIR$\..\Common\Minimal\comtest.c014600TextEditor$WS_DIR$\system_and_ST_code\STM32L1xx_StdPeriph_Driver\src\misc.c011744834483TextEditor$WS_DIR$\system_and_ST_code\CMSIS\CM3\DeviceSupport\ST\STM32L1xx\stm32l1xx.h089425142510100000010000001 + TextEditor$WS_DIR$\main.c0116488448840TextEditor$WS_DIR$\..\Common\Minimal\GenQTest.c05311820518238TextEditor$WS_DIR$\FreeRTOSConfig.h06143594359TextEditor$WS_DIR$\..\..\Source\portable\MemMang\heap_2.c021297759817TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c016170947094TextEditor$WS_DIR$\system_and_ST_code\stm32l1xx_it.c04522442244TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\portasm.s0100456745670100000010000001 - iaridepm.enu1-2-2740438-2-2200200119048203666261905755601-2-21981682-2-216842001002381203666119048203666 + iaridepm.enu1-2-2740438-2-2200200119048203666261905755601-2-21981682-2-216842001002381203666119048203666