<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=""${workspace_loc:/${ProjName}/FreeRTOS_Source/include}""/>\r
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/ThirdParty/GCC/RISC-V}""/>\r
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/RISC-V-RV32}""/>\r
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}}""/>\r
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/drivers/CoreGPIO}""/>\r
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/drivers/Core16550}""/>\r
</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
<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 "${INPUTS}"" 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 "${INPUTS}"" 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
#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
#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
* 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
#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
*/\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
\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
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
\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
* <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
\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
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