]> git.sur5r.net Git - freertos/commitdiff
Allow the size of the stack used by many of the standard demo/test tasks to be overri...
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 28 Dec 2018 00:44:18 +0000 (00:44 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 28 Dec 2018 00:44:18 +0000 (00:44 +0000)
Update the Freedom Studio RISC-V project so the 'full' build configuration is now functional.

git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2614 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

15 files changed:
FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c
FreeRTOS/Demo/Common/Minimal/GenQTest.c
FreeRTOS/Demo/Common/Minimal/TaskNotify.c
FreeRTOS/Demo/Common/Minimal/TimerDemo.c
FreeRTOS/Demo/Common/Minimal/blocktim.c
FreeRTOS/Demo/Common/Minimal/dynamic.c
FreeRTOS/Demo/Common/Minimal/recmutex.c
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-FreedomStudio/.cproject
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-FreedomStudio/.settings/language.settings.xml
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-FreedomStudio/FreeRTOSConfig.h
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-FreedomStudio/freedom-e-sdk/env/freedom-e300-hifive1/dhrystone.lds
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-FreedomStudio/full_demo/main_full.c
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-FreedomStudio/main.c
FreeRTOS/Demo/WIN32-MSVC/.vs/WIN32/v14/.suo
FreeRTOS/Source/portable/GCC/RISC-V-RV32/portASM.S

index 9953082cadb1ed7795d4f85ac8702acd3afe77bc..2dc528bc544e42535953bb0154f0bffbc11fa9d9 100644 (file)
@@ -88,6 +88,14 @@ event bits in a group are unblocked as appropriate as different bits get set. */
 #define ebSELECTIVE_BITS_1             0x03\r
 #define ebSELECTIVE_BITS_2             0x05\r
 \r
+#ifndef ebRENDESVOUS_TEST_TASK_STACK_SIZE\r
+       #define ebRENDESVOUS_TEST_TASK_STACK_SIZE configMINIMAL_STACK_SIZE\r
+#endif\r
+\r
+#ifndef ebEVENT_GROUP_SET_BITS_TEST_TASK_STACK_SIZE\r
+       #define ebEVENT_GROUP_SET_BITS_TEST_TASK_STACK_SIZE     configMINIMAL_STACK_SIZE\r
+#endif\r
+\r
 /*-----------------------------------------------------------*/\r
 \r
 /*\r
@@ -179,10 +187,10 @@ TaskHandle_t xTestSlaveTaskHandle;
         *\r
         * Create the test tasks as described at the top of this file.\r
         */\r
-       xTaskCreate( prvTestSlaveTask, "WaitO", configMINIMAL_STACK_SIZE, NULL, ebWAIT_BIT_TASK_PRIORITY, &xTestSlaveTaskHandle );\r
-       xTaskCreate( prvTestMasterTask, "SetB", configMINIMAL_STACK_SIZE, ( void * ) xTestSlaveTaskHandle, ebSET_BIT_TASK_PRIORITY, NULL );\r
-       xTaskCreate( prvSyncTask, "Rndv", configMINIMAL_STACK_SIZE, ( void * ) ebRENDESVOUS_TASK_1_SYNC_BIT, ebWAIT_BIT_TASK_PRIORITY, &xSyncTask1 );\r
-       xTaskCreate( prvSyncTask, "Rndv", configMINIMAL_STACK_SIZE, ( void * ) ebRENDESVOUS_TASK_2_SYNC_BIT, ebWAIT_BIT_TASK_PRIORITY, &xSyncTask2 );\r
+       xTaskCreate( prvTestSlaveTask, "WaitO", ebRENDESVOUS_TEST_TASK_STACK_SIZE, NULL, ebWAIT_BIT_TASK_PRIORITY, &xTestSlaveTaskHandle );\r
+       xTaskCreate( prvTestMasterTask, "SetB", ebEVENT_GROUP_SET_BITS_TEST_TASK_STACK_SIZE, ( void * ) xTestSlaveTaskHandle, ebSET_BIT_TASK_PRIORITY, NULL );\r
+       xTaskCreate( prvSyncTask, "Rndv", ebRENDESVOUS_TEST_TASK_STACK_SIZE, ( void * ) ebRENDESVOUS_TASK_1_SYNC_BIT, ebWAIT_BIT_TASK_PRIORITY, &xSyncTask1 );\r
+       xTaskCreate( prvSyncTask, "Rndv", ebRENDESVOUS_TEST_TASK_STACK_SIZE, ( void * ) ebRENDESVOUS_TASK_2_SYNC_BIT, ebWAIT_BIT_TASK_PRIORITY, &xSyncTask2 );\r
 \r
        /* If the last task was created then the others will have been too. */\r
        configASSERT( xSyncTask2 );\r
index 37251f5e31fd97f9aae3c185ce6ad6695b570bb2..6f4c1e7ccefc35f9151e827b864959140c6231f6 100644 (file)
 #define genqMUTEX_MEDIUM_PRIORITY      ( tskIDLE_PRIORITY + 2 )\r
 #define genqMUTEX_HIGH_PRIORITY                ( tskIDLE_PRIORITY + 3 )\r
 \r
+#ifndef genqMUTEX_TEST_TASK_STACK_SIZE\r
+       #define configMINIMAL_STACK_SIZE\r
+#endif\r
+\r
+#ifndef genqGENERIC_QUEUE_TEST_TASK_STACK_SIZE\r
+       #define genqGENERIC_QUEUE_TEST_TASK_STACK_SIZE configMINIMAL_STACK_SIZE\r
+#endif\r
 /*-----------------------------------------------------------*/\r
 \r
 /*\r
@@ -158,7 +165,7 @@ SemaphoreHandle_t xMutex;
                /* Create the demo task and pass it the queue just created.  We are\r
                passing the queue handle by value so it does not matter that it is\r
                declared on the stack here. */\r
-               xTaskCreate( prvSendFrontAndBackTest, "GenQ", configMINIMAL_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL );\r
+               xTaskCreate( prvSendFrontAndBackTest, "GenQ", genqGENERIC_QUEUE_TEST_TASK_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL );\r
        }\r
 \r
        /* Create the mutex used by the prvMutexTest task. */\r
@@ -177,9 +184,9 @@ SemaphoreHandle_t xMutex;
                /* Create the mutex demo tasks and pass it the mutex just created.  We\r
                are passing the mutex handle by value so it does not matter that it is\r
                declared on the stack here. */\r
-               xTaskCreate( prvLowPriorityMutexTask, "MuLow", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL );\r
+               xTaskCreate( prvLowPriorityMutexTask, "MuLow", genqMUTEX_TEST_TASK_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL );\r
                xTaskCreate( prvMediumPriorityMutexTask, "MuMed", configMINIMAL_STACK_SIZE, NULL, genqMUTEX_MEDIUM_PRIORITY, &xMediumPriorityMutexTask );\r
-               xTaskCreate( prvHighPriorityMutexTask, "MuHigh", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask );\r
+               xTaskCreate( prvHighPriorityMutexTask, "MuHigh", genqMUTEX_TEST_TASK_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask );\r
 \r
                /* If INCLUDE_xTaskAbortDelay is set then additional tests are performed,\r
                requiring two instances of prvHighPriorityMutexTask(). */\r
index e4b4cd46b8297fbdfe9dbad48784f73bd74afd70..8e3aee1d497e26c815550f21cdd0656dc940ce4d 100644 (file)
 /* Demo program include files. */\r
 #include "TaskNotify.h"\r
 \r
+/* Allow parameters to be overridden on a demo by demo basis. */\r
+#ifndef notifyNOTIFIED_TASK_STACK_SIZE\r
+       #define notifyNOTIFIED_TASK_STACK_SIZE configMINIMAL_STACK_SIZE\r
+#endif\r
+\r
 #define notifyTASK_PRIORITY            ( tskIDLE_PRIORITY )\r
 #define notifyUINT32_MAX       ( ( uint32_t ) 0xffffffff )\r
 #define notifySUSPENDED_TEST_TIMER_PERIOD pdMS_TO_TICKS( 50 )\r
@@ -104,7 +109,12 @@ void vStartTaskNotifyTask( void  )
 {\r
        /* Create the task that performs some tests by itself, then loops around\r
        being notified by both a software timer and an interrupt. */\r
-       xTaskCreate( prvNotifiedTask, "Notified", configMINIMAL_STACK_SIZE, NULL, notifyTASK_PRIORITY, &xTaskToNotify );\r
+       xTaskCreate( prvNotifiedTask, /* Function that implements the task. */\r
+                                "Notified", /* Text name for the task - for debugging only - not used by the kernel. */\r
+                                notifyNOTIFIED_TASK_STACK_SIZE, /* Task's stack size in words, not bytes!. */\r
+                                NULL, /* Task parameter, not used in this case. */\r
+                                notifyTASK_PRIORITY, /* Task priority, 0 is the lowest. */\r
+                                &xTaskToNotify ); /* Used to pass a handle to the task out is needed, otherwise set to NULL. */\r
 \r
        /* Pseudo seed the random number generator. */\r
        uxNextRand = ( size_t ) prvRand;\r
index 02c9d29ac0f25c916965bd46d89a5eff7dfbccc7..1e980b05819ef342277bd331efc6def848a71f5d 100644 (file)
 \r
 #define tmrdemoDONT_BLOCK                              ( ( TickType_t ) 0 )\r
 #define tmrdemoONE_SHOT_TIMER_PERIOD   ( xBasePeriod * ( TickType_t ) 3 )\r
-#define trmdemoNUM_TIMER_RESETS                        ( ( uint8_t ) 10 )\r
+#define tmrdemoNUM_TIMER_RESETS                        ( ( uint8_t ) 10 )\r
+\r
+#ifndef tmrTIMER_TEST_TASK_STACK_SIZE\r
+       #define tmrTIMER_TEST_TASK_STACK_SIZE configMINIMAL_STACK_SIZE\r
+#endif\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -137,7 +141,7 @@ void vStartTimerDemoTask( TickType_t xBasePeriodIn )
        task, which will then preempt this task). */\r
        if( xTestStatus != pdFAIL )\r
        {\r
-               xTaskCreate( prvTimerTestTask, "Tmr Tst", configMINIMAL_STACK_SIZE, NULL, configTIMER_TASK_PRIORITY - 1, NULL );\r
+               xTaskCreate( prvTimerTestTask, "Tmr Tst", tmrTIMER_TEST_TASK_STACK_SIZE, NULL, configTIMER_TASK_PRIORITY - 1, NULL );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -546,7 +550,7 @@ uint8_t ucTimer;
                configASSERT( xTestStatus );\r
        }\r
 \r
-       for( ucTimer = 0; ucTimer < trmdemoNUM_TIMER_RESETS; ucTimer++ )\r
+       for( ucTimer = 0; ucTimer < tmrdemoNUM_TIMER_RESETS; ucTimer++ )\r
        {\r
                /* Delay for half as long as the one shot timer period, then reset it.\r
                It should never expire while this is done, so its callback count should\r
index 5b25d8c73af9317a859719179306f4ffb067992d..44dd2208e0846f64764d319ffbb1f735f03e7ac1 100644 (file)
@@ -39,7 +39,7 @@
 /* Demo includes. */\r
 #include "blocktim.h"\r
 \r
-/* Task priorities.  Allow these to be overridden. */\r
+/* Task priorities and stack sizes.  Allow these to be overridden. */\r
 #ifndef bktPRIMARY_PRIORITY\r
        #define bktPRIMARY_PRIORITY             ( configMAX_PRIORITIES - 3 )\r
 #endif\r
        #define bktSECONDARY_PRIORITY   ( configMAX_PRIORITIES - 4 )\r
 #endif\r
 \r
+#ifndef bktBLOCK_TIME_TASK_STACK_SIZE\r
+       #define bktBLOCK_TIME_TASK_STACK_SIZE configMINIMAL_STACK_SIZE\r
+#endif\r
+\r
 /* Task behaviour. */\r
 #define bktQUEUE_LENGTH                                ( 5 )\r
 #define bktSHORT_WAIT                          pdMS_TO_TICKS( ( TickType_t ) 20 )\r
@@ -111,8 +115,8 @@ void vCreateBlockTimeTasks( void )
                vQueueAddToRegistry( xTestQueue, "Block_Time_Queue" );\r
 \r
                /* Create the two test tasks. */\r
-               xTaskCreate( vPrimaryBlockTimeTestTask, "BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
-               xTaskCreate( vSecondaryBlockTimeTestTask, "BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
+               xTaskCreate( vPrimaryBlockTimeTestTask, "BTest1", bktBLOCK_TIME_TASK_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
+               xTaskCreate( vSecondaryBlockTimeTestTask, "BTest2", bktBLOCK_TIME_TASK_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
index dd90d7f0d201adf3fdc65de8971c1f8ed394f720..ba17e03f7eeba289bd6701ee3a2a8585b60cec22 100644 (file)
@@ -105,6 +105,9 @@ static portTASK_FUNCTION_PROTO( vQueueReceiveWhenSuspendedTask, pvParameters );
 static portTASK_FUNCTION_PROTO( vQueueSendWhenSuspendedTask, pvParameters );\r
 \r
 /* Demo task specific constants. */\r
+#ifndef priSUSPENDED_RX_TASK_STACK_SIZE\r
+       #define priSUSPENDED_RX_TASK_STACK_SIZE                 ( configMINIMAL_STACK_SIZE )\r
+#endif\r
 #define priSTACK_SIZE                          ( configMINIMAL_STACK_SIZE )\r
 #define priSLEEP_TIME                          pdMS_TO_TICKS( 128 )\r
 #define priLOOPS                                       ( 5 )\r
@@ -159,9 +162,9 @@ void vStartDynamicPriorityTasks( void )
 \r
                xTaskCreate( vContinuousIncrementTask, "CNT_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY, &xContinuousIncrementHandle );\r
                xTaskCreate( vLimitedIncrementTask, "LIM_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY + 1, &xLimitedIncrementHandle );\r
-               xTaskCreate( vCounterControlTask, "C_CTRL", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+               xTaskCreate( vCounterControlTask, "C_CTRL", priSUSPENDED_RX_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
                xTaskCreate( vQueueSendWhenSuspendedTask, "SUSP_TX", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
-               xTaskCreate( vQueueReceiveWhenSuspendedTask, "SUSP_RX", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+               xTaskCreate( vQueueReceiveWhenSuspendedTask, "SUSP_RX", priSUSPENDED_RX_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
index dc5db2188f7a51f63e00db46f530393dad289c0d..232b7e4d3b3db4feac91a7f808538257767b67f9 100644 (file)
@@ -85,6 +85,10 @@ be overridden by a definition in FreeRTOSConfig.h. */
 #define recmuNO_DELAY                                  ( ( TickType_t ) 0 )\r
 #define recmu15ms_DELAY                                        ( pdMS_TO_TICKS( 15 ) )\r
 \r
+#ifndef recmuRECURSIVE_MUTEX_TEST_TASK_STACK_SIZE\r
+       #define recmuRECURSIVE_MUTEX_TEST_TASK_STACK_SIZE configMINIMAL_STACK_SIZE\r
+#endif\r
+\r
 /* The three tasks as described at the top of this file. */\r
 static void prvRecursiveMutexControllingTask( void *pvParameters );\r
 static void prvRecursiveMutexBlockingTask( void *pvParameters );\r
@@ -119,9 +123,9 @@ void vStartRecursiveMutexTasks( void )
                defined to be less than 1. */\r
                vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Recursive_Mutex" );\r
 \r
-               xTaskCreate( prvRecursiveMutexControllingTask, "Rec1", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );\r
-               xTaskCreate( prvRecursiveMutexBlockingTask, "Rec2", configMINIMAL_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );\r
-               xTaskCreate( prvRecursiveMutexPollingTask, "Rec3", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, NULL );\r
+               xTaskCreate( prvRecursiveMutexControllingTask, "Rec1", recmuRECURSIVE_MUTEX_TEST_TASK_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );\r
+               xTaskCreate( prvRecursiveMutexBlockingTask, "Rec2", recmuRECURSIVE_MUTEX_TEST_TASK_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );\r
+               xTaskCreate( prvRecursiveMutexPollingTask, "Rec3", recmuRECURSIVE_MUTEX_TEST_TASK_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, NULL );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
index 67f12793c5bcb80314d172a0f1cffe728a21105e..b963a9fc95330f73ccca7400372464be55bf840d 100644 (file)
@@ -56,7 +56,7 @@
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freedom-e-sdk/drivers}&quot;"/>\r
                                                                </option>\r
                                                                <option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.other.855588508" name="Other assembler flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.other" useByScannerDiscovery="false" value="-c" valueType="string"/>\r
-                                                               <option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.flags.179185022" name="Assembler flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.flags" useByScannerDiscovery="false" valueType="stringList"/>\r
+                                                               <option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.flags.179185022" name="Assembler flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.flags" useByScannerDiscovery="false"/>\r
                                                                <option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs.1636772541" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs" useByScannerDiscovery="true" valueType="definedSymbols">\r
                                                                        <listOptionValue builtIn="false" value="portasmHANDLE_INTERRUPT=handle_trap"/>\r
                                                                </option>\r
index d1fe8090645b01119060c98fcd0590df39f390c8..7ac15d6a2aaa4626fc6cd31dc724fc9aa93547d2 100644 (file)
@@ -5,7 +5,7 @@
                        <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>\r
                        <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>\r
                        <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>\r
-                       <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1445704774232250253" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">\r
+                       <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1688908204914985791" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">\r
                                <language-scope id="org.eclipse.cdt.core.gcc"/>\r
                                <language-scope id="org.eclipse.cdt.core.g++"/>\r
                        </provider>\r
@@ -16,7 +16,7 @@
                        <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>\r
                        <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>\r
                        <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>\r
-                       <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1449619206437459651" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">\r
+                       <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1692822637120195189" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">\r
                                <language-scope id="org.eclipse.cdt.core.gcc"/>\r
                                <language-scope id="org.eclipse.cdt.core.g++"/>\r
                        </provider>\r
index ec696dba37d74752c55792a9f431c20f1d2fea83..f239c1c3ca9f7a2064dcc6ff64f21be815e77af3 100644 (file)
 \r
 #include "platform.h"\r
 \r
+/*\r
+ * For some reason the standard demo timer demo/test tasks fail when executing\r
+ * in QEMU, although they pass on other RISC-V platforms.  This requires\r
+ * further investigation, but for now, defining _WINDOWS_ has the effect of\r
+ * using the wider timer test thresholds that are normally only used when the\r
+ * tests are used with the FreeRTOS Windows port (which is not deterministic\r
+ * and therefore requires wider margins).\r
+ */\r
+#define _WINDOWS_\r
+\r
 /*-----------------------------------------------------------\r
  * Application specific definitions.\r
  *\r
 #define configCPU_CLOCK_HZ                             ( 10000000 ) /*QEMU*/\r
 #define configTICK_RATE_HZ                             ( ( TickType_t ) 1000 )\r
 #define configMAX_PRIORITIES                   ( 7 )\r
-#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 95 )\r
-#define configTOTAL_HEAP_SIZE                  ( ( size_t ) 14300 )\r
+#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 70 )\r
+#define configTOTAL_HEAP_SIZE                  ( ( size_t ) 14100 )\r
 #define configMAX_TASK_NAME_LEN                        ( 16 )\r
 #define configUSE_TRACE_FACILITY               0\r
 #define configUSE_16_BIT_TICKS                 0\r
 #define configUSE_APPLICATION_TASK_TAG 0\r
 #define configUSE_COUNTING_SEMAPHORES  1\r
 #define configGENERATE_RUN_TIME_STATS  0\r
+#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1\r
 \r
 /* Co-routine definitions. */\r
 #define configUSE_CO_ROUTINES                  0\r
 #define configUSE_TIMERS                               1\r
 #define configTIMER_TASK_PRIORITY              ( configMAX_PRIORITIES - 1 )\r
 #define configTIMER_QUEUE_LENGTH               4\r
-#define configTIMER_TASK_STACK_DEPTH   ( 120 )\r
+#define configTIMER_TASK_STACK_DEPTH   ( 100 )\r
 \r
 /* Task priorities.  Allow these to be overridden. */\r
 #ifndef uartPRIMARY_PRIORITY\r
@@ -141,13 +152,14 @@ void vAssertCalled( void );
 \r
 /* Overwrite some of the stack sizes allocated to various test and demo tasks.\r
 Like all task stack sizes, the value is the number of words, not bytes. */\r
-#define configTIMER_TEST_TASK_STACK_SIZE 150\r
-#define configNOTIFIED_TEST_TASK_STACK_SIZE 130\r
-#define configEVENT_GROUP_SET_BIT_TEST_TASK_STACK_SIZE 110\r
-#define configEVENT_GROUP_RENDEZVOUS_TASK_STACK_SIZE 100\r
-#define configRECURSIVE_MUTEX_TASK_STACK_SIZE 110\r
-#define configBLOCK_TIME_TEST_TASK_STACK_SIZE 110\r
-\r
-#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1\r
+#define bktBLOCK_TIME_TASK_STACK_SIZE 100\r
+#define notifyNOTIFIED_TASK_STACK_SIZE 120\r
+#define priSUSPENDED_RX_TASK_STACK_SIZE 90\r
+#define tmrTIMER_TEST_TASK_STACK_SIZE 100\r
+#define ebRENDESVOUS_TEST_TASK_STACK_SIZE 100\r
+#define ebEVENT_GROUP_SET_BITS_TEST_TASK_STACK_SIZE 115\r
+#define genqMUTEX_TEST_TASK_STACK_SIZE 90\r
+#define genqGENERIC_QUEUE_TEST_TASK_STACK_SIZE 100\r
+#define recmuRECURSIVE_MUTEX_TEST_TASK_STACK_SIZE 90\r
 \r
 #endif /* FREERTOS_CONFIG_H */\r
index a01b661366753ad93d5415e842646fb69133a94f..302bf743b043ad5a79a17d5f8d781fdf24e82a0e 100644 (file)
@@ -17,7 +17,7 @@ PHDRS
 \r
 SECTIONS\r
 {\r
-  __stack_size = DEFINED(__stack_size) ? __stack_size : 2K;\r
+  __stack_size = DEFINED(__stack_size) ? __stack_size : 1K;\r
 \r
   .init           :\r
   {\r
index eeaab9d7154bc7876b19db00668561a2caa45965..a71ff0d5c778202fa1c8247ab6ee13834cb7c8d4 100644 (file)
@@ -57,7 +57,9 @@
  * the standard demo tasks, and the register check tasks, are not only still\r
  * executing, but are executing without reporting any errors.  If the check task\r
  * discovers that a task has either stalled, or reported an error, then it\r
- * prints an error message to the UART, otherwise it prints "Pass.".\r
+ * prints an error message to the UART, otherwise it prints "Pass" followed\r
+ * by an additional period (".") after each successful loop of its implementing\r
+ * function.\r
  */\r
 \r
 /* Standard includes. */\r
@@ -89,7 +91,7 @@
 \r
 /* The period of the check task, in ms, converted to ticks using the\r
 pdMS_TO_TICKS() macro. */\r
-#define mainNO_ERROR_CHECK_TASK_PERIOD         pdMS_TO_TICKS( 3000UL )\r
+#define mainNO_ERROR_CHECK_TASK_PERIOD         pdMS_TO_TICKS( 5000UL )\r
 \r
 /* Parameters that are passed into the register check tasks solely for the\r
 purpose of ensuring parameters are passed into tasks correctl5. */\r
@@ -101,10 +103,10 @@ purpose of ensuring parameters are passed into tasks correctl5. */
 \r
 /* The size of the stack allocated to the check task (as described in the\r
 comments at the top of this file. */\r
-#define mainCHECK_TASK_STACK_SIZE_WORDS 110\r
+#define mainCHECK_TASK_STACK_SIZE_WORDS 85\r
 \r
 /* Size of the stacks to allocated for the register check tasks. */\r
-#define mainREG_TEST_STACK_SIZE_WORDS 70\r
+#define mainREG_TEST_STACK_SIZE_WORDS 50\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -148,17 +150,6 @@ volatile uint32_t ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL;
 \r
 void main_full( void )\r
 {\r
-       /* Start all the other standard demo/test tasks.  They have no particular\r
-       functionality, but do demonstrate how to use the FreeRTOS API and test the\r
-       kernel port. */\r
-       vStartDynamicPriorityTasks();\r
-       vCreateBlockTimeTasks();\r
-       vStartGenericQueueTasks( tskIDLE_PRIORITY );\r
-       vStartRecursiveMutexTasks();\r
-//     vStartTimerDemoTask( mainTIMER_TEST_PERIOD );\r
-//     vStartEventGroupTasks();\r
-       vStartTaskNotifyTask();\r
-\r
        /* Create the register check tasks, as described at the top of this     file.\r
        Use xTaskCreateStatic() to create a task using only statically allocated\r
        memory. */\r
@@ -170,10 +161,20 @@ void main_full( void )
                                 NULL );                                                /* Can be used to pass out a handle to the created task. */\r
        xTaskCreate( prvRegTestTaskEntry2, "Reg2", mainREG_TEST_STACK_SIZE_WORDS, mainREG_TEST_TASK_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
 \r
+       /* Start all the other standard demo/test tasks.  They have no particular\r
+       functionality, but do demonstrate how to use the FreeRTOS API and test the\r
+       kernel port. */\r
+       vStartDynamicPriorityTasks();\r
+       vCreateBlockTimeTasks();\r
+       vStartGenericQueueTasks( tskIDLE_PRIORITY );\r
+       vStartRecursiveMutexTasks();\r
+       vStartTimerDemoTask( mainTIMER_TEST_PERIOD );\r
+       vStartEventGroupTasks();\r
+       vStartTaskNotifyTask();\r
+\r
        /* Create the task that performs the 'check' functionality,     as described at\r
        the top of this file. */\r
-//     xTaskCreate( prvCheckTask, "Check", mainCHECK_TASK_STACK_SIZE_WORDS, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
-       xTaskCreate( prvCheckTask, "Check", mainCHECK_TASK_STACK_SIZE_WORDS, NULL, tskIDLE_PRIORITY, NULL );\r
+       xTaskCreate( prvCheckTask, "Check", mainCHECK_TASK_STACK_SIZE_WORDS, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
 \r
        /* Start the scheduler. */\r
        vTaskStartScheduler();\r
@@ -193,12 +194,14 @@ static void prvCheckTask( void *pvParameters )
 const TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;\r
 TickType_t xLastExecutionTime;\r
 static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;\r
-const char * const pcPassMessage = "Pass.\r\n";\r
-const char * pcStatusMessage = pcPassMessage;\r
+const char * const pcPassMessage = "Pass";\r
+const char * pcStatusMessage = ".";\r
 \r
        /* Just to stop compiler warnings. */\r
        ( void ) pvParameters;\r
 \r
+       write( STDOUT_FILENO, pcPassMessage, strlen( pcPassMessage ) );\r
+\r
        /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()\r
        works correctly. */\r
        xLastExecutionTime = xTaskGetTickCount();\r
@@ -238,12 +241,12 @@ const char * pcStatusMessage = pcPassMessage;
 \r
                if( xAreTimerDemoTasksStillRunning( ( TickType_t ) xDelayPeriod ) != pdPASS )\r
                {\r
-//                     pcStatusMessage = "ERROR: Timer demo/tests.\r\n";\r
+                       pcStatusMessage = "ERROR: Timer demo/tests.\r\n";\r
                }\r
 \r
                if( xAreEventGroupTasksStillRunning() != pdPASS )\r
                {\r
-//                     pcStatusMessage = "ERROR: Event group demo/tests.\r\n";\r
+                       pcStatusMessage = "ERROR: Event group demo/tests.\r\n";\r
                }\r
 \r
                if( xAreTaskNotificationTasksStillRunning() != pdPASS )\r
@@ -311,7 +314,7 @@ void vFullDemoTickHook( void )
 {\r
        /* Called from vApplicationTickHook() when the project is configured to\r
        build the full demo. */\r
-//     vTimerPeriodicISRTests();\r
-//     vPeriodicEventGroupsProcessing();\r
+       vTimerPeriodicISRTests();\r
+       vPeriodicEventGroupsProcessing();\r
        xNotifyTaskFromISR();\r
 }\r
index ec5fd76245c68d0af7ec17ac82cf93d24bd6e421..6bfdefb05eb1d91cd9dd475cdb58d3897f9557b4 100644 (file)
  * THE http://www.FreeRTOS.org WEB SITE FOR FULL INFORMATION ON USING THIS DEMO\r
  * APPLICATION, AND ITS ASSOCIATE FreeRTOS ARCHITECTURE PORT!\r
  *\r
+ *\r
+ * NOTE 1:\r
+ *\r
+ * This project has only been tested in the QEMU emulation of the HiFive board\r
+ * from SiFive.\r
+ *\r
+ * Start QEMU using the following command line:\r
+ *\r
+ * [your_path_1]\qemu-system-riscv32 -kernel [your_path_2]\FreeRTOS\Demo\RISC-V-Qemu-sifive_e-FreedomStudio\Debug\RTOSDemo.elf -S -s -machine sifive_e\r
+ *\r
+ * Where [your_path_1] must be replaced with the correct path to your QEMU\r
+ * installation and the elf file generated by this project respectively.\r
+ *\r
+ *\r
+ * NOTE 2:\r
+ *\r
+ * Start GDB using the following command line (this can be entered in the\r
+ * Eclipse Debug Launch Configuration dialogue):\r
+ *\r
+ * riscv64-unknown-elf-gdb.exe -iex "set mem inaccessible-by-default off" -iex "set arch riscv:rv32" -iex "set riscv use_compressed_breakpoint off"\r
+ *\r
+ *\r
+ * Note 3:\r
+ *\r
+ * Status information is sent to the QEMU serial console.\r
  */\r
 \r
 /* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,\r
@@ -98,7 +123,6 @@ void vApplicationMallocFailedHook( void )
        to query the size of free heap space that remains (although it does not\r
        provide information on how the remaining heap might be fragmented). */\r
        taskDISABLE_INTERRUPTS();\r
-//     __asm volatile( "ebreak" );\r
        for( ;; );\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -126,7 +150,6 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
        configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2.  This hook\r
        function is called if a stack overflow is detected. */\r
        taskDISABLE_INTERRUPTS();\r
-//     __asm volatile( "ebreak" );\r
        for( ;; );\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -148,7 +171,6 @@ void vAssertCalled( void )
 volatile uint32_t ulSetTo1ToExitFunction = 0;\r
 \r
        taskDISABLE_INTERRUPTS();\r
-//     __asm volatile( "ebreak" );\r
        while( ulSetTo1ToExitFunction != 1 )\r
        {\r
                __asm volatile( "NOP" );\r
index 11cf75261bbdc5678c1a45f798db6cad9f36322d..976c93a877d32a153d063b6fe2e182e1dcb79c5a 100644 (file)
Binary files a/FreeRTOS/Demo/WIN32-MSVC/.vs/WIN32/v14/.suo and b/FreeRTOS/Demo/WIN32-MSVC/.vs/WIN32/v14/.suo differ
index eddad68c64882bc9d288babc0903b7a58cdf2f8c..2abafd461dd23ab3e638490543215c55b19c73fd 100644 (file)
@@ -64,7 +64,7 @@ definitions. */
 #endif\r
 \r
 #ifndef portasmHANDLE_INTERRUPT\r
-       #error portasmHANDLE_INTERRUPT must be defined to the function to be called to handle external/peripheral interrupts.  portASM_HANDLE_INTERRUPT can be defined on the assmbler command line or in the appropriate freertos_risc_v_port_specific_extensions.h header file.\r
+       #error portasmHANDLE_INTERRUPT must be defined to the function to be called to handle external/peripheral interrupts.  portasmHANDLE_INTERRUPT can be defined on the assmbler command line or in the appropriate freertos_risc_v_port_specific_extensions.h header file.\r
 #endif\r
 \r
 #ifndef portasmSAVE_ADDITIONAL_REGISTERS\r