]> git.sur5r.net Git - freertos/commitdiff
Update RISC-V project to used official port stubs in place of third party port.
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 7 Jul 2018 21:54:41 +0000 (21:54 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 7 Jul 2018 21:54:41 +0000 (21:54 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2558 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.cproject
FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.project
FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.settings/language.settings.xml
FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/FreeRTOSConfig.h
FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hw_platform.h
FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/main.c
FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/sample_hw_platform.h
FreeRTOS/Source/portable/GCC/RISC-V-RV32/port.c
FreeRTOS/Source/portable/GCC/RISC-V-RV32/portmacro.h

index c1655cff0f621cfea23f782285f09817fbebfc1f..4786075464d77329f42f9321d417da65684702c5 100644 (file)
@@ -49,7 +49,7 @@
                                                        <tool command="${cross_prefix}${cross_c}${cross_suffix}" commandLinePattern="${COMMAND} ${cross_toolchain_flags} ${FLAGS} -c ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" errorParsers="org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GCCErrorParser" id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler.894708922" name="GNU RISC-V Cross C Compiler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.compiler">\r
                                                                <option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.paths.1818715770" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/include}&quot;"/>\r
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/ThirdParty/GCC/RISC-V}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/RISC-V-RV32}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/drivers/CoreGPIO}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/drivers/Core16550}&quot;"/>\r
index f7313f56fac4c4ab027c7050637d5add654fb362..d89cebcba8d61ce379922b7f12e8a181926d663e 100644 (file)
                        </matcher>\r
                </filter>\r
                <filter>\r
-                       <id>1529524475525</id>\r
+                       <id>1531000165521</id>\r
                        <name>FreeRTOS_Source/portable</name>\r
                        <type>9</type>\r
                        <matcher>\r
                                <id>org.eclipse.ui.ide.multiFilter</id>\r
-                               <arguments>1.0-name-matches-false-false-ThirdParty</arguments>\r
+                               <arguments>1.0-name-matches-false-false-GCC</arguments>\r
                        </matcher>\r
                </filter>\r
                <filter>\r
-                       <id>1529524475530</id>\r
+                       <id>1531000165526</id>\r
                        <name>FreeRTOS_Source/portable</name>\r
                        <type>9</type>\r
                        <matcher>\r
                        </matcher>\r
                </filter>\r
                <filter>\r
-                       <id>1529524494421</id>\r
-                       <name>FreeRTOS_Source/portable/MemMang</name>\r
-                       <type>5</type>\r
-                       <matcher>\r
-                               <id>org.eclipse.ui.ide.multiFilter</id>\r
-                               <arguments>1.0-name-matches-false-false-heap_4.c</arguments>\r
-                       </matcher>\r
-               </filter>\r
-               <filter>\r
-                       <id>1529524515837</id>\r
-                       <name>FreeRTOS_Source/portable/ThirdParty</name>\r
+                       <id>1531000203197</id>\r
+                       <name>FreeRTOS_Source/portable/GCC</name>\r
                        <type>9</type>\r
                        <matcher>\r
                                <id>org.eclipse.ui.ide.multiFilter</id>\r
-                               <arguments>1.0-name-matches-false-false-GCC</arguments>\r
+                               <arguments>1.0-name-matches-false-false-RISC-V-RV32</arguments>\r
                        </matcher>\r
                </filter>\r
                <filter>\r
-                       <id>1529524627661</id>\r
-                       <name>FreeRTOS_Source/portable/ThirdParty/GCC</name>\r
-                       <type>9</type>\r
+                       <id>1529524494421</id>\r
+                       <name>FreeRTOS_Source/portable/MemMang</name>\r
+                       <type>5</type>\r
                        <matcher>\r
                                <id>org.eclipse.ui.ide.multiFilter</id>\r
-                               <arguments>1.0-name-matches-false-false-RISC-V</arguments>\r
+                               <arguments>1.0-name-matches-false-false-heap_4.c</arguments>\r
                        </matcher>\r
                </filter>\r
        </filteredResources>\r
index 6dc13a6a3b0e46e42d74fceb11b12e3ec144f03c..55a4eb27b60323e83347673e5c6ac2a111c93de1 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="886405286544253612" 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="-1033716199933845767" 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 0cd797d1249a94ffdffe850a5c3776f39921848e..389ddafa1099f6309c548f32abbfeff94efe5865 100644 (file)
 #include <stdint.h>\r
 #include <string.h>\r
 #include "riscv_plic.h"\r
-\r
-extern uint32_t SystemCoreClock;\r
+#include "hw_platform.h"\r
 \r
 #define configUSE_PREEMPTION                   1\r
-#define configUSE_IDLE_HOOK                            1\r
+#define configUSE_IDLE_HOOK                            0\r
 #define configUSE_TICK_HOOK                            0\r
-#define configCPU_CLOCK_HZ                     ( ( unsigned long ) 83000000 )\r
+#define configCPU_CLOCK_HZ                     ( ( unsigned long ) ( SYS_CLK_FREQ / 100UL ) ) /*_RB_ Seems to be a factor of 100 between machine timer frequency and CPU frequency. */\r
 #define configTICK_RATE_HZ                     ( ( TickType_t ) 1000 )\r
 #define configMAX_PRIORITIES           ( 5 )\r
 #define configMINIMAL_STACK_SIZE       ( ( unsigned short ) 1024 )\r
@@ -104,7 +103,7 @@ extern uint32_t SystemCoreClock;
 #define configIDLE_SHOULD_YIELD                        1\r
 #define configUSE_MUTEXES                              1\r
 #define configQUEUE_REGISTRY_SIZE              8\r
-#define configCHECK_FOR_STACK_OVERFLOW 0 //2\r
+#define configCHECK_FOR_STACK_OVERFLOW 2\r
 #define configUSE_RECURSIVE_MUTEXES            1\r
 #define configUSE_MALLOC_FAILED_HOOK   1\r
 #define configUSE_APPLICATION_TASK_TAG 0\r
index 268eba61f1553a8555e3dbe27d7641a9a7ec74ed..c6d2aa4be1770ae8a1024c4d176da0ef6a7d643f 100644 (file)
@@ -34,7 +34,7 @@
  * This is the only clock brought over from the Mi-V Soft processor Libero design.\r
  */\r
 #ifndef SYS_CLK_FREQ\r
-#define SYS_CLK_FREQ                    83000000UL\r
+#define SYS_CLK_FREQ                    50000000UL\r
 #endif\r
 \r
 /***************************************************************************//**\r
index 4ec3a71adc6127b577212d2ae75af4bf96da2cdf..c1582b7cb9be5b2f1428256a0827e99c70a6c181 100644 (file)
@@ -4,12 +4,25 @@
 #include "timers.h"\r
 \r
 #include "hw_platform.h"\r
+#include "riscv_hal.h"\r
+#include "hal.h"\r
+#include "core_gpio.h"\r
+#include "core_timer.h"\r
 #include "core_uart_apb.h"\r
-#include "task.h"\r
 \r
 const char * g_hello_msg = "\r\nFreeRTOS Example\r\n";\r
 \r
 \r
+/*\r
+ * Notes:\r
+ * + Program the device using the flash project in\r
+ *   MS-RISC-V\M2GL025-Creative-Board\Programming_The_Target_Device\PROC_SUBSYSTEM_MIV_RV32IMA_BaseDesign.\r
+ *   See https://github.com/RISCV-on-Microsemi-FPGA/M2GL025-Creative-Board.\r
+ * + Above referenced image sets the clock to 50MHz. *\r
+ * + Debug configuration is critical.\r
+ */\r
+\r
+\r
 /* A block time of zero simply means "don't block". */\r
 #define mainDONT_BLOCK                                         ( 0UL )\r
 \r
@@ -37,11 +50,22 @@ void vApplicationIdleHook( void );
  */\r
 void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );\r
 \r
+/*_RB_\r
+gpio_instance_t g_gpio0;\r
+gpio_instance_t g_gpio1;\r
+timer_instance_t g_timer0;\r
+timer_instance_t g_timer1;\r
+\r
+\r
 /*-----------------------------------------------------------*/\r
+extern uint32_t SysTick_Config(uint32_t ticks);\r
+extern void __enable_irq(void);\r
 \r
 int main( void )\r
 {\r
     PLIC_init();\r
+//_RB_    GPIO_init(&g_gpio0, COREGPIO_IN_BASE_ADDR, GPIO_APB_32_BITS_BUS);\r
+//_RB_    GPIO_init(&g_gpio1, COREGPIO_OUT_BASE_ADDR, GPIO_APB_32_BITS_BUS);\r
 \r
     /**************************************************************************\r
     * Initialize CoreUART with its base address, baud value, and line\r
@@ -55,7 +79,7 @@ int main( void )
 \r
     /* Create the two test tasks. */\r
        xTaskCreate( vUartTestTask1, "UArt1", 1000, NULL, uartPRIMARY_PRIORITY, NULL );\r
-       xTaskCreate( vUartTestTask2, "UArt2", 1000, NULL, uartPRIMARY_PRIORITY, NULL );\r
+//     xTaskCreate( vUartTestTask2, "UArt2", 1000, NULL, uartPRIMARY_PRIORITY, NULL );\r
 \r
        /* Start the kernel.  From here on, only tasks and interrupts will run. */\r
        vTaskStartScheduler();\r
@@ -117,7 +141,7 @@ static void vUartTestTask1( void *pvParameters )
        for( ;; )\r
        {\r
                UART_polled_tx_string( &g_uart, (const uint8_t *)"Task - 1\r\n" );\r
-           vTaskDelay(10);\r
+           vTaskDelay( pdMS_TO_TICKS( 100 ) );\r
        }\r
 }\r
 \r
@@ -130,7 +154,7 @@ static void vUartTestTask2( void *pvParameters )
 \r
        for( ;; )\r
        {\r
-               UART_polled_tx_string( &g_uart, (const uint8_t *)"Task - 2\r\n" );\r
+//             UART_polled_tx_string( &g_uart, (const uint8_t *)"Task - 2\r\n" );\r
            vTaskDelay(5);\r
        }\r
 }\r
index 2990bd0c0727239ddbb6f254ab7139d2677525cc..d0604a1b05b923dfc8bc94ff3f91560b8e1dc481 100644 (file)
@@ -44,6 +44,7 @@
  * <corename>_<instance>_BASE_ADDR\r
  */\r
 #define COREUARTAPB0_BASE_ADDR          0x70001000UL\r
+#define COREGPIO_BASE_ADDR              0x70002000UL\r
 #define COREGPIO_IN_BASE_ADDR           0x70002000UL\r
 #define CORETIMER0_BASE_ADDR            0x70003000UL\r
 #define CORETIMER1_BASE_ADDR            0x70004000UL\r
index f14c58ce3d162a79b0b984b63d7be27ee75b3698..0de072a32f124e764abf16790e29367fae73b700 100644 (file)
@@ -50,13 +50,15 @@ static void prvTaskExitError( void );
 \r
 void prvTaskExitError( void )\r
 {\r
+volatile uint32_t ulx = 0;\r
+\r
        /* A function that implements a task must not exit or attempt to return to\r
        its caller as there is nothing to return to.  If a task wants to exit it\r
        should instead call vTaskDelete( NULL ).\r
 \r
        Artificially force an assert() to be triggered if configASSERT() is\r
        defined, then stop here so application writers can catch the error. */\r
-       configASSERT( uxCriticalNesting == ~0UL );\r
+       configASSERT( ulx == ~0UL );\r
        portDISABLE_INTERRUPTS();\r
        for( ;; );\r
 }\r
index de8b860a58044253e7a2aa531cc9eb19b2a60bc8..0f95f3ee0ad9895560c7ff45fdea812e174841e2 100644 (file)
@@ -81,7 +81,7 @@ not need to be guarded with a critical section. */
 extern int vPortSetInterruptMask( void );\r
 extern void vPortClearInterruptMask( int );\r
 \r
-#define portSET_INTERRUPT_MASK_FROM_ISR()\r
+#define portSET_INTERRUPT_MASK_FROM_ISR() 0\r
 #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue )\r
 #define portDISABLE_INTERRUPTS()\r
 #define portENABLE_INTERRUPTS()\r