From: richardbarry Date: Fri, 15 Jan 2010 17:20:09 +0000 (+0000) Subject: Still a work in progress. Need to add flop support. X-Git-Tag: V6.0.3~29 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d67a283734945e40a17d56c2525e798a247c79a8;p=freertos Still a work in progress. Need to add flop support. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@957 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Demo/SuperH_SH7216_Renesas/RTOSDemo.tws b/Demo/SuperH_SH7216_Renesas/RTOSDemo.tws index 2303b819b..3ae1526c6 100644 --- a/Demo/SuperH_SH7216_Renesas/RTOSDemo.tws +++ b/Demo/SuperH_SH7216_Renesas/RTOSDemo.tws @@ -7,17 +7,23 @@ [GENERAL_DATA] [BREAKPOINTS] [OPEN_WORKSPACE_FILES] +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\PollQ.c" +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\FreeRTOSConfig.h" +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\intprg.c" "C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\main.c" -"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\regtest.src" -"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\vecttbl.c" "C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\port.c" "C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\portasm.src" +"C:\E\Dev\FreeRTOS\WorkingCopy\Source\queue.c" +"C:\E\Dev\FreeRTOS\WorkingCopy\Source\tasks.c" [WORKSPACE_FILE_STATES] -"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\main.c" 0 0 918 659 0 0 -"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\regtest.src" -4 -23 1016 659 1 4 -"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\vecttbl.c" 0 0 712 434 0 3 -"C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\port.c" 0 0 1400 586 0 1 -"C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\portasm.src" 0 0 805 659 0 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\PollQ.c" 44 44 838 434 0 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\FreeRTOSConfig.h" 132 132 838 434 0 6 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\intprg.c" 22 22 838 434 0 1 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\main.c" 0 0 1075 659 0 0 +"C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\port.c" 66 66 838 434 0 3 +"C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\portasm.src" 88 88 838 434 0 4 +"C:\E\Dev\FreeRTOS\WorkingCopy\Source\queue.c" -4 -23 1044 659 1 7 +"C:\E\Dev\FreeRTOS\WorkingCopy\Source\tasks.c" 110 110 838 434 0 5 [LOADED_PROJECTS] "RTOSDemo" [END] diff --git a/Demo/SuperH_SH7216_Renesas/RTOSDemo/FreeRTOSConfig.h b/Demo/SuperH_SH7216_Renesas/RTOSDemo/FreeRTOSConfig.h new file mode 100644 index 000000000..9ef7ca73e --- /dev/null +++ b/Demo/SuperH_SH7216_Renesas/RTOSDemo/FreeRTOSConfig.h @@ -0,0 +1,113 @@ +/* + FreeRTOS V6.0.2 - Copyright (C) 2009 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS eBook * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +#include "iodefine.h" + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 1 +#define configCPU_CLOCK_HZ ( 200000000UL ) +#define configPERIPHERAL_CLOCK_HZ ( 50000000UL ) +#define configTICK_RATE_HZ ( ( portTickType ) 1000 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 140 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32 * 1024 ) ) +#define configMAX_TASK_NAME_LEN ( 12 ) +#define configUSE_TRACE_FACILITY 0 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 0 +#define configUSE_CO_ROUTINES 0 +#define configUSE_MUTEXES 1 +#define configCHECK_FOR_STACK_OVERFLOW 0 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 0 +#define configGENERATE_RUN_TIME_STATS 0 +#define configUSE_MALLOC_FAILED_HOOK 1 + +#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ + +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 + + +#define configKERNEL_INTERRUPT_PRIORITY ( 1 ) +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( 0xff ) + +#define pvPortMallocAligned( x, puxStackBuffer ) ( ( puxStackBuffer == NULL ) ? ( pvPortMalloc( x ) ) : ( puxStackBuffer ) ) +#define vPortFreeAligned( x ) ( void ) x + +#endif /* FREERTOS_CONFIG_H */ diff --git a/Demo/SuperH_SH7216_Renesas/RTOSDemo/ParTest/ParTest.c b/Demo/SuperH_SH7216_Renesas/RTOSDemo/ParTest/ParTest.c index 9f785f215..6d3d74097 100644 --- a/Demo/SuperH_SH7216_Renesas/RTOSDemo/ParTest/ParTest.c +++ b/Demo/SuperH_SH7216_Renesas/RTOSDemo/ParTest/ParTest.c @@ -1,5 +1,5 @@ /* - FreeRTOS V6.0.1 - Copyright (C) 2009 Real Time Engineers Ltd. + FreeRTOS V6.0.2 - Copyright (C) 2009 Real Time Engineers Ltd. *************************************************************************** * * diff --git a/Demo/SuperH_SH7216_Renesas/RTOSDemo/RTOSDemo.hwp b/Demo/SuperH_SH7216_Renesas/RTOSDemo/RTOSDemo.hwp index d3ddb2e16..a503edb08 100644 --- a/Demo/SuperH_SH7216_Renesas/RTOSDemo/RTOSDemo.hwp +++ b/Demo/SuperH_SH7216_Renesas/RTOSDemo/RTOSDemo.hwp @@ -117,6 +117,16 @@ "Object file" "Renesas OptLinker" "Renesas SH Assembler" "Object file" "Renesas OptLinker" "Renesas SH C/C++ Compiler" [PROJECT_FILES] +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\BlockQ.c" "User" "C source file|Standard Demo Tasks" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\GenQTest.c" "User" "C source file|Standard Demo Tasks" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\PollQ.c" "User" "C source file|Standard Demo Tasks" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\QPeek.c" "User" "C source file|Standard Demo Tasks" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\blocktim.c" "User" "C source file|Standard Demo Tasks" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\death.c" "User" "C source file|Standard Demo Tasks" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\flash.c" "User" "C source file|Standard Demo Tasks" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\integer.c" "User" "C source file|Standard Demo Tasks" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\recmutex.c" "User" "C source file|Standard Demo Tasks" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\semtest.c" "User" "C source file|Standard Demo Tasks" 2 "C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\ParTest\ParTest.c" "User" "C source file" 2 "C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\dbsct.c" "User" "C source file" 2 "C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\intprg.c" "User" "C source file" 2 @@ -127,13 +137,14 @@ "C:\E\Dev\FreeRTOS\WorkingCopy\Source\list.c" "User" "C source file|FreeRTOS" 2 "C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\MemMang\heap_2.c" "User" "C source file|FreeRTOS" 2 "C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\port.c" "User" "C source file|FreeRTOS" 2 -"C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\portasm.src" "User" "Assembly source file" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\portasm.src" "User" "C source file|FreeRTOS" 2 "C:\E\Dev\FreeRTOS\WorkingCopy\Source\queue.c" "User" "C source file|FreeRTOS" 2 "C:\E\Dev\FreeRTOS\WorkingCopy\Source\tasks.c" "User" "C source file|FreeRTOS" 2 [FOLDER] "Assembly source file" "Assembly source file" "C source file" "C source file" "C source file|FreeRTOS" "" +"C source file|Standard Demo Tasks" "" [GENERAL_DATA_PROJECT] "USE_CUSTOM_LINKAGE_ORDER" "0" [ON_DEMAND_COMPONENTS_LOADED] @@ -142,7 +153,7 @@ "SessionSH7216_E10A-USB_SYSTEM__SH" "C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\SessionSH7216_E10A-USB_SYSTEM__SH.hsf" 0 [GENERAL_DATA_SESSION_SessionSH7216_E10A-USB_SYSTEM__SH] [OPTIONS_Debug_SH7216_E10A-USB_SYSTEM__SH_Renesas OptLinker] -"Single Shot" "0d47a4b27059ac10" 4 +"Single Shot" "08cd3a35ef59ac10" 4 [OPTIONS_Debug_SH7216_E10A-USB_SYSTEM__SH_Renesas SH Assembler] "Assembly source file" "05db08d6f178ac10" 3 "C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\regtest.src" "0fd8e3b27059ac10" 3 @@ -151,6 +162,16 @@ [OPTIONS_Debug_SH7216_E10A-USB_SYSTEM__SH_Renesas SH C/C++ Compiler] "C source file" "0deaf32ba059ac10" 2 "C++ source file" "0deaf32ba059ac10" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\BlockQ.c" "0b5de7fadf59ac10" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\GenQTest.c" "0b5de7fadf59ac10" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\PollQ.c" "0b5de7fadf59ac10" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\QPeek.c" "0b5de7fadf59ac10" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\blocktim.c" "0b5de7fadf59ac10" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\death.c" "0cf7e835ef59ac10" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\flash.c" "00a9f52d4f59ac10" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\integer.c" "0b5de7fadf59ac10" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\recmutex.c" "0b5de7fadf59ac10" 2 +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\semtest.c" "0b5de7fadf59ac10" 2 "C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\ParTest\ParTest.c" "0deaf32ba059ac10" 2 "C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\dbsct.c" "0deaf32ba059ac10" 2 "C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\intprg.c" "0deaf32ba059ac10" 2 diff --git a/Demo/SuperH_SH7216_Renesas/RTOSDemo/RTOSDemo.nav b/Demo/SuperH_SH7216_Renesas/RTOSDemo/RTOSDemo.nav index ac41d6529..7f4fbf13b 100644 Binary files a/Demo/SuperH_SH7216_Renesas/RTOSDemo/RTOSDemo.nav and b/Demo/SuperH_SH7216_Renesas/RTOSDemo/RTOSDemo.nav differ diff --git a/Demo/SuperH_SH7216_Renesas/RTOSDemo/SessionSH7216_E10A-USB_SYSTEM__SH.hsf b/Demo/SuperH_SH7216_Renesas/RTOSDemo/SessionSH7216_E10A-USB_SYSTEM__SH.hsf index 8138c0362..b4a52a0f1 100644 --- a/Demo/SuperH_SH7216_Renesas/RTOSDemo/SessionSH7216_E10A-USB_SYSTEM__SH.hsf +++ b/Demo/SuperH_SH7216_Renesas/RTOSDemo/SessionSH7216_E10A-USB_SYSTEM__SH.hsf @@ -8,6 +8,7 @@ "" [GENERAL_DATA] "FIRST_CONNECTION_TAG" "NO" +"MRULABELS_DATAMANAGER_KEY" "FFFFFFFF|00000000|fff80688" "RESET_CPU_AFTER_DOWNLOAD_TAG" "VARIANT_FALSE_STORE_TAG" "{08009853-4189-4ADA-848F-0F1A84AFE443}MonitorCtrlLabelAddress" "" "{08009853-4189-4ADA-848F-0F1A84AFE443}MonitorCtrlMonitorLastSaveLogDirectory" "" @@ -41,14 +42,14 @@ "{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlLogFileName" "" "{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlSplitterPosition" "242" "{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlViews" "1" -"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlWindowProperties" "18" +"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlWindowProperties" "17" "{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineWndInstanceKey0" "{WK_00000001_CmdLine}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "{313F4FC1-6566-11D5-8BBE-0004E2013C71}TclTkCtrlLogFileName" "" "{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_COMPARE_END_ADDRESS" "" "{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_COMPARE_START_ADDRESS" "" -"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_DEST_ADDRESS" "" -"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_END_ADDRESS" "" -"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_START_ADDRESS" "" +"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_DEST_ADDRESS" "fff80688" +"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_END_ADDRESS" "FFFFFFFF" +"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_START_ADDRESS" "00000000" "{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_FILL_END_ADDRESS" "" "{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_FILL_START_ADDRESS" "" "{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_MOVE_END_ADDRESS" "" @@ -80,7 +81,7 @@ "{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_SAMPLING_RATE" "1000" "{8A898260-6F1D-11D5-8EB6-00004CC34E9D}WaveformCtrlViews" "0" "{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersCtrlViews" "1" -"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0ColumnWidth" "50,307,118" +"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0ColumnWidth" "50,396,118" "{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0ECX_REGISTER_COUNT" "82" "{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0ECX_REGISTER_DISPLAYED" "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1" "{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersWnd0HideFLAGs" "1" @@ -114,7 +115,8 @@ "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth3" "200" "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000" "pxCurrentTCB, 4, 0, P, Col, Hex, MN" "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Current Scope," -"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "*, 11, 0, C0000, Exp, Hex, N" +"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "i, 10, 0, P, Col, Hex, N" +"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Current Scope," "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "pxTopOfStack, 4, 0, C0001, Col, Hex, N" "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "xGenericListItem, 11, 0, C0001, Col, Hex, N" "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "xEventListItem, 11, 0, C0001, Col, Hex, N" @@ -122,7 +124,7 @@ "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006" "pxStack, 4, 0, C0001, Col, Hex, N" "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007" "pcTaskName, 6, 0, C0001, Col, Hex, N" "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0008" "uxCriticalNesting, 2, 0, C0001, Col, Hex, N" -"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "1" +"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "2" "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "150" @@ -239,30 +241,30 @@ "{D293FA15-461F-4D9F-B9C9-64724B3409F9}T_TRACE_TRACE_ACQUISITION2" "1,0,1,1,1,1,1,0,0,0,0,0,0" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_EVAL_DENORMAL_MODE" "16777216" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_EVAL_ROUND_MODE" "768" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_0" "00000000FFF80AD4" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_1" "0000000000000001" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_10" "000000000000000B" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_11" "000000000000000C" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_12" "000000000000000D" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_13" "000000000000000E" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_14" "0000000000000022" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_15" "00000000FFF801E0" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_16" "0000000000001EF0" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_0" "00000000FFF83504" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_1" "00000000FFFFFF0F" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_10" "00000000FFFFFFFE" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_11" "00000000FFE7FFFF" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_12" "00000000FFE7FFFF" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_13" "00000000FFE7FFFF" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_14" "00000000FFF83230" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_15" "00000000FFF83500" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_16" "0000000000003B0C" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_17" "0000000000000001" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_18" "0000000000000011" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_18" "0000000000000075" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_19" "0000000000000000" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_2" "0000000000000003" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_2" "0000000000000001" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_20" "0000000000000000" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_21" "0000000000000010" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_22" "000000000000000F" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_23" "0000000000000011" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_21" "0000000000000011" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_22" "0000000000000010" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_23" "0000000000001EBE" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_24" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_25" "0000000000040001" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_26" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_27" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_28" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_29" "0000000000000000" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_3" "0000000000000004" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_3" "000000000000566C" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_30" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_31" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_32" "0000000000000000" @@ -273,7 +275,7 @@ "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_37" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_38" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_39" "0000000000000000" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_4" "0000000000000005" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_4" "00000000FFF83504" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_40" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_41" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_42" "0000000000000000" @@ -284,11 +286,11 @@ "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_47" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_48" "0000000000000000" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_49" "0000000000000000" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_5" "0000000000000006" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_6" "0000000000000007" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_7" "0000000000000008" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_8" "0000000000000009" -"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_9" "000000000000000A" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_5" "00000000FFF8328C" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_6" "00000000FFF83288" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_7" "00000000FFF832AC" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_8" "0000000000000008" +"{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_9" "0000000000000009" "{D34C8080-5A99-11D5-B1FD-00A0C9E23A58}C_REGISTER_REG_COUNT" "50" "{D595F9C0-EF22-11D5-B7DB-0000E10B3DA9}EventCtrlViews" "0" "{EEDC9300-6FBE-11D5-8613-00A024591A38}LocalsCtrlViews" "0" @@ -400,14 +402,16 @@ 0 [WINDOW_POSITION_STATE_DATA_VD1] "Help" "TOOLBAR 0" 59419 1 5 "0.00" 0 0 0 0 0 17 0 "" "0.0" -"{WK_00000001_CmdLine}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59422 0 1 "0.08" 219 0 0 350 200 18 0 "32771|32772|32778|<>|32773|32774|<>|32820|<>|32801|32824" "0.0" -"{WK_00000001_DISASSEMBLY}" "WINDOW" 0 0 0 "0.00" 0 -4 -23 1400 586 9 0 "" "0.0" +"{WK_00000001_CmdLine}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59422 0 1 "0.23" 219 0 0 350 200 17 0 "32771|32772|32778|<>|32773|32774|<>|32820|<>|32801|32824" "0.0" +"{WK_00000001_DISASSEMBLY}" "WINDOW" 0 0 0 "0.00" 0 -4 -23 892 659 9 0 "" "0.0" "{WK_00000001_EVENT}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59422 0 0 "0.50" 292 0 0 350 200 2065 0 "32774|32775|32777|<>|32780|<>" "0.0" "{WK_00000001_IO}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59422 0 3 "0.31" 219 0 0 350 200 17 0 "32817|32826|32819|32820|32821" "0.0" -"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 2 "0.92" 219 560 340 350 200 18 0 "36756|36757|36758|36759|<>|36746|36747|<>|39531|<>|39500|39534|<>|36687" "0.0" -"{WK_00000001_REGISTERS}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59421 0 0 "1.00" 293 0 0 350 200 18 0 "" "0.0" +"{WK_00000001_MEMORY}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59422 0 0 "0.60" 219 0 0 350 200 2065 0 "42202|42203|42204|42233|<>|42206|42205|42230|42229|42207|<>|42208|42209|42210|49076|42228|42227|<>|42231|42232|42234|42235|<>|42211|<>" "0.0" +"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 2 "0.73" 219 560 340 350 200 18 0 "36756|36757|36758|36759|<>|36746|36747|<>|39531|<>|39500|39534|<>|36687" "0.0" +"{WK_00000001_REGISTERS}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59421 0 0 "1.00" 265 0 0 350 200 18 0 "" "0.0" +"{WK_00000001_STACKTRACE}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59422 0 0 "0.50" 219 0 0 350 200 2065 0 "" "0.0" "{WK_00000001_STATUS}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59422 0 4 "0.50" 219 0 0 350 200 17 0 "" "0.0" -"{WK_00000001_WATCH}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59422 0 0 "0.50" 219 0 0 350 200 17 0 "32781|32783|<>|32771|32829|32772|32827|32773|<>|32786|<>|32810|32811|32831" "0.0" +"{WK_00000001_WATCH}RTOSDemoSessionSH7216_E10A-USB_SYSTEM__SH" "WINDOW" 59422 0 0 "0.27" 219 0 0 350 200 18 0 "32781|32783|<>|32771|32829|32772|32827|32773|<>|32786|<>|32810|32811|32831" "0.0" "{WK_00000002_WORKSPACE}" "WINDOW" 59420 0 0 "1.00" 340 560 340 350 200 18 0 "" "0.0" "{WK_TB00000001_STANDARD}" "TOOLBAR 0" 59419 0 2 "0.00" 0 0 0 0 0 18 0 "" "0.0" "{WK_TB00000002_EDITOR}" "TOOLBAR 0" 59419 0 0 "0.00" 0 0 0 0 0 18 0 "" "0.0" @@ -432,11 +436,14 @@ [WINDOW_POSITION_STATE_DATA_VD3] [WINDOW_POSITION_STATE_DATA_VD4] [WINDOW_Z_ORDER] -"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\regtest.src" -"C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\portasm.src" +"C:\E\Dev\FreeRTOS\WorkingCopy\Source\queue.c" "C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\main.c" +"C:\E\Dev\FreeRTOS\WorkingCopy\Source\tasks.c" +"C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\portasm.src" +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\FreeRTOSConfig.h" +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\Common\Minimal\PollQ.c" "C:\E\Dev\FreeRTOS\WorkingCopy\Source\portable\Renesas\SH2A_FPU\port.c" -"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\vecttbl.c" +"C:\E\Dev\FreeRTOS\WorkingCopy\Demo\SuperH_SH7216_Renesas\RTOSDemo\intprg.c" [TARGET_NAME] "SH7216 E10A-USB SYSTEM (SH2A-FPU)" "" 0 [STATUSBAR_STATEINFO_VD1] @@ -483,5 +490,4 @@ [FLASH_DETAILS] "" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" [BREAKPOINTS] -"c:\e\dev\freertos\workingcopy\demo\superh_sh7216_renesas\rtosdemo\regtest.src" 89 7808 1 "{00000000-0000-0000-C000-000000000046}" "" [END] diff --git a/Demo/SuperH_SH7216_Renesas/RTOSDemo/intprg.c b/Demo/SuperH_SH7216_Renesas/RTOSDemo/intprg.c index e5fee0dce..e86918037 100644 --- a/Demo/SuperH_SH7216_Renesas/RTOSDemo/intprg.c +++ b/Demo/SuperH_SH7216_Renesas/RTOSDemo/intprg.c @@ -16,7 +16,14 @@ #pragma section IntPRG // 4 Illegal code -void INT_Illegal_code(void){for( ;; ); /* sleep(); */} +#pragma interrupt (INT_Illegal_code) +void INT_Illegal_code(void) +{ +volatile int i = 0; + + while( i == 0 ); +} + // 5 Reserved // 6 Illegal slot diff --git a/Demo/SuperH_SH7216_Renesas/RTOSDemo/main.c b/Demo/SuperH_SH7216_Renesas/RTOSDemo/main.c index 758a85cac..37049b364 100644 --- a/Demo/SuperH_SH7216_Renesas/RTOSDemo/main.c +++ b/Demo/SuperH_SH7216_Renesas/RTOSDemo/main.c @@ -1,5 +1,5 @@ /* - FreeRTOS V6.0.1 - Copyright (C) 2009 Real Time Engineers Ltd. + FreeRTOS V6.0.2 - Copyright (C) 2009 Real Time Engineers Ltd. *************************************************************************** * * @@ -51,21 +51,56 @@ licensing and training services. */ +/* Kernel includes. */ #include "FreeRTOS.h" #include "task.h" +/* Demo application includes. */ +#include "BlockQ.h" +#include "death.h" +#include "integer.h" +#include "blocktim.h" +#include "flash.h" #include "partest.h" +#include "semtest.h" +#include "PollQ.h" +#include "GenQTest.h" +#include "QPeek.h" +#include "recmutex.h" +/* Constants required to configure the hardware. */ #define mainFRQCR_VALUE ( 0x0303 ) /* Input = 12.5MHz, I Clock = 200MHz, B Clock = 50MHz, P Clock = 50MHz */ +/* Task priorities. */ +#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 ) +#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 ) +#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 ) +#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY ) +#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY ) + +/* The LED toggle by the check task. */ +#define mainCHECK_LED ( 5 ) + +/* The rate at which mainCHECK_LED will toggle when all the tasks are running +without error. */ +#define mainNO_ERROR_CYCLE_TIME ( 5000 / portTICK_RATE_MS ) + +/* The rate at which mainCHECK_LED will toggle when an error has been reported +by at least one task. */ +#define mainERROR_CYCLE_TIME ( 200 / portTICK_RATE_MS ) + void vApplicationMallocFailedHook( void ); void vApplicationIdleHook( void ); static void prvSetupHardware( void ); +static void prvCheckTask( void *pvParameters ); extern void vRegTest1Task( void *pvParameters ); extern void vRegTest2Task( void *pvParameters ); -unsigned long ulRegTest1CycleCount = 0UL, ulRegTest2CycleCount = 0UL; +volatile unsigned long ulRegTest1CycleCount = 0UL, ulRegTest2CycleCount = 0UL; /*-----------------------------------------------------------*/ @@ -73,15 +108,116 @@ void main(void) { prvSetupHardware(); - xTaskCreate( vRegTest1Task, "RegTest1", configMINIMAL_STACK_SIZE, ( void * ) 0x12345678UL, 1, NULL ); - xTaskCreate( vRegTest2Task, "RegTest2", configMINIMAL_STACK_SIZE, ( void * ) 0x11223344UL, 1, NULL ); - + /* Start the reg test tasks which test the context switching mechanism. */ + xTaskCreate( vRegTest1Task, "RegTest1", configMINIMAL_STACK_SIZE, ( void * ) 0x12345678UL, tskIDLE_PRIORITY, NULL ); + xTaskCreate( vRegTest2Task, "RegTest2", configMINIMAL_STACK_SIZE, ( void * ) 0x11223344UL, tskIDLE_PRIORITY, NULL ); + + /* Start the check task as described at the top of this file. */ + xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + + /* Start the standard demo tasks. These don't perform any particular useful + functionality, other than to demonstrate the FreeRTOS API being used. */ + vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); + vCreateBlockTimeTasks(); + vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); + vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); + vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY ); + vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY ); + vStartLEDFlashTasks( mainFLASH_TASK_PRIORITY ); + vStartQueuePeekTasks(); + vStartRecursiveMutexTasks(); + + /* 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. */ +// vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY ); + + /* Start the tasks running. */ vTaskStartScheduler(); + /* Will only get here if there was insufficient heap memory to create the idle + task. Increase the configTOTAL_HEAP_SIZE setting in FreeRTOSConfig.h. */ for( ;; ); } /*-----------------------------------------------------------*/ +static void prvCheckTask( void *pvParameter ) +{ +portTickType xNextWakeTime, xCycleFrequency = mainNO_ERROR_CYCLE_TIME; +unsigned long ulLastRegTest1CycleCount = 0UL, ulLastRegTest2CycleCount = 0UL; + + /* Initialise xNextWakeTime - this only needs to be done once. */ + xNextWakeTime = xTaskGetTickCount(); + + for( ;; ) + { + /* Place this task in the blocked state until it is time to run again. */ + vTaskDelayUntil( &xNextWakeTime, xCycleFrequency ); + + /* Inspect all the other tasks to esnure none have experienced any errors. */ + if( xAreGenericQueueTasksStillRunning() != pdTRUE ) + { + /* Increase the rate at which this task cycles, which will increase the + rate at which mainCHECK_LED flashes to give visual feedback that an error + has occurred. */ + xCycleFrequency = mainERROR_CYCLE_TIME; + } + else if( xAreQueuePeekTasksStillRunning() != pdTRUE ) + { + xCycleFrequency = mainERROR_CYCLE_TIME; + } + else if( xAreBlockingQueuesStillRunning() != pdTRUE ) + { + xCycleFrequency = mainERROR_CYCLE_TIME; + } + else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) + { + xCycleFrequency = mainERROR_CYCLE_TIME; + } + else if( xAreSemaphoreTasksStillRunning() != pdTRUE ) + { + xCycleFrequency = mainERROR_CYCLE_TIME; + } + else if( xArePollingQueuesStillRunning() != pdTRUE ) + { + xCycleFrequency = mainERROR_CYCLE_TIME; + } +// else if( xIsCreateTaskStillRunning() != pdTRUE ) +// { +// xCycleFrequency = mainERROR_CYCLE_TIME; +// } + else if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) + { + xCycleFrequency = mainERROR_CYCLE_TIME; + } + else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) + { + xCycleFrequency = mainERROR_CYCLE_TIME; + } + + /* Check the reg test tasks are still cycling. They will stop incrementing + their loop counters if they encounter an error. */ + if( ulRegTest1CycleCount == ulLastRegTest1CycleCount ) + { + xCycleFrequency = mainERROR_CYCLE_TIME; + } + + if( ulRegTest2CycleCount == ulLastRegTest2CycleCount ) + { + xCycleFrequency = mainERROR_CYCLE_TIME; + } + + ulLastRegTest1CycleCount = ulRegTest1CycleCount; + ulLastRegTest2CycleCount = ulRegTest2CycleCount; + + /* Toggle the check LED to give an indication of the system status. If the + LED toggles every 5 seconds then everything is ok. A faster toggle indicates + an error. */ + vParTestToggleLED( mainCHECK_LED ); + } +} +/*-----------------------------------------------------------*/ + void vApplicationMallocFailedHook( void ) { /* A call to vPortMalloc() failed, probably during the creation of a task, @@ -100,6 +236,12 @@ void vApplicationIdleHook( void ) } /*-----------------------------------------------------------*/ +void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ) +{ + for( ;; ); +} +/*-----------------------------------------------------------*/ + static void prvSetupHardware( void ) { volatile unsigned long ul; @@ -154,25 +296,8 @@ unsigned long ulCompareMatch = ( configPERIPHERAL_CLOCK_HZ / ( configTICK_RATE_H } /*-----------------------------------------------------------*/ -void INT_CMT_CMI0( void ) +void vApplicationTickHook( void ) { -static unsigned long ul = 0; - - ul++; - if( ul >= 1000 ) - { - if( PE.DR.WORD & ( 0x01 << 9 ) ) - { - PE.DR.WORD &= ~( 0x01 << 9 ); - } - else - { - PE.DR.WORD |= ( 0x01 << 9 ); - } - - ul = 0; - } - CMT0.CMCSR.BIT.CMF = 0; } /*-----------------------------------------------------------*/ diff --git a/Demo/SuperH_SH7216_Renesas/RTOSDemo/regtest.src b/Demo/SuperH_SH7216_Renesas/RTOSDemo/regtest.src index 0cf566dbc..378484ea2 100644 --- a/Demo/SuperH_SH7216_Renesas/RTOSDemo/regtest.src +++ b/Demo/SuperH_SH7216_Renesas/RTOSDemo/regtest.src @@ -1,5 +1,5 @@ ;/* -; FreeRTOS V6.0.1 - Copyright (C) 2009 Real Time Engineers Ltd. +; FreeRTOS V6.0.2 - Copyright (C) 2009 Real Time Engineers Ltd. ; ; *************************************************************************** ; * * @@ -59,10 +59,18 @@ .export _vRegTest1Task .export _vRegTest2Task - .section P + .section P, code, align=4 + + +_vRegTest1Error: + bra _vRegTest1Error + nop + +;----------------------------------------------------------- _vRegTest1Task: + ; Fill the registers with known values. mov #3, r2 mov #4, r3 mov #5, r4 @@ -85,92 +93,212 @@ _vRegTest1Task: _vRegTest1Loop: + ; Perform a yield, just for extra test coverage. + trapa #33 + ; Reset r1 which was used in the tests. mov #2, r1 - + + ; Test that the registers still contain the expected values. If not, jump to + ; vRegTestError, which will stop this function looping and so cause it to stop + ; incrementing its loop counter. mov #2, r0 cmp/eq r0, r1 - bf _vRegTestError + bf _vRegTest1Error mov #3, r0 cmp/eq r0, r2 - bf _vRegTestError + bf _vRegTest1Error mov #4, r0 cmp/eq r0, r3 - bf _vRegTestError + bf _vRegTest1Error mov #5, r0 cmp/eq r0, r4 - bf _vRegTestError + bf _vRegTest1Error mov #6, r0 cmp/eq r0, r5 - bf _vRegTestError + bf _vRegTest1Error mov #7, r0 cmp/eq r0, r6 - bf _vRegTestError + bf _vRegTest1Error mov #8, r0 cmp/eq r0, r7 - bf _vRegTestError + bf _vRegTest1Error mov #9, r0 cmp/eq r0, r8 - bf _vRegTestError + bf _vRegTest1Error mov #10, r0 cmp/eq r0, r9 - bf _vRegTestError + bf _vRegTest1Error mov #11, r0 cmp/eq r0, r10 - bf _vRegTestError + bf _vRegTest1Error mov #12, r0 cmp/eq r0, r11 - bf _vRegTestError + bf _vRegTest1Error mov #13, r0 cmp/eq r0, r12 - bf _vRegTestError + bf _vRegTest1Error mov #14, r0 cmp/eq r0, r13 - bf _vRegTestError + bf _vRegTest1Error sts macl, r0 mov #15, r1 cmp/eq r0, r1 - bf _vRegTestError + bf _vRegTest1Error sts mach, r0 mov #16, r1 cmp/eq r0, r1 - bf _vRegTestError + bf _vRegTest1Error stc gbr, r0 mov #17, r1 cmp/eq r0, r1 - bf _vRegTestError + bf _vRegTest1Error + ; Increment the loop counter to indicate that this task is still running and + ; still healthy. mov.l #_ulRegTest1CycleCount, r0 mov.l @r0, r1 add #1, r1 mov.l r1, @r0 - bra _vRegTest1Task + ; Jump back to test all the registers again. + bra _vRegTest1Loop nop +;----------------------------------------------------------- + +_vRegTest2Error: + + bra _vRegTest2Error + nop + +;----------------------------------------------------------- + _vRegTest2Task: - trapa #33 - bra _vRegTest2Task - nop + ; Fill the registers with known values. + mov #13, r2 + mov #14, r3 + mov #15, r4 + mov #16, r5 + mov #17, r6 + mov #18, r7 + mov #19, r8 + mov #110, r9 + mov #111, r10 + mov #112, r11 + mov #113, r12 + mov #114, r13 + + mov #115, r0 + lds r0, macl + mov #116, r0 + lds r0, mach + mov #117, r0 + ldc r0, gbr -_vRegTestError: - bra _vRegTestError +_vRegTest2Loop: + + ; Reset r1 which was used in the tests. + mov #12, r1 + + ; Test that the registers still contain the expected values. If not, jump to + ; vRegTestError, which will stop this function looping and so cause it to stop + ; incrementing its loop counter. + mov #12, r0 + cmp/eq r0, r1 + bf _vRegTest2Error + + mov #13, r0 + cmp/eq r0, r2 + bf _vRegTest2Error + + mov #14, r0 + cmp/eq r0, r3 + bf _vRegTest2Error + + mov #15, r0 + cmp/eq r0, r4 + bf _vRegTest2Error + + mov #16, r0 + cmp/eq r0, r5 + bf _vRegTest2Error + + mov #17, r0 + cmp/eq r0, r6 + bf _vRegTest2Error + + mov #18, r0 + cmp/eq r0, r7 + bf _vRegTest2Error + + mov #19, r0 + cmp/eq r0, r8 + bf _vRegTest2Error + + mov #110, r0 + cmp/eq r0, r9 + bf _vRegTest2Error + + mov #111, r0 + cmp/eq r0, r10 + bf _vRegTest2Error + + mov #112, r0 + cmp/eq r0, r11 + bf _vRegTest2Error + + mov #113, r0 + cmp/eq r0, r12 + bf _vRegTest2Error + + mov #114, r0 + cmp/eq r0, r13 + bf _vRegTest2Error + + sts macl, r0 + mov #115, r1 + cmp/eq r0, r1 + bf _vRegTest2Error + + sts mach, r0 + mov #116, r1 + cmp/eq r0, r1 + bf _vRegTest2Error + + stc gbr, r0 + mov #117, r1 + cmp/eq r0, r1 + bf _vRegTest2Error + + ; Increment the loop counter to indicate that this task is still running and + ; still healthy. + mov.l #_ulRegTest2CycleCount, r0 + mov.l @r0, r1 + add #1, r1 + mov.l r1, @r0 + + ; Jump back to test all the registers again. + bra _vRegTest2Loop + nop + + .end diff --git a/Demo/SuperH_SH7216_Renesas/RTOSDemo/vecttbl.c b/Demo/SuperH_SH7216_Renesas/RTOSDemo/vecttbl.c index a0f18d465..dc8cb9d3a 100644 --- a/Demo/SuperH_SH7216_Renesas/RTOSDemo/vecttbl.c +++ b/Demo/SuperH_SH7216_Renesas/RTOSDemo/vecttbl.c @@ -15,6 +15,7 @@ extern void vPortStartFirstTask( void ); extern void vPortYield( void ); +extern void vPortPreemptiveTick( void ); #pragma section VECTTBL @@ -310,7 +311,8 @@ void *INT_Vectors[] = { // 139 Reserved (void*) Dummy, // 140 CMT CMI0 - (void*) INT_CMT_CMI0, +// (void*) INT_CMT_CMI0, + (void*) vPortPreemptiveTick, // 141 Reserved (void*) Dummy, // 142 Reserved