forked from FreeRTOS/FreeRTOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend qemu virt riscv demo (FreeRTOS#774)
* Simple blinky demo working. Not tried full demo yet. * Get the full demo running. * Add Eclipse project to build the RISC-V_RV32_QEMU_VIRT_GCC gcc makefile. * Add regtest tasks to the RISC-V_RV32_QEMU_VIRT_GCC demo. * Update priority of the timer task. * Adjust timer frequency and optimisation level before committing prior to rearranging the Eclipse project. * Reorganise Eclipse project slightly. * Add note to the RISC-V-Qemu-virt_GCC readme file about the updated version in RISC-V_RV32_QEMU_VIRT_GCC. * Update headers in newly added source files so they pass the automated header check. * Update lexicon to pass automated spell check. Co-authored-by: none <>
- Loading branch information
1 parent
0744c28
commit 4629138
Showing
20 changed files
with
2,542 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
FreeRTOS/Demo/RISC-V_RV32_QEMU_VIRT_GCC/FreeRTOSConfig.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/* | ||
* FreeRTOS V202112.00 | ||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
* this software and associated documentation files (the "Software"), to deal in | ||
* the Software without restriction, including without limitation the rights to | ||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
* the Software, and to permit persons to whom the Software is furnished to do so, | ||
* subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* https://www.FreeRTOS.org | ||
* https://github.com/FreeRTOS | ||
* | ||
*/ | ||
|
||
#ifndef FREERTOS_CONFIG_H | ||
#define FREERTOS_CONFIG_H | ||
|
||
#include "riscv-virt.h" | ||
|
||
/*----------------------------------------------------------- | ||
* Application specific definitions. | ||
* | ||
* These definitions should be adjusted for your particular hardware and | ||
* application requirements. | ||
* | ||
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE | ||
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. | ||
* | ||
* See http://www.freertos.org/a00110.html | ||
*----------------------------------------------------------*/ | ||
|
||
/* See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html */ | ||
#define configMTIME_BASE_ADDRESS ( CLINT_ADDR + CLINT_MTIME ) | ||
#define configMTIMECMP_BASE_ADDRESS ( CLINT_ADDR + CLINT_MTIMECMP ) | ||
#define configISR_STACK_SIZE_WORDS ( 300 ) | ||
|
||
#define configUSE_PREEMPTION 1 | ||
#define configUSE_IDLE_HOOK 0 | ||
#define configUSE_TICK_HOOK 1 | ||
#define configCPU_CLOCK_HZ ( ( unsigned long ) 25000000 ) | ||
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) | ||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 120 ) | ||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 80 * 1024 ) ) | ||
#define configMAX_TASK_NAME_LEN ( 12 ) | ||
#define configUSE_TRACE_FACILITY 0 | ||
#define configUSE_16_BIT_TICKS 0 | ||
#define configIDLE_SHOULD_YIELD 0 | ||
#define configUSE_CO_ROUTINES 0 | ||
#define configUSE_MUTEXES 1 | ||
#define configUSE_RECURSIVE_MUTEXES 1 | ||
#define configCHECK_FOR_STACK_OVERFLOW 2 | ||
#define configUSE_MALLOC_FAILED_HOOK 1 | ||
#define configUSE_QUEUE_SETS 1 | ||
#define configUSE_COUNTING_SEMAPHORES 1 | ||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 | ||
|
||
#define configMAX_PRIORITIES ( 9UL ) | ||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) | ||
#define configQUEUE_REGISTRY_SIZE 10 | ||
#define configSUPPORT_STATIC_ALLOCATION 1 | ||
|
||
/* Timer related defines. */ | ||
#define configUSE_TIMERS 1 | ||
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 3 ) | ||
#define configTIMER_QUEUE_LENGTH 20 | ||
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 ) | ||
|
||
#define configUSE_TASK_NOTIFICATIONS 1 | ||
#define configTASK_NOTIFICATION_ARRAY_ENTRIES 3 | ||
|
||
/* Set the following definitions to 1 to include the API function, or zero | ||
to exclude the API function. */ | ||
|
||
#define INCLUDE_vTaskPrioritySet 1 | ||
#define INCLUDE_uxTaskPriorityGet 1 | ||
#define INCLUDE_vTaskDelete 1 | ||
#define INCLUDE_vTaskCleanUpResources 0 | ||
#define INCLUDE_vTaskSuspend 1 | ||
#define INCLUDE_vTaskDelayUntil 1 | ||
#define INCLUDE_vTaskDelay 1 | ||
#define INCLUDE_uxTaskGetStackHighWaterMark 1 | ||
#define INCLUDE_xTaskGetSchedulerState 1 | ||
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1 | ||
#define INCLUDE_xTaskGetIdleTaskHandle 1 | ||
#define INCLUDE_xSemaphoreGetMutexHolder 1 | ||
#define INCLUDE_eTaskGetState 1 | ||
#define INCLUDE_xTimerPendFunctionCall 1 | ||
#define INCLUDE_xTaskAbortDelay 1 | ||
#define INCLUDE_xTaskGetHandle 1 | ||
|
||
/* This demo makes use of one or more example stats formatting functions. These | ||
format the raw data provided by the uxTaskGetSystemState() function in to human | ||
readable ASCII form. See the notes in the implementation of vTaskList() within | ||
FreeRTOS/Source/tasks.c for limitations. */ | ||
#define configUSE_STATS_FORMATTING_FUNCTIONS 1 | ||
|
||
/* The QEMU target is capable of running all the tests tasks at the same | ||
* time. */ | ||
#define configRUN_ADDITIONAL_TESTS 1 | ||
|
||
void vAssertCalled( const char *pcFileName, uint32_t ulLine ); | ||
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ ); | ||
|
||
/* The test that checks the trigger level on stream buffers requires an | ||
allowable margin of error on slower processors (slower than the Win32 | ||
machine on which the test is developed). */ | ||
#define configSTREAM_BUFFER_TRIGGER_LEVEL_TEST_MARGIN 2 | ||
|
||
#define intqHIGHER_PRIORITY ( configMAX_PRIORITIES - 5 ) | ||
#define bktPRIMARY_PRIORITY ( configMAX_PRIORITIES - 4 ) | ||
#define bktSECONDARY_PRIORITY ( configMAX_PRIORITIES - 5 ) | ||
|
||
#endif /* FREERTOS_CONFIG_H */ |
55 changes: 55 additions & 0 deletions
55
FreeRTOS/Demo/RISC-V_RV32_QEMU_VIRT_GCC/build/gcc/.cproject
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> | ||
<storageModule moduleId="org.eclipse.cdt.core.settings"> | ||
<cconfiguration id="0.208514950"> | ||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.208514950" moduleId="org.eclipse.cdt.core.settings" name="Default"> | ||
<externalSettings/> | ||
<extensions> | ||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | ||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | ||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | ||
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | ||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> | ||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> | ||
</extensions> | ||
</storageModule> | ||
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> | ||
<configuration buildProperties="" description="" id="0.208514950" name="Default" optionalBuildProperties="" parent="org.eclipse.cdt.build.core.prefbase.cfg"> | ||
<folderInfo id="0.208514950." name="/" resourcePath=""> | ||
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1104818234" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain"> | ||
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1104818234.1571743114" name=""/> | ||
<builder id="org.eclipse.cdt.build.core.settings.default.builder.1258987068" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.settings.default.builder"/> | ||
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1255019096" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/> | ||
<tool id="org.eclipse.cdt.build.core.settings.holder.2025884899" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder"> | ||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.876141242" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> | ||
</tool> | ||
<tool id="org.eclipse.cdt.build.core.settings.holder.2088826057" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder"> | ||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.707688561" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> | ||
</tool> | ||
<tool id="org.eclipse.cdt.build.core.settings.holder.1095452603" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder"> | ||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1783280172" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> | ||
</tool> | ||
</toolChain> | ||
</folderInfo> | ||
</configuration> | ||
</storageModule> | ||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> | ||
</cconfiguration> | ||
</storageModule> | ||
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> | ||
<project id="RTOSDemo.null.342773888" name="RTOSDemo"/> | ||
</storageModule> | ||
<storageModule moduleId="scannerConfiguration"> | ||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> | ||
<scannerConfigBuildInfo instanceId="0.208514950"> | ||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> | ||
</scannerConfigBuildInfo> | ||
</storageModule> | ||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> | ||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> | ||
<storageModule moduleId="refreshScope" versionNumber="2"> | ||
<configuration configurationName="Default"> | ||
<resource resourceType="PROJECT" workspacePath="/RTOSDemo"/> | ||
</configuration> | ||
</storageModule> | ||
</cproject> |
181 changes: 181 additions & 0 deletions
181
FreeRTOS/Demo/RISC-V_RV32_QEMU_VIRT_GCC/build/gcc/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>RTOSDemo</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | ||
<triggers>clean,full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> | ||
<triggers>full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.cdt.core.cnature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> | ||
</natures> | ||
<linkedResources> | ||
<link> | ||
<name>FreeRTOS_kernel</name> | ||
<type>2</type> | ||
<locationURI>FREERTOS_ROOT/Source</locationURI> | ||
</link> | ||
<link> | ||
<name>Source</name> | ||
<type>2</type> | ||
<locationURI>virtual:/virtual</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/Blinky_Demo</name> | ||
<type>2</type> | ||
<locationURI>virtual:/virtual</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/FreeRTOSConfig.h</name> | ||
<type>1</type> | ||
<locationURI>PARENT-2-PROJECT_LOC/FreeRTOSConfig.h</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/Full_Demo</name> | ||
<type>2</type> | ||
<locationURI>virtual:/virtual</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/Makefile</name> | ||
<type>1</type> | ||
<locationURI>PROJECT_LOC/Makefile</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/fake_rom.ld</name> | ||
<type>1</type> | ||
<locationURI>PROJECT_LOC/fake_rom.ld</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/main.c</name> | ||
<type>1</type> | ||
<locationURI>PARENT-2-PROJECT_LOC/main.c</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/ns16550.c</name> | ||
<type>1</type> | ||
<locationURI>PARENT-2-PROJECT_LOC/ns16550.c</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/ns16550.h</name> | ||
<type>1</type> | ||
<locationURI>PARENT-2-PROJECT_LOC/ns16550.h</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/printf-stdarg.c</name> | ||
<type>1</type> | ||
<locationURI>PROJECT_LOC/printf-stdarg.c</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/riscv-reg.h</name> | ||
<type>1</type> | ||
<locationURI>PARENT-2-PROJECT_LOC/riscv-reg.h</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/riscv-virt.c</name> | ||
<type>1</type> | ||
<locationURI>PARENT-2-PROJECT_LOC/riscv-virt.c</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/riscv-virt.h</name> | ||
<type>1</type> | ||
<locationURI>PARENT-2-PROJECT_LOC/riscv-virt.h</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/start.S</name> | ||
<type>1</type> | ||
<locationURI>PROJECT_LOC/start.S</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/startfiles</name> | ||
<type>1</type> | ||
<locationURI>PROJECT_LOC/startfiles</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/Blinky_Demo/main_blinky.c</name> | ||
<type>1</type> | ||
<locationURI>PARENT-2-PROJECT_LOC/main_blinky.c</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/Full_Demo/CommonDemoSource</name> | ||
<type>2</type> | ||
<locationURI>FREERTOS_ROOT/Demo/Common/Minimal</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/Full_Demo/RegTest.S</name> | ||
<type>1</type> | ||
<locationURI>PROJECT_LOC/RegTest.S</locationURI> | ||
</link> | ||
<link> | ||
<name>Source/Full_Demo/main_full.c</name> | ||
<type>1</type> | ||
<locationURI>PARENT-2-PROJECT_LOC/main_full.c</locationURI> | ||
</link> | ||
</linkedResources> | ||
<filteredResources> | ||
<filter> | ||
<id>1640399877287</id> | ||
<name></name> | ||
<type>6</type> | ||
<matcher> | ||
<id>org.eclipse.ui.ide.multiFilter</id> | ||
<arguments>1.0-name-matches-false-false-*</arguments> | ||
</matcher> | ||
</filter> | ||
<filter> | ||
<id>1640399593493</id> | ||
<name>FreeRTOS_kernel/portable</name> | ||
<type>9</type> | ||
<matcher> | ||
<id>org.eclipse.ui.ide.multiFilter</id> | ||
<arguments>1.0-name-matches-false-false-GCC</arguments> | ||
</matcher> | ||
</filter> | ||
<filter> | ||
<id>1640399593501</id> | ||
<name>FreeRTOS_kernel/portable</name> | ||
<type>9</type> | ||
<matcher> | ||
<id>org.eclipse.ui.ide.multiFilter</id> | ||
<arguments>1.0-name-matches-false-false-MemMang</arguments> | ||
</matcher> | ||
</filter> | ||
<filter> | ||
<id>1640399614171</id> | ||
<name>FreeRTOS_kernel/portable/GCC</name> | ||
<type>9</type> | ||
<matcher> | ||
<id>org.eclipse.ui.ide.multiFilter</id> | ||
<arguments>1.0-name-matches-false-false-RISC-V</arguments> | ||
</matcher> | ||
</filter> | ||
<filter> | ||
<id>1640399630077</id> | ||
<name>FreeRTOS_kernel/portable/MemMang</name> | ||
<type>5</type> | ||
<matcher> | ||
<id>org.eclipse.ui.ide.multiFilter</id> | ||
<arguments>1.0-name-matches-false-false-heap_4.c</arguments> | ||
</matcher> | ||
</filter> | ||
</filteredResources> | ||
<variableList> | ||
<variable> | ||
<name>FREERTOS_ROOT</name> | ||
<value>$%7BPARENT-4-PROJECT_LOC%7D</value> | ||
</variable> | ||
</variableList> | ||
</projectDescription> |
Oops, something went wrong.