]> git.sur5r.net Git - freertos/commitdiff
Rework RISC-V QEMU example to use vanilla Eclipse in place of Freedom Studio. NOTE...
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 22 Oct 2019 02:03:15 +0000 (02:03 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 22 Oct 2019 02:03:15 +0000 (02:03 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2747 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/.cproject
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/.project
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/FreeRTOSConfig.h
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/freedom-e-sdk/env/freedom-e300-hifive1/flash.lds
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/full_demo/RegTest.S
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/full_demo/main_full.c
FreeRTOS/Demo/RISC-V-Qemu-sifive_e-Eclipse-GCC/main.c

index debca76bc5cddec9157e365c72d387e1ab3635a8..377ae24d4bb70ec339a6e5e22a01405fd2e32634 100644 (file)
@@ -46,7 +46,7 @@
                                                        </tool>\r
                                                        <tool command="riscv64-unknown-elf-gcc.exe" id="cdt.managedbuild.tool.gnu.cross.c.linker.25704515" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker">\r
                                                                <option id="gnu.c.link.option.nostart.547444896" name="Do not use standard start files (-nostartfiles)" superClass="gnu.c.link.option.nostart" useByScannerDiscovery="false" value="true" valueType="boolean"/>\r
                                                        </tool>\r
                                                        <tool command="riscv64-unknown-elf-gcc.exe" id="cdt.managedbuild.tool.gnu.cross.c.linker.25704515" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker">\r
                                                                <option id="gnu.c.link.option.nostart.547444896" name="Do not use standard start files (-nostartfiles)" superClass="gnu.c.link.option.nostart" useByScannerDiscovery="false" value="true" valueType="boolean"/>\r
-                                                               <option id="gnu.c.link.option.ldflags.385740302" name="Linker flags" superClass="gnu.c.link.option.ldflags" useByScannerDiscovery="false" value="--specs=nano.specs -Xlinker --gc-sections -Wl,-Map,RTOSDemo.map -T../freedom-e-sdk/env/freedom-e300-hifive1/flash.lds -march=rv32imac -mabi=ilp32 -mcmodel=medlow -Xlinker --defsym=__stack_size=400 -Wl,--start-group -Wl,--end-group -Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=open -Wl,--wrap=lseek -Wl,--wrap=read -Wl,--wrap=write -Wl,--wrap=fstat -Wl,--wrap=stat -Wl,--wrap=close -Wl,--wrap=link -Wl,--wrap=unlink -Wl,--wrap=execve -Wl,--wrap=fork -Wl,--wrap=getpid -Wl,--wrap=kill -Wl,--wrap=wait -Wl,--wrap=isatty -Wl,--wrap=times -Wl,--wrap=sbrk -Wl,--wrap=_exit -Wl,--wrap=puts -Wl,--wrap=_malloc -Wl,--wrap=_free -Wl,--wrap=_open -Wl,--wrap=_lseek -Wl,--wrap=_read -Wl,--wrap=_write -Wl,--wrap=_fstat -Wl,--wrap=_stat -Wl,--wrap=_close -Wl,--wrap=_link -Wl,--wrap=_unlink -Wl,--wrap=_execve -Wl,--wrap=_fork -Wl,--wrap=_getpid -Wl,--wrap=_kill -Wl,--wrap=_wait -Wl,--wrap=_isatty -Wl,--wrap=_times -Wl,--wrap=_sbrk -Wl,--wrap=__exit -Wl,--wrap=_puts" valueType="string"/>\r
+                                                               <option id="gnu.c.link.option.ldflags.385740302" name="Linker flags" superClass="gnu.c.link.option.ldflags" useByScannerDiscovery="false" value="--specs=nano.specs -Xlinker --gc-sections -Wl,-Map,RTOSDemo.map -T../freedom-e-sdk/env/freedom-e300-hifive1/flash.lds -march=rv32imac -mabi=ilp32 -mcmodel=medlow -Xlinker --defsym=__stack_size=350 -Wl,--start-group -Wl,--end-group -Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=open -Wl,--wrap=lseek -Wl,--wrap=read -Wl,--wrap=write -Wl,--wrap=fstat -Wl,--wrap=stat -Wl,--wrap=close -Wl,--wrap=link -Wl,--wrap=unlink -Wl,--wrap=execve -Wl,--wrap=fork -Wl,--wrap=getpid -Wl,--wrap=kill -Wl,--wrap=wait -Wl,--wrap=isatty -Wl,--wrap=times -Wl,--wrap=sbrk -Wl,--wrap=_exit -Wl,--wrap=puts -Wl,--wrap=_malloc -Wl,--wrap=_free -Wl,--wrap=_open -Wl,--wrap=_lseek -Wl,--wrap=_read -Wl,--wrap=_write -Wl,--wrap=_fstat -Wl,--wrap=_stat -Wl,--wrap=_close -Wl,--wrap=_link -Wl,--wrap=_unlink -Wl,--wrap=_execve -Wl,--wrap=_fork -Wl,--wrap=_getpid -Wl,--wrap=_kill -Wl,--wrap=_wait -Wl,--wrap=_isatty -Wl,--wrap=_times -Wl,--wrap=_sbrk -Wl,--wrap=__exit -Wl,--wrap=_puts" valueType="string"/>\r
                                                                <option id="gnu.c.link.option.nostdlibs.1587538414" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>\r
                                                                <option id="gnu.c.link.option.nodeflibs.49453984" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.c.link.option.nodeflibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>\r
                                                                <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1563926647" superClass="cdt.managedbuild.tool.gnu.c.linker.input">\r
                                                                <option id="gnu.c.link.option.nostdlibs.1587538414" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>\r
                                                                <option id="gnu.c.link.option.nodeflibs.49453984" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.c.link.option.nodeflibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>\r
                                                                <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1563926647" superClass="cdt.managedbuild.tool.gnu.c.linker.input">\r
index c1f63311d8afbdecf838f30a624b044d322840f6..98117a48cf93904f1eb5408815b04edae784b9bd 100644 (file)
                        <type>1</type>\r
                        <locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c</locationURI>\r
                </link>\r
                        <type>1</type>\r
                        <locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c</locationURI>\r
                </link>\r
-               <link>\r
-                       <name>full_demo/standard_demo_tasks/GenQTest.c</name>\r
-                       <type>1</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/GenQTest.c</locationURI>\r
-               </link>\r
                <link>\r
                        <name>full_demo/standard_demo_tasks/TaskNotify.c</name>\r
                        <type>1</type>\r
                <link>\r
                        <name>full_demo/standard_demo_tasks/TaskNotify.c</name>\r
                        <type>1</type>\r
index c48a10b3a8366f9cc0c41110b830f27ff7f84cd3..3132565c1b56c12895780f42ea6134faa829988a 100644 (file)
 #define configCPU_CLOCK_HZ                             ( 10000000 ) /*QEMU*/\r
 #define configTICK_RATE_HZ                             ( ( TickType_t ) 1000 )\r
 #define configMAX_PRIORITIES                   ( 7 )\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 ) 70 )\r
+#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 105 )\r
 #define configTOTAL_HEAP_SIZE                  ( ( size_t ) 14500 )\r
 #define configMAX_TASK_NAME_LEN                        ( 16 )\r
 #define configUSE_TRACE_FACILITY               0\r
 #define configTOTAL_HEAP_SIZE                  ( ( size_t ) 14500 )\r
 #define configMAX_TASK_NAME_LEN                        ( 16 )\r
 #define configUSE_TRACE_FACILITY               0\r
 #define configUSE_TIMERS                               1\r
 #define configTIMER_TASK_PRIORITY              ( configMAX_PRIORITIES - 1 )\r
 #define configTIMER_QUEUE_LENGTH               4\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   ( 110 )\r
 \r
 /* Task priorities.  Allow these to be overridden. */\r
 #ifndef uartPRIMARY_PRIORITY\r
 \r
 /* Task priorities.  Allow these to be overridden. */\r
 #ifndef uartPRIMARY_PRIORITY\r
@@ -156,13 +156,12 @@ void vAssertCalled( void );
 /* 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 bktBLOCK_TIME_TASK_STACK_SIZE 100\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 bktBLOCK_TIME_TASK_STACK_SIZE 100\r
-#define notifyNOTIFIED_TASK_STACK_SIZE 120\r
+#define notifyNOTIFIED_TASK_STACK_SIZE 110\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 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
+#define recmuRECURSIVE_MUTEX_TEST_TASK_STACK_SIZE 110\r
 \r
 #endif /* FREERTOS_CONFIG_H */\r
 \r
 #endif /* FREERTOS_CONFIG_H */\r
index 44639ee7141950e7f2ec802659a8399399701da0..4e50e377e1822ce1afba85d9b062c5c7003b58f7 100644 (file)
@@ -17,7 +17,7 @@ PHDRS
 \r
 SECTIONS\r
 {\r
 \r
 SECTIONS\r
 {\r
-  __stack_size = DEFINED(__stack_size) ? __stack_size : 400;\r
+  __stack_size = DEFINED(__stack_size) ? __stack_size : 350;\r
 \r
   .init           :\r
   {\r
 \r
   .init           :\r
   {\r
index 8eef086e6e266336582269fcaaec7a8c5b904c4a..83b80c111406d9f5e212895267a7553fe55603aa 100644 (file)
@@ -38,7 +38,7 @@
  * main_full.c.\r
  */\r
 \r
  * main_full.c.\r
  */\r
 \r
-.align( 8 )\r
+.align( 4 )\r
 vRegTest1Implementation:\r
 \r
        /* Fill the core registers with known values. */\r
 vRegTest1Implementation:\r
 \r
        /* Fill the core registers with known values. */\r
@@ -145,15 +145,14 @@ reg1_loop:
 reg1_error_loop:\r
        /* Jump here if a register contains an uxpected value.  This stops the loop\r
        counter being incremented so the check task knows an error was found. */\r
 reg1_error_loop:\r
        /* Jump here if a register contains an uxpected value.  This stops the loop\r
        counter being incremented so the check task knows an error was found. */\r
-       ebreak\r
        jal reg1_error_loop\r
 \r
        jal reg1_error_loop\r
 \r
-.align( 16 )\r
+.align( 4 )\r
 ulRegTest1LoopCounterConst: .word ulRegTest1LoopCounter\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
 ulRegTest1LoopCounterConst: .word ulRegTest1LoopCounter\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
-.align( 8 )\r
+.align( 4 )\r
 vRegTest2Implementation:\r
 \r
        /* Fill the core registers with known values. */\r
 vRegTest2Implementation:\r
 \r
        /* Fill the core registers with known values. */\r
@@ -257,10 +256,9 @@ Reg2_loop:
 reg2_error_loop:\r
        /* Jump here if a register contains an uxpected value.  This stops the loop\r
        counter being incremented so the check task knows an error was found. */\r
 reg2_error_loop:\r
        /* Jump here if a register contains an uxpected value.  This stops the loop\r
        counter being incremented so the check task knows an error was found. */\r
-       ebreak\r
        jal reg2_error_loop\r
 \r
        jal reg2_error_loop\r
 \r
-.align( 16 )\r
+.align( 4 )\r
 ulRegTest2LoopCounterConst: .word ulRegTest2LoopCounter\r
 \r
 \r
 ulRegTest2LoopCounterConst: .word ulRegTest2LoopCounter\r
 \r
 \r
index 6c053a7ff4d6ebc1e79f4ac99dd0627683bea80e..d50f84560ae7ef1ce914a00dc4833831af374193 100644 (file)
@@ -75,7 +75,6 @@
 /* Standard demo application includes. */\r
 #include "dynamic.h"\r
 #include "blocktim.h"\r
 /* Standard demo application includes. */\r
 #include "dynamic.h"\r
 #include "blocktim.h"\r
-#include "GenQTest.h"\r
 #include "recmutex.h"\r
 #include "TimerDemo.h"\r
 #include "EventGroupsDemo.h"\r
 #include "recmutex.h"\r
 #include "TimerDemo.h"\r
 #include "EventGroupsDemo.h"\r
@@ -166,7 +165,6 @@ void main_full( void )
        kernel port. */\r
        vStartDynamicPriorityTasks();\r
        vCreateBlockTimeTasks();\r
        kernel port. */\r
        vStartDynamicPriorityTasks();\r
        vCreateBlockTimeTasks();\r
-       vStartGenericQueueTasks( tskIDLE_PRIORITY );\r
        vStartRecursiveMutexTasks();\r
        vStartTimerDemoTask( mainTIMER_TEST_PERIOD );\r
        vStartEventGroupTasks();\r
        vStartRecursiveMutexTasks();\r
        vStartTimerDemoTask( mainTIMER_TEST_PERIOD );\r
        vStartEventGroupTasks();\r
@@ -194,7 +192,6 @@ 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 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
 const char * pcStatusMessage = ".";\r
 extern void vSendString( const char * pcString );\r
 \r
 const char * pcStatusMessage = ".";\r
 extern void vSendString( const char * pcString );\r
 \r
@@ -228,11 +225,6 @@ extern void vSendString( const char * pcString );
                        pcStatusMessage = "ERROR: Block time demo/tests.\r\n";\r
                }\r
 \r
                        pcStatusMessage = "ERROR: Block time demo/tests.\r\n";\r
                }\r
 \r
-               if ( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
-               {\r
-                       pcStatusMessage = "ERROR: Generic queue demo/tests.\r\n";\r
-               }\r
-\r
                if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
                {\r
                        pcStatusMessage = "ERROR: Recursive mutex demo/tests.\r\n";\r
                if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
                {\r
                        pcStatusMessage = "ERROR: Recursive mutex demo/tests.\r\n";\r
index 07912293e2e09061bc8bc1ea630e3d169cc6cc5e..d274e16cc41107eae375bb8a90f65974df5895a7 100644 (file)
@@ -50,7 +50,8 @@
  * This project has only been tested in the QEMU emulation of the HiFive board\r
  * from SiFive.\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
+ * NOTE - Requires QEMU 1908xx or higher.  Start QEMU using the following command \r
+ * 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
  *\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
@@ -191,11 +192,13 @@ volatile uint32_t ulSetTo1ToExitFunction = 0;
 \r
 void vSendString( const char * pcString )\r
 {\r
 \r
 void vSendString( const char * pcString )\r
 {\r
+const uint32_t ulTxFifoFullBit = 0x80000000UL;\r
+\r
        while( *pcString != 0x00 )\r
        {\r
        while( *pcString != 0x00 )\r
        {\r
-               while( UART0_REG( UART_REG_TXFIFO ) & 0x80000000 );\r
+               while( ( UART0_REG( UART_REG_TXFIFO ) & ulTxFifoFullBit ) != 0UL );\r
                UART0_REG( UART_REG_TXFIFO ) = *pcString;\r
                UART0_REG( UART_REG_TXFIFO ) = *pcString;\r
-               *pcString++;\r
+               pcString++;\r
        }\r
 }\r
 \r
        }\r
 }\r
 \r