From 0308ff3f1ee181438f4b3e9ab8f4ddff6bc42d97 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Mon, 3 Jan 2011 11:30:11 +0000 Subject: [PATCH] Start to adjust to support both small and large memory models in the MSP430X IAR demo. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1214 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h | 7 +- Demo/MSP430X_MSP430F5438_IAR/RTOSDemo.ewd | 368 +------ Demo/MSP430X_MSP430F5438_IAR/RTOSDemo.ewp | 902 +----------------- Demo/MSP430X_MSP430F5438_IAR/RegTest.s43 | 97 +- .../lnk430F5438A_mod.xcl | 4 +- Demo/MSP430X_MSP430F5438_IAR/main.c | 14 +- .../settings/RTOSDemo.dbgdt | 12 +- .../settings/RTOSDemo.dni | 4 +- .../settings/RTOSDemo.wsdt | 6 +- 9 files changed, 88 insertions(+), 1326 deletions(-) diff --git a/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h b/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h index 654e7c847..275b90df3 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h +++ b/Demo/MSP430X_MSP430F5438_IAR/FreeRTOSConfig.h @@ -72,7 +72,6 @@ #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 ) ( 10 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 10 ) #define configUSE_TRACE_FACILITY 0 @@ -86,6 +85,12 @@ #define configUSE_MALLOC_FAILED_HOOK 1 #define configUSE_APPLICATION_TASK_TAG 0 +#if __DATA_MODEL__ == __DATA_MODEL_SMALL__ + #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 ) +#else + #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 70 ) +#endif + /* Co-routine definitions. */ #define configUSE_CO_ROUTINES 0 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) diff --git a/Demo/MSP430X_MSP430F5438_IAR/RTOSDemo.ewd b/Demo/MSP430X_MSP430F5438_IAR/RTOSDemo.ewd index 0828b08a0..59fce204a 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/RTOSDemo.ewd +++ b/Demo/MSP430X_MSP430F5438_IAR/RTOSDemo.ewd @@ -3,7 +3,7 @@ 2 - Debug + Debug_Large_Data_Model MSP430 @@ -368,372 +368,6 @@ - - Release - - MSP430 - - 1 - - C-SPY - 4 - - 25 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 430FET - 1 - - 22 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SIM430 - 1 - - 4 - 1 - 1 - - - - - - - - - - - $TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin - 1 - - - $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin - 1 - - - $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin - 0 - - - $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin - 0 - - - $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\FreeRTOS\FreeRTOSPlugin.ewplugin - 0 - - - $EW_DIR$\common\plugins\OpenRTOS\OpenRTOSPlugin.ewplugin - 0 - - - $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin - 0 - - - $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin - 1 - - - $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin - 1 - - - diff --git a/Demo/MSP430X_MSP430F5438_IAR/RTOSDemo.ewp b/Demo/MSP430X_MSP430F5438_IAR/RTOSDemo.ewp index 2d3fc825c..6dd4adb01 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/RTOSDemo.ewp +++ b/Demo/MSP430X_MSP430F5438_IAR/RTOSDemo.ewp @@ -3,7 +3,7 @@ 2 - Debug + Debug_Large_Data_Model MSP430 @@ -17,15 +17,15 @@ 1 - - - - CUSTOM - 3 - - - - - - - BICOMP - 0 - - - - BUILDACTION - 1 - - - - - - - XLINK - 4 - - 22 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - XAR - 4 - - 0 - 1 - 1 - - - - - - - BILINK - 0 - - - - - Release - - MSP430 - - 1 - - General - 7 - - 27 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ICC430 - 4 - - 30 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A430 - 4 - - 13 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43 b/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43 index 98478adc6..bbebf1604 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43 +++ b/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43 @@ -52,6 +52,7 @@ */ #include "msp430.h" #include "FreeRTOSConfig.h" +#include "data_model.h" /* * The definition of the "register test" tasks, as described at the top of @@ -72,47 +73,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 @@ -134,44 +135,44 @@ 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. */ diff --git a/Demo/MSP430X_MSP430F5438_IAR/lnk430F5438A_mod.xcl b/Demo/MSP430X_MSP430F5438_IAR/lnk430F5438A_mod.xcl index 999d1f6e0..fd9ddefd8 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/lnk430F5438A_mod.xcl +++ b/Demo/MSP430X_MSP430F5438_IAR/lnk430F5438A_mod.xcl @@ -207,9 +207,9 @@ // *** Modified to place code in high memory and insodoing, testing the port. // Original code -//-Z(CONST)DATA20_C,DATA20_ID=5C00-FF7F,10000-45BFF +-Z(CONST)DATA20_C,DATA20_ID=5C00-FF7F,10000-45BFF // Modified code --Z(CONST)DATA20_C,DATA20_ID=10000-45BFF +//-Z(CONST)DATA20_C,DATA20_ID=10000-45BFF // ------------------------------------- diff --git a/Demo/MSP430X_MSP430F5438_IAR/main.c b/Demo/MSP430X_MSP430F5438_IAR/main.c index b904b10bd..e38845e62 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/main.c +++ b/Demo/MSP430X_MSP430F5438_IAR/main.c @@ -183,6 +183,9 @@ information. */ /* The maximum number of lines of text that can be displayed on the LCD. */ #define mainMAX_LCD_LINES ( 8 ) + +/* Just used to ensure parameters are passed into tasks correctly. */ +#define mainTASK_PARAMETER_CHECK_VALUE ( ( void * ) 0xDEAD ) /*-----------------------------------------------------------*/ /* @@ -266,7 +269,7 @@ void main( void ) /* Create the LCD, button poll and register test tasks, as described at the top of this file. */ - xTaskCreate( prvLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE * 2, NULL, mainLCD_TASK_PRIORITY, NULL ); + xTaskCreate( prvLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE * 2, mainTASK_PARAMETER_CHECK_VALUE, mainLCD_TASK_PRIORITY, NULL ); xTaskCreate( prvButtonPollTask, ( signed char * ) "BPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, NULL, 0, NULL ); xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, NULL, 0, NULL ); @@ -304,6 +307,15 @@ unsigned char ucLine = 1; First print out the number of bytes that remain in the FreeRTOS heap. This can be viewed in the terminal IO window within the IAR Embedded Workbench. */ printf( "%d bytes of heap space remain unallocated\n", ( int ) xPortGetFreeHeapSize() ); + fflush( stdout ); + + /* Just as a test of the port, and for no functional reason, check the task + parameter contains its expected value. */ + if( pvParameters != mainTASK_PARAMETER_CHECK_VALUE ) + { + halLcdPrintLine( "Invalid parameter", ucLine, OVERWRITE_TEXT ); + ucLine++; + } for( ;; ) { diff --git a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dbgdt b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dbgdt index a5ae7b67e..a4de2e749 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dbgdt +++ b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dbgdt @@ -26,12 +26,12 @@ 200111 - 20030010{W}Watch-0:TA1CTL4{W}Watch-0:ulSP_PC_Combined4300134139124100300Debug-Log300200100100100100100100150110$PROJ_DIR$\TermIOInput.txt10300150150300300001001300100100100100100100 + 20030010{W}Watch-0:TA1CTL4{W}Watch-0:ulSP_PC_Combined4300134139124100300Debug-Log300200100100100100100100150200110$PROJ_DIR$\TermIOInput.txt10300150150300300001001300100100100100100100 - + TabID-11539-27703 @@ -39,24 +39,24 @@ Workspace - RTOSDemo + RTOSDemoRTOSDemo/FreeRTOS_SourceRTOSDemo/FreeRTOS_Source/Portable - 0TabID-12395-27916Terminal I/OTerminalIO0TabID-26682-3495Debug LogDebug-Log0 + 0TabID-31440-8210Debug LogDebug-Log0TabID-22030-8386Terminal I/OTerminalIO0 - TextEditor$WS_DIR$\main.c0227120651206500100000010000001 + TextEditor$WS_DIR$\main.c024212197121970TextEditor$WS_DIR$\..\..\Source\portable\IAR\MSP430X\portext.s43014353395339TextEditor$WS_DIR$\FreeRTOSConfig.h07043854385TextEditor$WS_DIR$\..\..\Source\tasks.c016015126751267TextEditor$WS_DIR$\..\..\Source\portable\IAR\MSP430X\portmacro.h04836523697TextEditor$WS_DIR$\RegTest.s4303931503150TextEditor$WS_DIR$\..\..\Source\portable\IAR\MSP430X\data_model.h04031243124TextEditor$WS_DIR$\..\..\Source\portable\IAR\MSP430X\port.c011657895789TextEditor$WS_DIR$\lnk430F5438A_mod.xcl0177512351230100000010000001 - iaridepm.enu1430fet1debuggergui.enu1-2-2716191-2-212115072024152749114881731161-2-2716376-2-212115072024152749225000731161-2-21981682-2-216842001002381203666119048203666 + iaridepm.enu1430fet1debuggergui.enu1-2-2716191-2-212115072024152749114881731161-2-2716470-2-2200200119048203666280952731161-2-21981682-2-216842001002381203666119048203666 diff --git a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dni b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dni index e460b1315..855b4641b 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dni +++ b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.dni @@ -1,5 +1,5 @@ [DebugChecksum] -Checksum=-1276943022 +Checksum=-130781403 [DisAssemblyWindow] NumStates=_ 1 State 1=_ 1 @@ -39,7 +39,7 @@ LogFile=_ "" Enabled=0 [DriverProfiling] Enabled=0 -Mode=20158624 +Mode=151407352 Graph=0 Symbiont=0 [Breakpoints] diff --git a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.wsdt b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.wsdt index 41f77d35e..ede8c1352 100644 --- a/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.wsdt +++ b/Demo/MSP430X_MSP430F5438_IAR/settings/RTOSDemo.wsdt @@ -3,7 +3,7 @@ - RTOSDemo/Debug + RTOSDemo/Debug_Large_Data_Model @@ -53,14 +53,14 @@ - TextEditor$WS_DIR$\main.c0227120651206500100000010000001 + TextEditor$WS_DIR$\main.c041125611256100100000010000001 - iaridepm.enu1-2-2645309-2-2331267197024271894185119658859-2-22931682-2-216842951002381300407197024271894 + iaridepm.enu1-2-2645309-2-2331267197024271894185119658859-2-22931682-2-216842951002381300407197024271894 -- 2.39.5