From 88cd3f263cd58a2de915dc397340a978c987f6c1 Mon Sep 17 00:00:00 2001 From: RichardBarry Date: Thu, 29 Jan 2009 16:23:52 +0000 Subject: [PATCH] Continued V850 development. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@640 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Demo/NEC_V850ES_Fx3_IAR/FreeRTOSConfig.h | 19 +- .../ParTest/ParTest_Generic_Target_Board.c | 14 +- Demo/NEC_V850ES_Fx3_IAR/main.c | 98 +- Demo/NEC_V850ES_Fx3_IAR/rtosdemo.ewd | 392 ++++++- Demo/NEC_V850ES_Fx3_IAR/rtosdemo.ewp | 978 +++++++++++++++++- .../settings/rtosdemo.cspy.bat | 2 +- .../settings/rtosdemo.dbgdt | 14 +- Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.dni | 12 +- .../NEC_V850ES_Fx3_IAR/settings/rtosdemo.wsdt | 12 +- 9 files changed, 1364 insertions(+), 177 deletions(-) diff --git a/Demo/NEC_V850ES_Fx3_IAR/FreeRTOSConfig.h b/Demo/NEC_V850ES_Fx3_IAR/FreeRTOSConfig.h index 57dc17fa6..8185de841 100644 --- a/Demo/NEC_V850ES_Fx3_IAR/FreeRTOSConfig.h +++ b/Demo/NEC_V850ES_Fx3_IAR/FreeRTOSConfig.h @@ -54,9 +54,7 @@ #ifdef __IAR_SYSTEMS_ICC__ #pragma language=extended #pragma system_include - #include - #include "io70f3385.h" #endif /* __IAR_SYSTEMS_ICC__ */ /* V850ES/Fx3 Memory Model @@ -83,11 +81,9 @@ #define configUSE_IDLE_HOOK 0 #define configUSE_TICK_HOOK 0 - #define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 48000000 ) /* using the external clock source */ #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 ) #define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 85 ) - #define configTOTAL_HEAP_SIZE ( (size_t ) ( 60000 ) ) #define configMAX_TASK_NAME_LEN ( 10 ) #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 @@ -113,6 +109,21 @@ #define INCLUDE_vTaskDelayUntil 1 #define INCLUDE_vTaskDelay 1 + /* This IAR workspace contains several different projects - each of which + is targeted at a different device variant. The definitions past this point + are dependent on the variant being used. */ + #ifdef __IAR_V850ES_Fx3__ + #include "io70f3385.h" + #define configTOTAL_HEAP_SIZE ( (size_t ) ( 60000 ) ) + #define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 48000000 ) + #endif + + #ifdef __IAR_V850ES_Jx3__ + #include "io70f3746.h" + #define configTOTAL_HEAP_SIZE ( (size_t ) ( 60000 ) ) + #define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 16000000 ) + #endif + #endif /* __IAR_SYSTEMS_ICC__ */ #endif /* FREERTOS_CONFIG_H */ diff --git a/Demo/NEC_V850ES_Fx3_IAR/ParTest/ParTest_Generic_Target_Board.c b/Demo/NEC_V850ES_Fx3_IAR/ParTest/ParTest_Generic_Target_Board.c index a91041862..4d89cdce3 100644 --- a/Demo/NEC_V850ES_Fx3_IAR/ParTest/ParTest_Generic_Target_Board.c +++ b/Demo/NEC_V850ES_Fx3_IAR/ParTest/ParTest_Generic_Target_Board.c @@ -58,7 +58,7 @@ /* Demo includes. */ #include "partest.h" -#define partstNUM_LEDs 4 +#define partstNUM_LEDs 2 #define LED0_MASK ( ( unsigned short ) 0x04 ) #define LED1_MASK ( ( unsigned short ) 0x08 ) @@ -70,7 +70,7 @@ static const unsigned short xLEDs[ partstNUM_LEDs ] = { LED0_MASK, LED1_MASK }; void vParTestInitialise( void ) { /* LED Port Initialization */ - PMCM = PM3 &= ~( LED0_MASK | LED1_MASK ); + PMCM &= ~( LED0_MASK | LED1_MASK ); } /*-----------------------------------------------------------*/ @@ -86,11 +86,11 @@ unsigned portBASE_TYPE uxLEDMask; { if( xValue ) { - PMCM |= uxLEDMask; + PCM &= ~uxLEDMask; } else { - PMCM &= ~uxLEDMask; + PCM |= uxLEDMask; } } taskEXIT_CRITICAL(); @@ -108,13 +108,13 @@ unsigned portBASE_TYPE uxLEDMask; taskENTER_CRITICAL(); { - if( PMCM & uxLEDMask ) + if( PCM & uxLEDMask ) { - PMCM &= ~uxLEDMask; + PCM &= ~uxLEDMask; } else { - PMCM |= uxLEDMask; + PCM |= uxLEDMask; } } taskEXIT_CRITICAL(); diff --git a/Demo/NEC_V850ES_Fx3_IAR/main.c b/Demo/NEC_V850ES_Fx3_IAR/main.c index 80699aca5..f88cb6622 100644 --- a/Demo/NEC_V850ES_Fx3_IAR/main.c +++ b/Demo/NEC_V850ES_Fx3_IAR/main.c @@ -111,8 +111,7 @@ mechanism is working correctly. */ #define mainERROR_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS ) /* The LEDs used by the demos. */ -#define mainCHECK_TASK_LED ( 3 ) -#define mainCOMTEST_LED ( 5 ) +#define mainCHECK_TASK_LED ( 0 ) /* The baud rate used by the comtest task. */ #define mainBAUD_RATE ( 9600 ) @@ -122,10 +121,7 @@ mechanism is working correctly. */ /* The implementation of the 'check' task as described at the top of this file. */ static void prvCheckTask( void *pvParameters ); -/* Called by the startup code to initialise the run time system. */ -unsigned portCHAR __low_level_init(void); - -/* Just sets up the LED outputs. Most generic setup is done in +/* Just sets up the LED outputs. Most generic setup is done in __low_level_init(). */ static void prvSetupHardware( void ); @@ -146,14 +142,12 @@ void main( void ) prvSetupHardware(); /* Standard demo tasks. */ - vStartLEDFlashTasks( mainFLASH_PRIORITY ); vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY ); vStartQueuePeekTasks(); vStartRecursiveMutexTasks(); vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); - vAltStartComTestTasks( mainCOMTEST_PRIORITY, mainBAUD_RATE, mainCOMTEST_LED ); /* Create the check task as described at the top of this file. */ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, mainCHECK_PARAMETER, mainCHECK_TASK_PRIORITY, NULL ); @@ -162,6 +156,15 @@ void main( void ) xTaskCreate( vRegTest1, "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); xTaskCreate( vRegTest2, "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); + /* The extra IO required for the com test and led flashing tasks is only + available on the application board, not the target boards. */ + #ifdef __IAR_V850ES_Fx3__ + { + vAltStartComTestTasks( mainCOMTEST_PRIORITY, mainBAUD_RATE, mainCOMTEST_LED ); + vStartLEDFlashTasks( mainFLASH_PRIORITY ); + } + #endif + /* The suicide tasks must be created last as they need to know how many tasks were running prior to their creation in order to ascertain whether or not the correct/expected number of tasks are running at any given time. */ @@ -236,87 +239,20 @@ portTickType xDelayPeriod = mainNO_ERROR_DELAY, xLastWakeTime; xDelayPeriod = mainERROR_DELAY; } - if( xAreComTestTasksStillRunning() != pdTRUE ) + #ifdef __IAR_V850ES_Fx3__ { - xDelayPeriod = mainERROR_DELAY; + if( xAreComTestTasksStillRunning() != pdTRUE ) + { + xDelayPeriod = mainERROR_DELAY; + } } + #endif vParTestToggleLED( mainCHECK_TASK_LED ); } } /*-----------------------------------------------------------*/ -unsigned portCHAR __low_level_init(void) -{ -unsigned portCHAR resetflag = RESF; -unsigned portCHAR psval = 0; - - /* Setup provided by NEC. */ - - /* Disable global interrupts to ensure no interrupts occur during system - setup. */ - portDISABLE_INTERRUPTS(); - - PRCMD = 0x00; - OCDM = 0x00; - VSWC = 0x12; - VSWC = 18; - - /* Set main system clock */ - OSTS = 0x06; - psval = 0x80; - PRCMD = psval; - PCC = psval; - while (!OSTC) - { - ; - } - - PLLS = 0x03; - PLLON = 1; - while (LOCKR) - { - ; - } - - psval = 0x01; - PRCMD = psval; - MCM = psval; - SELPLL = 1; - - /* Set fCPU */ - psval = PCC | 0x00; - PRCMD = psval; - PCC = psval; - RCM = 0x83; - - /* Set fXP1 */ - SELCNT4 = 0x00; - - /* Set fBRG */ - PRSM0 = 0x00; - - /* Stand-by setting */ - psval = 0x00; - PRCMD = psval; - PSC = psval; - - /* WDT2 setting */ - WDTM2 = 0x1F; - - /* PCL setting */ - PCLM = 0x00; - - /* disable dma0 - dma3 */ - E00 = 0; - E11 = 0; - E22 = 0; - E33 = 0; - - return pdTRUE; -} -/*-----------------------------------------------------------*/ - static void prvSetupHardware( void ) { /* Setup the LED outputs. */ diff --git a/Demo/NEC_V850ES_Fx3_IAR/rtosdemo.ewd b/Demo/NEC_V850ES_Fx3_IAR/rtosdemo.ewd index f6388d8a0..704679a80 100644 --- a/Demo/NEC_V850ES_Fx3_IAR/rtosdemo.ewd +++ b/Demo/NEC_V850ES_Fx3_IAR/rtosdemo.ewd @@ -367,18 +367,18 @@ - Release + V850ESJx3 V850 - 0 + 1 C-SPY 5 12 1 - 0 + 1 + + NWIV850 + 5 + + 0 + 1 + 1 + + + + + + + + + + + ROMV850 + 5 + + 0 + 1 + 1 + + + + + + + + + + + + + + + + + SIMV850 + 5 + + 0 + 1 + 1 + + + + + + + + TKSV850 + 5 + + 0 + 1 + 1 + + + + + + + + + + + $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.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\Orti\Orti.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin + 1 + + + $EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin + 0 + + + $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin + 1 + + + + + V850ESFx3 + + V850 + + 1 + + C-SPY + 5 + + 12 + 1 + 1 + + + + + + + + + + + + + + + + + EMUV850 + 5 + + 0 + 1 + 1 + + + + + + + + + + IECV850 + 5 + + 0 + 1 + 1 + + + + + + + + + MICV850 + 5 + + 1 + 1 + 1 + + + + + + + ICCV850 + 3 + + 14 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AV850 + 3 + + 5 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CUSTOM + 3 + + + + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + XLINK + 3 + + 15 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XAR + 3 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + V850ESJx3 + + V850 + + 1 + + General + 5 + + 5 + 1 + 1 + - Release + V850ESFx3 V850 - 0 + 1 General 5 5 1 - 0 + 1 @@ -1171,7 +1999,7 @@ 5 1 - 0 + 1 demo source + + LEDs + + $PROJ_DIR$\ParTest\ParTest_Fx3_App_Board.c + + V850ESJx3 + + + + $PROJ_DIR$\ParTest\ParTest_Generic_Target_Board.c + + V850ESFx3 + + + + + Low Level Init + + $PROJ_DIR$\LowLevelInit\LowLevelInit_Fx3.c + + V850ESJx3 + + + + $PROJ_DIR$\LowLevelInit\LowLevelInit_Jx3.c + + V850ESFx3 + + + Standard Demo Tasks @@ -1679,21 +2539,36 @@ $PROJ_DIR$\main.c - - $PROJ_DIR$\ParTest\ParTest.c - $PROJ_DIR$\RegTest.s85 $PROJ_DIR$\serial\serial.c + + V850ESJx3 + $PROJ_DIR$\serial\serialISR.s85 + + V850ESJx3 + kernel source + + device specific + + $PROJ_DIR$\..\..\Source\portable\IAR\V850ES_Fx3\portasm_Fx3.s85 + + V850ESJx3 + + + + $PROJ_DIR$\..\..\Source\portable\IAR\V850ES_Jx3\portasm_Jx3.s85 + + $PROJ_DIR$\..\..\Source\portable\MemMang\heap_2.c @@ -1703,9 +2578,6 @@ $PROJ_DIR$\..\..\Source\portable\IAR\V850ES_Fx3\port.c - - $PROJ_DIR$\..\..\Source\portable\IAR\V850ES_Fx3\portasm.s85 - $PROJ_DIR$\..\..\Source\queue.c diff --git a/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.cspy.bat b/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.cspy.bat index 249011721..083924712 100644 --- a/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.cspy.bat +++ b/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.cspy.bat @@ -22,7 +22,7 @@ @REM but they are listed at the end of this file for reference. -"C:\Devtools\IAR Systems\Embedded Workbench 5.0\common\bin\cspybat" "C:\Devtools\IAR Systems\Embedded Workbench 5.0\v850\bin\v850proc.dll" "C:\Devtools\IAR Systems\Embedded Workbench 5.0\v850\bin\v850minicube.dll" %1 --plugin "C:\Devtools\IAR Systems\Embedded Workbench 5.0\v850\bin\" --backend -B "-v11" "-p" "C:\Devtools\IAR Systems\Embedded Workbench 5.0\v850\CONFIG\DDF\io70f3385.ddf" "-d" "minicube" "-c2" "-en10000" +"C:\Devtools\IAR Systems\Embedded Workbench 5.0\common\bin\cspybat" "C:\Devtools\IAR Systems\Embedded Workbench 5.0\v850\bin\v850proc.dll" "C:\Devtools\IAR Systems\Embedded Workbench 5.0\v850\bin\v850minicube2.dll" %1 --plugin "C:\Devtools\IAR Systems\Embedded Workbench 5.0\v850\bin\" --backend -B "-v11" "-p" "C:\Devtools\IAR Systems\Embedded Workbench 5.0\v850\CONFIG\DDF\io70f3746.ddf" "-d" "minicube2" "-c2" @REM Loaded plugins: diff --git a/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.dbgdt b/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.dbgdt index 6e3d01720..a2228dd1d 100644 --- a/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.dbgdt +++ b/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.dbgdt @@ -16,7 +16,7 @@ - 254272727 + 270272727 @@ -27,7 +27,7 @@ - + TabID-757-1323 @@ -43,7 +43,7 @@ TabID-20969-27878Find in FilesFind-in-FilesTabID-27119-4411BreakpointsBreakpoints - 3 + 0 TabID-11505-1326 @@ -51,24 +51,24 @@ Workspace - rtosdemortosdemo/demo sourcertosdemo/demo source/Standard Demo Tasksrtosdemo/kernel sourcertosdemo/kernel source/port.c + rtosdemortosdemo/demo sourcertosdemo/kernel source - 0TabID-15636-29532WatchWatchxStartpxBlock01561051661000 + 0 - TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Source\portable\IAR\V850ES_Fx3\portmacro.h011449964996TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Demo\NEC_V850ES_Fx3_IAR\serial\serial.c021376667666TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Demo\NEC_V850ES_Fx3_IAR\main.c010443794379TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Source\portable\IAR\V850ES_Fx3\port.c06500TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Source\portable\IAR\V850ES_Fx3\portasm.s8508000TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Source\portable\MemMang\heap_2.c0216923292395TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Demo\Common\Minimal\flash.c07236903690TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Source\tasks.c017675519155191TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Demo\NEC_V850ES_Fx3_IAR\FreeRTOSConfig.h045268826880100000010000001 + TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Demo\NEC_V850ES_Fx3_IAR\main.c0119572657260TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Source\queue.c012133954939549TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Demo\NEC_V850ES_Fx3_IAR\RegTest.s85012139463946TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Source\portable\IAR\V850ES_Fx3\port.c0170793279320100000010000001 - iaridepm.enu1debuggergui.enu1-2-2740344-2-2240200142857203666205952755601-2-2740528-2-2200200119048203666315476755601-2-21981682-2-216842001002381203666142857203666 + iaridepm.enu1debuggergui.enu1-2-2740344-2-2240200142857203666205952755601-2-21981682-2-216842001002381203666142857203666 diff --git a/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.dni b/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.dni index 3ac16814f..06da2be5c 100644 --- a/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.dni +++ b/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.dni @@ -73,10 +73,10 @@ LastDevFile=unknown LastSetupFailed=0 [MINICUBE2] LastSetupFailed=0 -MapEntries=0 -HWsettings=255,0,0,0,0,0,0,0 +MapEntries=2 +HWsettings=11,33024,8155,0,160,0,0,1 HWsettings2=0 -HWsettings3=124,0 +HWsettings3=124,2 EventEntries=0 SeqName0= SeqData0=0,0,0 @@ -143,7 +143,11 @@ Tim2Stop9=0,0,0,0,0,0,0,0,0,0 CoverSettings=0,1048575,66060288,67108863,0,0,0 CoverSettings2=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Version=1 -LastDevFile=unknown +LastDevFile=DF3746.800 +Map0=0,0,1048575,1024,3 +Map1=1,67043328,67104767,60,3 +NWsettings=1,5000,0,1,FFFFFFFFFFFFFFFFFFFF +NWsettings2=1 [DisAssemblyWindow] NumStates=_ 1 State 1=_ 1 diff --git a/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.wsdt b/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.wsdt index 6975cc0af..ce45b0e5b 100644 --- a/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.wsdt +++ b/Demo/NEC_V850ES_Fx3_IAR/settings/rtosdemo.wsdt @@ -3,7 +3,7 @@ - rtosdemo/Debug + rtosdemo/V850ESJx3 @@ -17,7 +17,7 @@ 20121632481 - + TabID-30435-11592 @@ -25,24 +25,24 @@ Workspace - rtosdemortosdemo/demo sourcertosdemo/kernel source + rtosdemortosdemo/demo sourcertosdemo/demo source/Low level initrtosdemo/kernel sourcertosdemo/kernel source/device specific - 0TabID-2785-875BuildBuildTabID-21438-1140Debug LogDebug-LogTabID-21061-4073BreakpointsBreakpoints0 + 0TabID-2785-875BuildBuildTabID-21438-1140Debug LogDebug-LogTabID-21061-4073BreakpointsBreakpoints0 - 0100000010000001 + TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Demo\NEC_V850ES_Fx3_IAR\main.c0119572657260TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Source\queue.c012133954939549TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Demo\NEC_V850ES_Fx3_IAR\RegTest.s85012139463946TextEditorC:\E\Dev\FreeRTOS\WorkingCopy3\Source\portable\IAR\V850ES_Fx3\port.c0170793279320100000010000001 - iaridepm.enu1-2-2740314-2-2316205188095208758188095755601-2-21981682-2-216842001002381203666142857203666 + iaridepm.enu1-2-2740314-2-2316205188095208758188095755601-2-21981682-2-216842001002381203666142857203666 -- 2.39.5