From bb1e1bf83291ed4dc32e59270d78beabdb21408b Mon Sep 17 00:00:00 2001 From: richardbarry Date: Mon, 3 Jan 2011 16:41:42 +0000 Subject: [PATCH] Add build configurations for small data model and small code model tests to the MSP430X CCS4 demo project. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1218 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Demo/MSP430X_MSP430F5438_CCS4/.cdtbuild | 186 +++++++++++++++++- .../org.eclipse.cdt.managedbuilder.core.prefs | 8 +- .../Demo_Source/FreeRTOSConfig.h | 9 +- .../Demo_Source/RegTest.asm | 100 +++++----- .../Demo_Source/RunTimeStatsConfig.c | 7 +- .../Demo_Source/main.c | 14 +- 6 files changed, 265 insertions(+), 59 deletions(-) diff --git a/Demo/MSP430X_MSP430F5438_CCS4/.cdtbuild b/Demo/MSP430X_MSP430F5438_CCS4/.cdtbuild index 6c0345b31..d7e95846f 100644 --- a/Demo/MSP430X_MSP430F5438_CCS4/.cdtbuild +++ b/Demo/MSP430X_MSP430F5438_CCS4/.cdtbuild @@ -3,7 +3,7 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Demo/MSP430X_MSP430F5438_CCS4/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/Demo/MSP430X_MSP430F5438_CCS4/.settings/org.eclipse.cdt.managedbuilder.core.prefs index 5271bb61e..4659fbcb0 100644 --- a/Demo/MSP430X_MSP430F5438_CCS4/.settings/org.eclipse.cdt.managedbuilder.core.prefs +++ b/Demo/MSP430X_MSP430F5438_CCS4/.settings/org.eclipse.cdt.managedbuilder.core.prefs @@ -1,9 +1,15 @@ -#Sat Jan 01 17:38:25 GMT 2011 +#Mon Jan 03 16:19:20 GMT 2011 com.ti.ccstudio.buildDefinitions.MSP430.Debug.1126147664/internalBuilder/enabled=false com.ti.ccstudio.buildDefinitions.MSP430.Debug.1126147664/internalBuilder/ignoreErr=true com.ti.ccstudio.buildDefinitions.MSP430.Debug.1203657382/internalBuilder/enabled=false com.ti.ccstudio.buildDefinitions.MSP430.Debug.1203657382/internalBuilder/ignoreErr=true +com.ti.ccstudio.buildDefinitions.MSP430.Debug.1573386325/internalBuilder/enabled=false +com.ti.ccstudio.buildDefinitions.MSP430.Debug.1573386325/internalBuilder/ignoreErr=true +com.ti.ccstudio.buildDefinitions.MSP430.Debug.1945772265/internalBuilder/enabled=false +com.ti.ccstudio.buildDefinitions.MSP430.Debug.1945772265/internalBuilder/ignoreErr=true eclipse.preferences.version=1 environment/project=\r\n\r\n environment/project/com.ti.ccstudio.buildDefinitions.MSP430.Debug.1126147664=\r\n\r\n environment/project/com.ti.ccstudio.buildDefinitions.MSP430.Debug.1203657382=\r\n\r\n +environment/project/com.ti.ccstudio.buildDefinitions.MSP430.Debug.1573386325=\r\n\r\n +environment/project/com.ti.ccstudio.buildDefinitions.MSP430.Debug.1945772265=\r\n\r\n diff --git a/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/FreeRTOSConfig.h b/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/FreeRTOSConfig.h index c2d245c79..5faff83e0 100644 --- a/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/FreeRTOSConfig.h +++ b/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/FreeRTOSConfig.h @@ -81,10 +81,9 @@ #define configCPU_CLOCK_HZ ( 16000000UL ) #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 ) -#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 70 ) #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 9 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 10 ) -#define configUSE_TRACE_FACILITY 0 +#define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 #define configUSE_MUTEXES 1 @@ -95,6 +94,12 @@ #define configUSE_MALLOC_FAILED_HOOK 1 #define configUSE_APPLICATION_TASK_TAG 0 +#ifdef __LARGE_DATA_MODEL__ + #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 80 ) +#else + #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 ) +#endif + /* Co-routine definitions. */ #define configUSE_CO_ROUTINES 0 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) diff --git a/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/RegTest.asm b/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/RegTest.asm index 8e147017f..b1dbc87f3 100644 --- a/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/RegTest.asm +++ b/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/RegTest.asm @@ -53,7 +53,7 @@ ; * The definition of the "register test" tasks, as described at the top of ; * main.c - + .include data_model.h .global usRegTest1Counter @@ -68,47 +68,47 @@ vRegTest1Task: ; Fill each general purpose register with a known value. - movx.a #0x44444, r4 - movx.a #0x55555, r5 - movx.a #0x66666, r6 - movx.a #0x77777, r7 - movx.a #0x88888, r8 - movx.a #0x99999, r9 - movx.a #0xaaaaa, r10 - movx.a #0xbbbbb, r11 - movx.a #0xccccc, r12 - movx.a #0xddddd, r13 - movx.a #0xeeeee, r14 - movx.a #0xfffff, r15 + mov_x #0x4444, r4 + mov_x #0x5555, r5 + mov_x #0x6666, r6 + mov_x #0x7777, r7 + mov_x #0x8888, r8 + mov_x #0x9999, r9 + mov_x #0xaaaa, r10 + mov_x #0xbbbb, r11 + mov_x #0xcccc, r12 + mov_x #0xdddd, r13 + mov_x #0xeeee, r14 + mov_x #0xffff, r15 prvRegTest1Loop: ; Test each general purpose register to check that it still contains the ; expected known value, jumping to vRegTest1Error if any register contains ; an unexpected value. - cmpx.a #0x44444, r4 + cmp_x #0x4444, r4 jne vRegTest1Error - cmpx.a #0x55555, r5 + cmp_x #0x5555, r5 jne vRegTest1Error - cmpx.a #0x66666, r6 + cmp_x #0x6666, r6 jne vRegTest1Error - cmpx.a #0x77777, r7 + cmp_x #0x7777, r7 jne vRegTest1Error - cmpx.a #0x88888, r8 + cmp_x #0x8888, r8 jne vRegTest1Error - cmpx.a #0x99999, r9 + cmp_x #0x9999, r9 jne vRegTest1Error - cmpx.a #0xaaaaa, r10 + cmp_x #0xaaaa, r10 jne vRegTest1Error - cmpx.a #0xbbbbb, r11 + cmp_x #0xbbbb, r11 jne vRegTest1Error - cmpx.a #0xccccc, r12 + cmp_x #0xcccc, r12 jne vRegTest1Error - cmpx.a #0xddddd, r13 + cmp_x #0xdddd, r13 jne vRegTest1Error - cmpx.a #0xeeeee, r14 + cmp_x #0xeeee, r14 jne vRegTest1Error - cmpx.a #0xfffff, r15 + cmp_x #0xffff, r15 jne vRegTest1Error ; This task is still running without jumping to vRegTest1Error, so increment @@ -130,48 +130,48 @@ vRegTest1Error: ; different values in its registers. vRegTest2Task: - movx.a #0x14441, r4 - movx.a #0x15551, r5 - movx.a #0x16661, r6 - movx.a #0x17771, r7 - movx.a #0x18881, r8 - movx.a #0x19991, r9 - movx.a #0x1aaa1, r10 - movx.a #0x1bbb1, r11 - movx.a #0x1ccc1, r12 - movx.a #0x1ddd1, r13 - movx.a #0x1eee1, r14 - movx.a #0x1fff1, r15 + mov_x #0x4441, r4 + mov_x #0x5551, r5 + mov_x #0x6661, r6 + mov_x #0x7771, r7 + mov_x #0x8881, r8 + mov_x #0x9991, r9 + mov_x #0xaaa1, r10 + mov_x #0xbbb1, r11 + mov_x #0xccc1, r12 + mov_x #0xddd1, r13 + mov_x #0xeee1, r14 + mov_x #0xfff1, r15 prvRegTest2Loop: - cmpx.a #0x14441, r4 + cmp_x #0x4441, r4 jne vRegTest2Error - cmpx.a #0x15551, r5 + cmp_x #0x5551, r5 jne vRegTest2Error - cmpx.a #0x16661, r6 + cmp_x #0x6661, r6 jne vRegTest2Error - cmpx.a #0x17771, r7 + cmp_x #0x7771, r7 jne vRegTest2Error - cmpx.a #0x18881, r8 + cmp_x #0x8881, r8 jne vRegTest2Error - cmpx.a #0x19991, r9 + cmp_x #0x9991, r9 jne vRegTest2Error - cmpx.a #0x1aaa1, r10 + cmp_x #0xaaa1, r10 jne vRegTest2Error - cmpx.a #0x1bbb1, r11 + cmp_x #0xbbb1, r11 jne vRegTest2Error - cmpx.a #0x1ccc1, r12 + cmp_x #0xccc1, r12 jne vRegTest2Error - cmpx.a #0x1ddd1, r13 + cmp_x #0xddd1, r13 jne vRegTest2Error - cmpx.a #0x1eee1, r14 + cmp_x #0xeee1, r14 jne vRegTest2Error - cmpx.a #0x1fff1, r15 + cmp_x #0xfff1, r15 jne vRegTest2Error ; Also perform a manual yield, just to increase the scope of the test. - calla #vPortYield + call_x #vPortYield incx.w &usRegTest2Counter jmp prvRegTest2Loop diff --git a/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/RunTimeStatsConfig.c b/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/RunTimeStatsConfig.c index 1718338f3..e532d222d 100644 --- a/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/RunTimeStatsConfig.c +++ b/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/RunTimeStatsConfig.c @@ -105,9 +105,14 @@ interrupt void prvRunTimeStatsOverflowISR( void ) unsigned long ulGetRunTimeStatsTime( void ) { unsigned long ulReturn; +unsigned short usCounterSnapshot; TA1CTL &= ~MC__CONTINOUS; - ulReturn = ( ( ulStatsOverflowCount << 16UL ) | ( unsigned long ) TA1R ); + _nop(); + _nop(); + ulReturn = ( ulStatsOverflowCount << 16UL ); + usCounterSnapshot = TA1R; + ulReturn |= ( unsigned long ) usCounterSnapshot; TA1CTL |= MC__CONTINOUS; return ulReturn; diff --git a/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/main.c b/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/main.c index 2c83cbf97..ba0b46bbf 100644 --- a/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/main.c +++ b/Demo/MSP430X_MSP430F5438_CCS4/Demo_Source/main.c @@ -126,7 +126,7 @@ * error has occurred. The nature of the reg test tasks necessitates that they * are written in assembly code. * - * *NOTE 2* vApplicationSetupTimerInterrupt() is called by the kernel to let + * *NOTE 1* vApplicationSetupTimerInterrupt() is called by the kernel to let * the application set up a timer to generate the tick interrupt. In this * example a timer A0 is used for this purpose. * @@ -355,8 +355,16 @@ unsigned char ucLine = 1; printf( cBuffer ); fflush( stdout ); - /* Also print out a message to - the LCD - in this case the + /* Also generate and output a + table of task states. */ + printf( "\nTask\t\tState Priority\tStack\t#\n*****************************************" ); + fflush( stdout ); + vTaskList( ( signed char * ) cBuffer ); + printf( cBuffer ); + fflush( stdout ); + + /* Finally print out a message + to the LCD - in this case the pointer to the string to print is sent directly in the ulMessageValue member of the -- 2.39.5