mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-21 22:11:57 -04:00
Rework RISC-V QEMU example to use vanilla Eclipse in place of Freedom Studio. NOTE: RISC-V QEMU mtime interrupts are not generated consistently.
This commit is contained in:
parent
ef31243396
commit
343fbe795f
|
@ -46,7 +46,7 @@
|
||||||
</tool>
|
</tool>
|
||||||
<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">
|
<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">
|
||||||
<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"/>
|
<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"/>
|
||||||
<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"/>
|
<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"/>
|
||||||
<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"/>
|
<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"/>
|
||||||
<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"/>
|
<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"/>
|
||||||
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1563926647" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1563926647" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
|
||||||
|
|
|
@ -89,11 +89,6 @@
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c</locationURI>
|
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c</locationURI>
|
||||||
</link>
|
</link>
|
||||||
<link>
|
|
||||||
<name>full_demo/standard_demo_tasks/GenQTest.c</name>
|
|
||||||
<type>1</type>
|
|
||||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/GenQTest.c</locationURI>
|
|
||||||
</link>
|
|
||||||
<link>
|
<link>
|
||||||
<name>full_demo/standard_demo_tasks/TaskNotify.c</name>
|
<name>full_demo/standard_demo_tasks/TaskNotify.c</name>
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
|
|
|
@ -102,7 +102,7 @@
|
||||||
#define configCPU_CLOCK_HZ ( 10000000 ) /*QEMU*/
|
#define configCPU_CLOCK_HZ ( 10000000 ) /*QEMU*/
|
||||||
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
|
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
|
||||||
#define configMAX_PRIORITIES ( 7 )
|
#define configMAX_PRIORITIES ( 7 )
|
||||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 70 )
|
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 105 )
|
||||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) 14500 )
|
#define configTOTAL_HEAP_SIZE ( ( size_t ) 14500 )
|
||||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||||
#define configUSE_TRACE_FACILITY 0
|
#define configUSE_TRACE_FACILITY 0
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
#define configUSE_TIMERS 1
|
#define configUSE_TIMERS 1
|
||||||
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
|
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
|
||||||
#define configTIMER_QUEUE_LENGTH 4
|
#define configTIMER_QUEUE_LENGTH 4
|
||||||
#define configTIMER_TASK_STACK_DEPTH ( 120 )
|
#define configTIMER_TASK_STACK_DEPTH ( 110 )
|
||||||
|
|
||||||
/* Task priorities. Allow these to be overridden. */
|
/* Task priorities. Allow these to be overridden. */
|
||||||
#ifndef uartPRIMARY_PRIORITY
|
#ifndef uartPRIMARY_PRIORITY
|
||||||
|
@ -156,13 +156,12 @@ void vAssertCalled( void );
|
||||||
/* Overwrite some of the stack sizes allocated to various test and demo tasks.
|
/* Overwrite some of the stack sizes allocated to various test and demo tasks.
|
||||||
Like all task stack sizes, the value is the number of words, not bytes. */
|
Like all task stack sizes, the value is the number of words, not bytes. */
|
||||||
#define bktBLOCK_TIME_TASK_STACK_SIZE 100
|
#define bktBLOCK_TIME_TASK_STACK_SIZE 100
|
||||||
#define notifyNOTIFIED_TASK_STACK_SIZE 120
|
#define notifyNOTIFIED_TASK_STACK_SIZE 110
|
||||||
#define priSUSPENDED_RX_TASK_STACK_SIZE 90
|
#define priSUSPENDED_RX_TASK_STACK_SIZE 90
|
||||||
#define tmrTIMER_TEST_TASK_STACK_SIZE 100
|
#define tmrTIMER_TEST_TASK_STACK_SIZE 100
|
||||||
#define ebRENDESVOUS_TEST_TASK_STACK_SIZE 100
|
#define ebRENDESVOUS_TEST_TASK_STACK_SIZE 100
|
||||||
#define ebEVENT_GROUP_SET_BITS_TEST_TASK_STACK_SIZE 115
|
#define ebEVENT_GROUP_SET_BITS_TEST_TASK_STACK_SIZE 115
|
||||||
#define genqMUTEX_TEST_TASK_STACK_SIZE 90
|
#define genqMUTEX_TEST_TASK_STACK_SIZE 90
|
||||||
#define genqGENERIC_QUEUE_TEST_TASK_STACK_SIZE 100
|
#define recmuRECURSIVE_MUTEX_TEST_TASK_STACK_SIZE 110
|
||||||
#define recmuRECURSIVE_MUTEX_TEST_TASK_STACK_SIZE 90
|
|
||||||
|
|
||||||
#endif /* FREERTOS_CONFIG_H */
|
#endif /* FREERTOS_CONFIG_H */
|
||||||
|
|
|
@ -17,7 +17,7 @@ PHDRS
|
||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
__stack_size = DEFINED(__stack_size) ? __stack_size : 400;
|
__stack_size = DEFINED(__stack_size) ? __stack_size : 350;
|
||||||
|
|
||||||
.init :
|
.init :
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
* main_full.c.
|
* main_full.c.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.align( 8 )
|
.align( 4 )
|
||||||
vRegTest1Implementation:
|
vRegTest1Implementation:
|
||||||
|
|
||||||
/* Fill the core registers with known values. */
|
/* Fill the core registers with known values. */
|
||||||
|
@ -145,15 +145,14 @@ reg1_loop:
|
||||||
reg1_error_loop:
|
reg1_error_loop:
|
||||||
/* Jump here if a register contains an uxpected value. This stops the loop
|
/* Jump here if a register contains an uxpected value. This stops the loop
|
||||||
counter being incremented so the check task knows an error was found. */
|
counter being incremented so the check task knows an error was found. */
|
||||||
ebreak
|
|
||||||
jal reg1_error_loop
|
jal reg1_error_loop
|
||||||
|
|
||||||
.align( 16 )
|
.align( 4 )
|
||||||
ulRegTest1LoopCounterConst: .word ulRegTest1LoopCounter
|
ulRegTest1LoopCounterConst: .word ulRegTest1LoopCounter
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
.align( 8 )
|
.align( 4 )
|
||||||
vRegTest2Implementation:
|
vRegTest2Implementation:
|
||||||
|
|
||||||
/* Fill the core registers with known values. */
|
/* Fill the core registers with known values. */
|
||||||
|
@ -257,10 +256,9 @@ Reg2_loop:
|
||||||
reg2_error_loop:
|
reg2_error_loop:
|
||||||
/* Jump here if a register contains an uxpected value. This stops the loop
|
/* Jump here if a register contains an uxpected value. This stops the loop
|
||||||
counter being incremented so the check task knows an error was found. */
|
counter being incremented so the check task knows an error was found. */
|
||||||
ebreak
|
|
||||||
jal reg2_error_loop
|
jal reg2_error_loop
|
||||||
|
|
||||||
.align( 16 )
|
.align( 4 )
|
||||||
ulRegTest2LoopCounterConst: .word ulRegTest2LoopCounter
|
ulRegTest2LoopCounterConst: .word ulRegTest2LoopCounter
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,6 @@
|
||||||
/* Standard demo application includes. */
|
/* Standard demo application includes. */
|
||||||
#include "dynamic.h"
|
#include "dynamic.h"
|
||||||
#include "blocktim.h"
|
#include "blocktim.h"
|
||||||
#include "GenQTest.h"
|
|
||||||
#include "recmutex.h"
|
#include "recmutex.h"
|
||||||
#include "TimerDemo.h"
|
#include "TimerDemo.h"
|
||||||
#include "EventGroupsDemo.h"
|
#include "EventGroupsDemo.h"
|
||||||
|
@ -166,7 +165,6 @@ void main_full( void )
|
||||||
kernel port. */
|
kernel port. */
|
||||||
vStartDynamicPriorityTasks();
|
vStartDynamicPriorityTasks();
|
||||||
vCreateBlockTimeTasks();
|
vCreateBlockTimeTasks();
|
||||||
vStartGenericQueueTasks( tskIDLE_PRIORITY );
|
|
||||||
vStartRecursiveMutexTasks();
|
vStartRecursiveMutexTasks();
|
||||||
vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
|
vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
|
||||||
vStartEventGroupTasks();
|
vStartEventGroupTasks();
|
||||||
|
@ -194,7 +192,6 @@ static void prvCheckTask( void *pvParameters )
|
||||||
const TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;
|
const TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;
|
||||||
TickType_t xLastExecutionTime;
|
TickType_t xLastExecutionTime;
|
||||||
static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
|
static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
|
||||||
const char * const pcPassMessage = "Pass";
|
|
||||||
const char * pcStatusMessage = ".";
|
const char * pcStatusMessage = ".";
|
||||||
extern void vSendString( const char * pcString );
|
extern void vSendString( const char * pcString );
|
||||||
|
|
||||||
|
@ -228,11 +225,6 @@ extern void vSendString( const char * pcString );
|
||||||
pcStatusMessage = "ERROR: Block time demo/tests.\r\n";
|
pcStatusMessage = "ERROR: Block time demo/tests.\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( xAreGenericQueueTasksStillRunning() != pdTRUE )
|
|
||||||
{
|
|
||||||
pcStatusMessage = "ERROR: Generic queue demo/tests.\r\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
|
if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "ERROR: Recursive mutex demo/tests.\r\n";
|
pcStatusMessage = "ERROR: Recursive mutex demo/tests.\r\n";
|
||||||
|
|
|
@ -50,7 +50,8 @@
|
||||||
* This project has only been tested in the QEMU emulation of the HiFive board
|
* This project has only been tested in the QEMU emulation of the HiFive board
|
||||||
* from SiFive.
|
* from SiFive.
|
||||||
*
|
*
|
||||||
* Start QEMU using the following command line:
|
* NOTE - Requires QEMU 1908xx or higher. Start QEMU using the following command
|
||||||
|
* line:
|
||||||
*
|
*
|
||||||
* [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
|
* [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
|
||||||
*
|
*
|
||||||
|
@ -191,11 +192,13 @@ volatile uint32_t ulSetTo1ToExitFunction = 0;
|
||||||
|
|
||||||
void vSendString( const char * pcString )
|
void vSendString( const char * pcString )
|
||||||
{
|
{
|
||||||
|
const uint32_t ulTxFifoFullBit = 0x80000000UL;
|
||||||
|
|
||||||
while( *pcString != 0x00 )
|
while( *pcString != 0x00 )
|
||||||
{
|
{
|
||||||
while( UART0_REG( UART_REG_TXFIFO ) & 0x80000000 );
|
while( ( UART0_REG( UART_REG_TXFIFO ) & ulTxFifoFullBit ) != 0UL );
|
||||||
UART0_REG( UART_REG_TXFIFO ) = *pcString;
|
UART0_REG( UART_REG_TXFIFO ) = *pcString;
|
||||||
*pcString++;
|
pcString++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue