mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 16:57:41 -04:00
Update vega project to use the latest RISC-V port (#788)
Update vega board project to support the new RISC-V port
This commit is contained in:
parent
9abd84992b
commit
13ece80ea4
8 changed files with 947 additions and 430 deletions
|
@ -60,11 +60,11 @@
|
|||
<tool id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler.2064424930" name="GNU RISC-V Cross Assembler" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.assembler">
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.usepreprocessor.1096111524" name="Use preprocessor" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.usepreprocessor" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.paths.481538624" name="Include paths (-I)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/RISC-V}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/RISC-V/chip_specific_extensions/Pulpino_Vega_RV32M1RM}""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs.4569252461" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||
<listOptionValue builtIn="false" value="portasmHANDLE_INTERRUPT=SystemIrqHandler"/>
|
||||
</option>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.nostdinc.7946784038" name="Do not search system directories (-nostdinc)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.nostdinc" value="false" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.other.9634303410" name="Other assembler flags" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.assembler.other" value="" valueType="string"/>
|
||||
|
|
|
@ -29,11 +29,6 @@
|
|||
<type>2</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Source</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>FreeRTOS_startup_RV32M1_ri5cy.S</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/common/rv32m1_sdk_riscv/devices/RV32M1/gcc/startup_RV32M1_ri5cy.S</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>common</name>
|
||||
<type>2</type>
|
||||
|
@ -84,6 +79,11 @@
|
|||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/AbortDelay.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/BlockQ.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/BlockQ.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/EventGroupsDemo.c</name>
|
||||
<type>1</type>
|
||||
|
@ -94,11 +94,41 @@
|
|||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/GenQTest.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/IntSemTest.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/IntSemTest.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/MessageBufferDemo.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/MessageBufferDemo.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/PollQ.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/PollQ.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/QPeek.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/QPeek.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/QueueOverwrite.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/QueueOverwrite.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/QueueSet.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/QueueSet.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/QueueSetPolling.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/QueueSetPolling.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/StreamBufferDemo.c</name>
|
||||
<type>1</type>
|
||||
|
@ -114,6 +144,11 @@
|
|||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/TaskNotify.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/TaskNotifyArray.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/TaskNotifyArray.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/TimerDemo.c</name>
|
||||
<type>1</type>
|
||||
|
@ -139,16 +174,31 @@
|
|||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/dynamic.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/flop.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/flop.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/include</name>
|
||||
<type>2</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/include</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/integer.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/integer.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/recmutex.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/recmutex.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>full_demo/common_demo_files/semtest.c.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/semtest.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>common/rv32m1_sdk_riscv/RISCV/core_riscv32.h</name>
|
||||
<type>1</type>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1167646644509623642" 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">
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="164369459602685895" 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">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
|
|
@ -1,72 +1,28 @@
|
|||
/*
|
||||
FreeRTOS V202112.00
|
||||
All rights reserved
|
||||
|
||||
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
|
||||
|
||||
***************************************************************************
|
||||
>>! NOTE: The modification to the GPL is included to allow you to !<<
|
||||
>>! distribute a combined work that includes FreeRTOS without being !<<
|
||||
>>! obliged to provide the source code for proprietary components !<<
|
||||
>>! outside of the FreeRTOS kernel. !<<
|
||||
***************************************************************************
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. Full license text is available on the following
|
||||
link: http://www.freertos.org/a00114.html
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS provides completely free yet professionally developed, *
|
||||
* robust, strictly quality controlled, supported, and cross *
|
||||
* platform software that is more than just the market leader, it *
|
||||
* is the industry's de facto standard. *
|
||||
* *
|
||||
* Help yourself get started quickly while simultaneously helping *
|
||||
* to support the FreeRTOS project by purchasing a FreeRTOS *
|
||||
* tutorial book, reference manual, or both: *
|
||||
* http://www.FreeRTOS.org/Documentation *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
|
||||
the FAQ page "My application does not run, what could be wrong?". Have you
|
||||
defined configASSERT()?
|
||||
|
||||
http://www.FreeRTOS.org/support - In return for receiving this top quality
|
||||
embedded software for free we request you assist our global community by
|
||||
participating in the support forum.
|
||||
|
||||
http://www.FreeRTOS.org/training - Investing in training allows your team to
|
||||
be as productive as possible as early as possible. Now you can receive
|
||||
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
|
||||
Ltd, and the world's leading authority on the world's leading RTOS.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
|
||||
compatible FAT file system, and our tiny thread aware UDP/IP stack.
|
||||
|
||||
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
|
||||
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
|
||||
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
|
||||
licenses offer ticketed support, indemnification and commercial middleware.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
*/
|
||||
|
||||
* 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
|
||||
|
@ -111,6 +67,8 @@
|
|||
#define configUSE_APPLICATION_TASK_TAG 0
|
||||
#define configUSE_COUNTING_SEMAPHORES 1
|
||||
#define configGENERATE_RUN_TIME_STATS 0
|
||||
#define configUSE_QUEUE_SETS 1
|
||||
#define configTASK_NOTIFICATION_ARRAY_ENTRIES 3
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
|
@ -152,4 +110,31 @@ header file. */
|
|||
/* Map to the platform printf function. */
|
||||
#define configPRINT_STRING( pcString ) PRINTF( pcString )
|
||||
|
||||
/* Configure which tests to run. */
|
||||
#define configSTART_TASK_NOTIFY_TESTS 1
|
||||
#define configSTART_TASK_NOTIFY_ARRAY_TESTS 1
|
||||
#define configSTART_BLOCKING_QUEUE_TESTS 1
|
||||
#define configSTART_SEMAPHORE_TESTS 1
|
||||
#define configSTART_POLLED_QUEUE_TESTS 0
|
||||
#define configSTART_INTEGER_MATH_TESTS 0
|
||||
#define configSTART_GENERIC_QUEUE_TESTS 0
|
||||
#define configSTART_PEEK_QUEUE_TESTS 0
|
||||
#define configSTART_MATH_TESTS 0
|
||||
#define configSTART_RECURSIVE_MUTEX_TESTS 0
|
||||
#define configSTART_COUNTING_SEMAPHORE_TESTS 0
|
||||
#define configSTART_QUEUE_SET_TESTS 0
|
||||
#define configSTART_QUEUE_OVERWRITE_TESTS 0
|
||||
#define configSTART_EVENT_GROUP_TESTS 0
|
||||
#define configSTART_INTERRUPT_SEMAPHORE_TESTS 0
|
||||
#define configSTART_QUEUE_SET_POLLING_TESTS 0
|
||||
#define configSTART_BLOCK_TIME_TESTS 0
|
||||
#define configSTART_ABORT_DELAY_TESTS 0
|
||||
#define configSTART_MESSAGE_BUFFER_TESTS 0
|
||||
#define configSTART_STREAM_BUFFER_TESTS 0
|
||||
#define configSTART_STREAM_BUFFER_INTERRUPT_TESTS 0
|
||||
#define configSTART_TIMER_TESTS 0
|
||||
#define configSTART_DELETE_SELF_TESTS 0
|
||||
#define configSTART_DYNAMIC_PRIORITY_TESTS 0
|
||||
#define configSTART_REGISTER_TESTS 1
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
|
|
|
@ -55,7 +55,6 @@ SECTIONS
|
|||
KEEP(*(.vectors))
|
||||
} > m_vector
|
||||
|
||||
|
||||
/* The program code and other data goes into internal flash */
|
||||
.text :
|
||||
{
|
||||
|
@ -157,7 +156,7 @@ SECTIONS
|
|||
|
||||
.stack :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
. = ALIGN(16);
|
||||
__StackLimit = .;
|
||||
. += STACK_SIZE;
|
||||
__StackTop = .;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* https://www.FreeRTOS.org
|
||||
* https://aws.amazon.com/freertos
|
||||
* https://github.com/FreeRTOS
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -71,22 +71,56 @@
|
|||
|
||||
/* Standard demo application includes. */
|
||||
#include "dynamic.h"
|
||||
#include "blocktim.h"
|
||||
#include "BlockQ.h"
|
||||
#include "integer.h"
|
||||
#include "semtest.h"
|
||||
#include "PollQ.h"
|
||||
#include "GenQTest.h"
|
||||
#include "QPeek.h"
|
||||
#include "recmutex.h"
|
||||
#include "flop.h"
|
||||
#include "TimerDemo.h"
|
||||
#include "EventGroupsDemo.h"
|
||||
#include "TaskNotify.h"
|
||||
#include "AbortDelay.h"
|
||||
#include "countsem.h"
|
||||
#include "death.h"
|
||||
#include "QueueSet.h"
|
||||
#include "QueueOverwrite.h"
|
||||
#include "EventGroupsDemo.h"
|
||||
#include "IntSemTest.h"
|
||||
#include "TaskNotify.h"
|
||||
#include "TaskNotifyArray.h"
|
||||
#include "QueueSetPolling.h"
|
||||
#include "StaticAllocation.h"
|
||||
#include "blocktim.h"
|
||||
#include "AbortDelay.h"
|
||||
#include "MessageBufferDemo.h"
|
||||
#include "StreamBufferDemo.h"
|
||||
#include "StreamBufferInterrupt.h"
|
||||
|
||||
#if ( configSTART_QUEUE_SET_TESTS == 1 )
|
||||
#if ( configUSE_QUEUE_SETS != 1 )
|
||||
#error To run QUEUE_SET_TESTS and QUEUE_SET_POLLING_TESTS, INCLUDE_xTaskAbortDelay must be set to 1 in FreeRTOSConfig.h.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ( configSTART_ABORT_DELAY_TESTS == 1 )
|
||||
#if ( INCLUDE_xTaskAbortDelay != 1 )
|
||||
#error To run xTaskAbortDelay test, so INCLUDE_xTaskAbortDelay must be set to 1 in FreeRTOSConfig.h.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Priorities for the demo application tasks. */
|
||||
#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
|
||||
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3UL )
|
||||
#define testrunnerCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
|
||||
#define testrunnerQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define testrunnerSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define testrunnerBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
#define testrunnerCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
|
||||
#define testrunnerFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define testrunnerINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define testrunnerGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define testrunnerFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define testrunnerQUEUE_OVERWRITE_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define testrunnerREGISTER_TEST_PRIORITY ( tskIDLE_PRIORITY )
|
||||
|
||||
/* The period of the check task, in ms, converted to ticks using the
|
||||
pdMS_TO_TICKS() macro. mainNO_ERROR_CHECK_TASK_PERIOD is used if no errors have
|
||||
|
@ -126,22 +160,18 @@ void main_full( void );
|
|||
*/
|
||||
static void prvCheckTask( void *pvParameters );
|
||||
|
||||
/*
|
||||
* Initialise and start the peripheral timers that are used to exercise external
|
||||
* interrupt processing.
|
||||
*/
|
||||
static void prvSetupPeripheralTimers( void );
|
||||
|
||||
/*
|
||||
* Register check tasks as described at the top of this file. The nature of
|
||||
* these files necessitates that they are written in an assembly file, but the
|
||||
* entry points are kept in the C file for the convenience of checking the task
|
||||
* parameter.
|
||||
*/
|
||||
static void prvRegTestTaskEntry1( void *pvParameters );
|
||||
extern void vRegTest1Implementation( void );
|
||||
static void prvRegTestTaskEntry2( void *pvParameters );
|
||||
extern void vRegTest2Implementation( void );
|
||||
#if( configSTART_REGISTER_TESTS == 1 )
|
||||
static void prvRegTestTaskEntry1( void *pvParameters );
|
||||
extern void vRegTest1Implementation( void );
|
||||
static void prvRegTestTaskEntry2( void *pvParameters );
|
||||
extern void vRegTest2Implementation( void );
|
||||
#endif /* configSTART_REGISTER_TESTS */
|
||||
|
||||
/*
|
||||
* Tick hook used by the full demo, which includes code that interacts with
|
||||
|
@ -155,31 +185,173 @@ void vFullDemoTickHook( void );
|
|||
register check tasks to the check task. If the variables keep incrementing,
|
||||
then the register check tasks have not discovered any errors. If a variable
|
||||
stops incrementing, then an error has been found. */
|
||||
volatile uint32_t ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL;
|
||||
#if( configSTART_REGISTER_TESTS == 1 )
|
||||
volatile uint32_t ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL;
|
||||
#endif /* configSTART_REGISTER_TESTS */
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void main_full( void )
|
||||
{
|
||||
BaseType_t xResult;
|
||||
xResult = xTaskCreate( prvCheckTask, "Check", mainCHECK_TASK_STACK_SIZE_WORDS, NULL, mainCHECK_TASK_PRIORITY, NULL );
|
||||
/* Start all the other standard demo/test tasks. They have no particular
|
||||
functionality, but do demonstrate how to use the FreeRTOS API and test the
|
||||
kernel port. */
|
||||
vStartDynamicPriorityTasks();
|
||||
vCreateBlockTimeTasks();
|
||||
vStartGenericQueueTasks( tskIDLE_PRIORITY );
|
||||
vStartRecursiveMutexTasks();
|
||||
vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
|
||||
vStartEventGroupTasks();
|
||||
if( xResult == pdPASS )
|
||||
{
|
||||
#if( configSTART_TASK_NOTIFY_TESTS == 1 )
|
||||
{
|
||||
vStartTaskNotifyTask();
|
||||
vCreateAbortDelayTasks();
|
||||
}
|
||||
#endif /* configSTART_TASK_NOTIFY_TESTS */
|
||||
|
||||
#if( configSTART_TASK_NOTIFY_ARRAY_TESTS == 1 )
|
||||
{
|
||||
vStartTaskNotifyArrayTask();
|
||||
}
|
||||
#endif /* configSTART_TASK_NOTIFY_ARRAY_TESTS */
|
||||
|
||||
#if( configSTART_BLOCKING_QUEUE_TESTS == 1 )
|
||||
{
|
||||
vStartBlockingQueueTasks( testrunnerBLOCK_Q_PRIORITY );
|
||||
}
|
||||
#endif /* configSTART_BLOCKING_QUEUE_TESTS */
|
||||
|
||||
#if( configSTART_SEMAPHORE_TESTS == 1 )
|
||||
{
|
||||
vStartSemaphoreTasks( testrunnerSEM_TEST_PRIORITY );
|
||||
}
|
||||
#endif /* configSTART_SEMAPHORE_TESTS */
|
||||
|
||||
#if( configSTART_POLLED_QUEUE_TESTS == 1 )
|
||||
{
|
||||
vStartPolledQueueTasks( testrunnerQUEUE_POLL_PRIORITY );
|
||||
}
|
||||
#endif /* configSTART_POLLED_QUEUE_TESTS */
|
||||
|
||||
#if( configSTART_INTEGER_MATH_TESTS == 1 )
|
||||
{
|
||||
vStartIntegerMathTasks( testrunnerINTEGER_TASK_PRIORITY );
|
||||
}
|
||||
#endif /* configSTART_INTEGER_MATH_TESTS */
|
||||
|
||||
#if( configSTART_GENERIC_QUEUE_TESTS == 1 )
|
||||
{
|
||||
vStartGenericQueueTasks( testrunnerGEN_QUEUE_TASK_PRIORITY );
|
||||
}
|
||||
#endif /* configSTART_GENERIC_QUEUE_TESTS */
|
||||
|
||||
#if( configSTART_PEEK_QUEUE_TESTS == 1 )
|
||||
{
|
||||
vStartQueuePeekTasks();
|
||||
}
|
||||
#endif /* configSTART_PEEK_QUEUE_TESTS */
|
||||
|
||||
#if( configSTART_MATH_TESTS == 1 )
|
||||
{
|
||||
vStartMathTasks( testrunnerFLOP_TASK_PRIORITY );
|
||||
}
|
||||
#endif /* configSTART_MATH_TESTS */
|
||||
|
||||
#if( configSTART_RECURSIVE_MUTEX_TESTS == 1 )
|
||||
{
|
||||
vStartRecursiveMutexTasks();
|
||||
}
|
||||
#endif /* configSTART_RECURSIVE_MUTEX_TESTS */
|
||||
|
||||
#if( configSTART_COUNTING_SEMAPHORE_TESTS == 1 )
|
||||
{
|
||||
vStartCountingSemaphoreTasks();
|
||||
}
|
||||
#endif /* configSTART_COUNTING_SEMAPHORE_TESTS */
|
||||
|
||||
#if( configSTART_QUEUE_SET_TESTS == 1 )
|
||||
{
|
||||
vStartQueueSetTasks();
|
||||
}
|
||||
#endif /* configSTART_QUEUE_SET_TESTS */
|
||||
|
||||
#if( configSTART_QUEUE_OVERWRITE_TESTS == 1 )
|
||||
{
|
||||
vStartQueueOverwriteTask( testrunnerQUEUE_OVERWRITE_PRIORITY );
|
||||
}
|
||||
#endif /* configSTART_QUEUE_OVERWRITE_TESTS */
|
||||
|
||||
#if( configSTART_EVENT_GROUP_TESTS == 1 )
|
||||
{
|
||||
vStartEventGroupTasks();
|
||||
}
|
||||
#endif /* configSTART_EVENT_GROUP_TESTS */
|
||||
|
||||
#if( configSTART_INTERRUPT_SEMAPHORE_TESTS == 1 )
|
||||
{
|
||||
vStartInterruptSemaphoreTasks();
|
||||
}
|
||||
#endif /* configSTART_INTERRUPT_SEMAPHORE_TESTS */
|
||||
|
||||
#if( configSTART_QUEUE_SET_POLLING_TESTS == 1 )
|
||||
{
|
||||
vStartQueueSetPollingTask();
|
||||
}
|
||||
#endif /* configSTART_QUEUE_SET_POLLING_TESTS */
|
||||
|
||||
#if( configSTART_BLOCK_TIME_TESTS == 1 )
|
||||
{
|
||||
vCreateBlockTimeTasks();
|
||||
}
|
||||
#endif /* configSTART_BLOCK_TIME_TESTS */
|
||||
|
||||
#if( configSTART_ABORT_DELAY_TESTS == 1 )
|
||||
{
|
||||
vCreateAbortDelayTasks();
|
||||
}
|
||||
#endif /* configSTART_ABORT_DELAY_TESTS */
|
||||
|
||||
#if( configSTART_MESSAGE_BUFFER_TESTS == 1 )
|
||||
{
|
||||
vStartMessageBufferTasks( configMINIMAL_STACK_SIZE );
|
||||
}
|
||||
#endif /* configSTART_MESSAGE_BUFFER_TESTS */
|
||||
|
||||
#if(configSTART_STREAM_BUFFER_TESTS == 1 )
|
||||
{
|
||||
vStartStreamBufferTasks();
|
||||
}
|
||||
#endif /* configSTART_STREAM_BUFFER_TESTS */
|
||||
|
||||
#if( configSTART_STREAM_BUFFER_INTERRUPT_TESTS == 1 )
|
||||
{
|
||||
vStartStreamBufferInterruptDemo();
|
||||
}
|
||||
#endif /* configSTART_STREAM_BUFFER_INTERRUPT_TESTS */
|
||||
|
||||
#if( ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) )
|
||||
{
|
||||
/* Don't expect these tasks to pass when preemption is not used. */
|
||||
vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
|
||||
}
|
||||
#endif /* ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) */
|
||||
|
||||
#if( configSTART_DELETE_SELF_TESTS == 1 )
|
||||
{
|
||||
/* The suicide tasks must be created last as they need to know how many
|
||||
* tasks were running prior to their creation. This then allows them to
|
||||
* ascertain whether or not the correct/expected number of tasks are
|
||||
* running at any given time. */
|
||||
vCreateSuicidalTasks( testrunnerCREATOR_TASK_PRIORITY );
|
||||
}
|
||||
#endif /* configSTART_DELETE_SELF_TESTS */
|
||||
|
||||
#if configSTART_DYNAMIC_PRIORITY_TESTS == 1
|
||||
vStartDynamicPriorityTasks();
|
||||
#endif
|
||||
|
||||
/* Create the register check tasks, as described at the top of this file.
|
||||
Use xTaskCreateStatic() to create a task using only statically allocated
|
||||
memory. */
|
||||
#if( configSTART_REGISTER_TESTS == 1 )
|
||||
{
|
||||
xTaskCreate( prvRegTestTaskEntry1, /* The function that implements the task. */
|
||||
"Reg1", /* The name of the task. */
|
||||
mainREG_TEST_STACK_SIZE_WORDS, /* Size of stack to allocate for the task - in words not bytes!. */
|
||||
|
@ -187,18 +359,9 @@ void main_full( void )
|
|||
tskIDLE_PRIORITY, /* Priority of the task. */
|
||||
NULL ); /* Can be used to pass out a handle to the created task. */
|
||||
xTaskCreate( prvRegTestTaskEntry2, "Reg2", mainREG_TEST_STACK_SIZE_WORDS, mainREG_TEST_TASK_2_PARAMETER, tskIDLE_PRIORITY, NULL );
|
||||
|
||||
/* Create the task that performs the 'check' functionality, as described at
|
||||
the top of this file. */
|
||||
xTaskCreate( prvCheckTask, "Check", mainCHECK_TASK_STACK_SIZE_WORDS, NULL, mainCHECK_TASK_PRIORITY, NULL );
|
||||
|
||||
/* The set of tasks created by the following function call have to be
|
||||
created last as they keep account of the number of tasks they expect to see
|
||||
running. */
|
||||
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
|
||||
|
||||
/* Start the timers that are used to exercise external interrupt handling. */
|
||||
prvSetupPeripheralTimers();
|
||||
}
|
||||
#endif /* configSTART_REGISTER_TESTS */
|
||||
}
|
||||
|
||||
/* Start the scheduler. */
|
||||
vTaskStartScheduler();
|
||||
|
@ -217,11 +380,14 @@ static void prvCheckTask( void *pvParameters )
|
|||
{
|
||||
TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;
|
||||
TickType_t xLastExecutionTime;
|
||||
uint32_t ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
|
||||
char * const pcPassMessage = mainDEMO_SUCCESS_MESSAGE;
|
||||
char * pcStatusMessage = pcPassMessage;
|
||||
extern void vToggleLED( void );
|
||||
|
||||
#if( configSTART_REGISTER_TESTS == 1 )
|
||||
uint32_t ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
|
||||
#endif /* configSTART_REGISTER_TESTS */
|
||||
|
||||
/* Just to stop compiler warnings. */
|
||||
( void ) pvParameters;
|
||||
|
||||
|
@ -245,71 +411,222 @@ extern void vToggleLED( void );
|
|||
|
||||
/* Check all the demo tasks (other than the flash tasks) to ensure
|
||||
that they are all still running, and that none have detected an error. */
|
||||
#if( configSTART_TASK_NOTIFY_TESTS == 1 )
|
||||
{
|
||||
if( xAreTaskNotificationTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Notification";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_TASK_NOTIFY_TESTS */
|
||||
|
||||
#if( configSTART_TASK_NOTIFY_ARRAY_TESTS == 1 )
|
||||
{
|
||||
if( xAreTaskNotificationArrayTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Notification Array";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_TASK_NOTIFY_ARRAY_TESTS */
|
||||
|
||||
#if( configSTART_BLOCKING_QUEUE_TESTS == 1 )
|
||||
{
|
||||
if( xAreBlockingQueuesStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: BlockQueue";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_BLOCKING_QUEUE_TESTS */
|
||||
|
||||
#if( configSTART_SEMAPHORE_TESTS == 1 )
|
||||
{
|
||||
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: SemTest";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_SEMAPHORE_TESTS */
|
||||
|
||||
#if( configSTART_POLLED_QUEUE_TESTS == 1 )
|
||||
{
|
||||
if( xArePollingQueuesStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: PollQueue";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_POLLED_QUEUE_TESTS */
|
||||
|
||||
#if( configSTART_INTEGER_MATH_TESTS == 1 )
|
||||
{
|
||||
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: IntMath";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_INTEGER_MATH_TESTS */
|
||||
|
||||
#if( configSTART_GENERIC_QUEUE_TESTS == 1 )
|
||||
{
|
||||
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: GenQueue";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_GENERIC_QUEUE_TESTS */
|
||||
|
||||
#if( configSTART_PEEK_QUEUE_TESTS == 1 )
|
||||
{
|
||||
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: QueuePeek";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_PEEK_QUEUE_TESTS */
|
||||
|
||||
#if( configSTART_MATH_TESTS == 1 )
|
||||
{
|
||||
if( xAreMathsTaskStillRunning() != pdPASS )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Flop";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_MATH_TESTS */
|
||||
|
||||
#if( configSTART_RECURSIVE_MUTEX_TESTS == 1 )
|
||||
{
|
||||
if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: RecMutex";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_RECURSIVE_MUTEX_TESTS */
|
||||
|
||||
#if( configSTART_COUNTING_SEMAPHORE_TESTS == 1 )
|
||||
{
|
||||
if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: CountSem";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_COUNTING_SEMAPHORE_TESTS */
|
||||
|
||||
#if( configSTART_QUEUE_SET_TESTS == 1 )
|
||||
{
|
||||
if( xAreQueueSetTasksStillRunning() != pdPASS )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Queue set";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_QUEUE_SET_TESTS */
|
||||
|
||||
#if( configSTART_QUEUE_OVERWRITE_TESTS == 1 )
|
||||
{
|
||||
if( xIsQueueOverwriteTaskStillRunning() != pdPASS )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Queue overwrite";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_QUEUE_OVERWRITE_TESTS */
|
||||
|
||||
#if( configSTART_EVENT_GROUP_TESTS == 1 )
|
||||
{
|
||||
if( xAreEventGroupTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: EventGroup";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_EVENT_GROUP_TESTS */
|
||||
|
||||
#if( configSTART_INTERRUPT_SEMAPHORE_TESTS == 1 )
|
||||
{
|
||||
if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: IntSem";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_INTERRUPT_SEMAPHORE_TESTS */
|
||||
|
||||
#if( configSTART_QUEUE_SET_POLLING_TESTS == 1 )
|
||||
{
|
||||
if( xAreQueueSetPollTasksStillRunning() != pdPASS )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Queue set polling";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_QUEUE_SET_POLLING_TESTS */
|
||||
|
||||
#if( configSTART_BLOCK_TIME_TESTS == 1 )
|
||||
{
|
||||
if( xAreBlockTimeTestTasksStillRunning() != pdPASS )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Block time";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_BLOCK_TIME_TESTS */
|
||||
|
||||
#if( configSTART_ABORT_DELAY_TESTS == 1 )
|
||||
{
|
||||
if( xAreAbortDelayTestTasksStillRunning() != pdPASS )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Abort delay";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_ABORT_DELAY_TESTS */
|
||||
|
||||
#if( configSTART_MESSAGE_BUFFER_TESTS == 1 )
|
||||
{
|
||||
if( xAreMessageBufferTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: MessageBuffer";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_MESSAGE_BUFFER_TESTS */
|
||||
|
||||
#if( configSTART_STREAM_BUFFER_TESTS == 1 )
|
||||
{
|
||||
if( xAreStreamBufferTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: StreamBuffer";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_STREAM_BUFFER_TESTS */
|
||||
|
||||
#if( configSTART_STREAM_BUFFER_INTERRUPT_TESTS == 1 )
|
||||
{
|
||||
if( xIsInterruptStreamBufferDemoStillRunning() != pdPASS )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Stream buffer interrupt";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_STREAM_BUFFER_INTERRUPT_TESTS */
|
||||
|
||||
#if( ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) )
|
||||
{
|
||||
if( xAreTimerDemoTasksStillRunning( ( TickType_t ) xDelayPeriod ) != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: TimerDemo";
|
||||
}
|
||||
}
|
||||
#endif /* ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) */
|
||||
|
||||
#if( configSTART_DELETE_SELF_TESTS == 1 )
|
||||
{
|
||||
if( xIsCreateTaskStillRunning() != pdTRUE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Death";
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_DELETE_SELF_TESTS */
|
||||
|
||||
#if configSTART_DYNAMIC_PRIORITY_TESTS == 1
|
||||
if( xAreDynamicPriorityTasksStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Dynamic priority demo/tests.\r\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
if( xAreBlockTimeTestTasksStillRunning() == pdFALSE )
|
||||
#if( configSTART_REGISTER_TESTS == 1 )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Block time demo/tests.\r\n";
|
||||
}
|
||||
|
||||
if( xAreGenericQueueTasksStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Generic queue demo/tests.\r\n";
|
||||
}
|
||||
|
||||
if( xAreRecursiveMutexTasksStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Recursive mutex demo/tests.\r\n";
|
||||
}
|
||||
|
||||
if( xAreTimerDemoTasksStillRunning( ( TickType_t ) xDelayPeriod ) == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Timer demo/tests.\r\n";
|
||||
}
|
||||
|
||||
if( xAreEventGroupTasksStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Event group demo/tests.\r\n";
|
||||
}
|
||||
|
||||
if( xAreTaskNotificationTasksStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Task notification demo/tests.\r\n";
|
||||
}
|
||||
|
||||
if( xAreAbortDelayTestTasksStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Abort delay.\r\n";
|
||||
}
|
||||
|
||||
if( xAreCountingSemaphoreTasksStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Counting semaphores.\r\n";
|
||||
}
|
||||
|
||||
if( xIsCreateTaskStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Suicide tasks.\r\n";
|
||||
}
|
||||
|
||||
if( xAreMessageBufferTasksStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Message buffer.\r\n";
|
||||
}
|
||||
|
||||
if( xAreStreamBufferTasksStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Stream buffer.\r\n";
|
||||
}
|
||||
|
||||
if( xIsInterruptStreamBufferDemoStillRunning() == pdFALSE )
|
||||
{
|
||||
pcStatusMessage = "FreeRTOS Demo ERROR: Stream buffer interrupt.\r\n";
|
||||
}
|
||||
|
||||
/* Check that the register test 1 task is still running. */
|
||||
if( ulLastRegTest1Value == ulRegTest1LoopCounter )
|
||||
{
|
||||
|
@ -323,10 +640,11 @@ extern void vToggleLED( void );
|
|||
pcStatusMessage = "FreeRTOS Demo ERROR: Register test 2.\r\n";
|
||||
}
|
||||
ulLastRegTest2Value = ulRegTest2LoopCounter;
|
||||
}
|
||||
#endif /* configSTART_REGISTER_TESTS */
|
||||
|
||||
/* Write the status message to the UART. */
|
||||
vToggleLED();
|
||||
configPRINT_STRING( pcStatusMessage );
|
||||
|
||||
/* If an error has been found then increase the LED toggle rate by
|
||||
increasing the cycle frequency. */
|
||||
|
@ -334,12 +652,15 @@ extern void vToggleLED( void );
|
|||
{
|
||||
xDelayPeriod = mainERROR_CHECK_TASK_PERIOD;
|
||||
}
|
||||
|
||||
configPRINT_STRING( pcStatusMessage );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvRegTestTaskEntry1( void *pvParameters )
|
||||
{
|
||||
#if( configSTART_REGISTER_TESTS == 1 )
|
||||
static void prvRegTestTaskEntry1( void *pvParameters )
|
||||
{
|
||||
/* Although the regtest task is written in assembler, its entry point is
|
||||
written in C for convenience of checking the task parameter is being passed
|
||||
in correctly. */
|
||||
|
@ -353,11 +674,13 @@ static void prvRegTestTaskEntry1( void *pvParameters )
|
|||
be incorrect. The check task will detect that the regtest loop counter is
|
||||
not being incremented and flag an error. */
|
||||
vTaskDelete( NULL );
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_REGISTER_TESTS */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvRegTestTaskEntry2( void *pvParameters )
|
||||
{
|
||||
#if( configSTART_REGISTER_TESTS == 1 )
|
||||
static void prvRegTestTaskEntry2( void *pvParameters )
|
||||
{
|
||||
/* Although the regtest task is written in assembler, its entry point is
|
||||
written in C for convenience of checking the task parameter is being passed
|
||||
in correctly. */
|
||||
|
@ -371,36 +694,82 @@ static void prvRegTestTaskEntry2( void *pvParameters )
|
|||
be incorrect. The check task will detect that the regtest loop counter is
|
||||
not being incremented and flag an error. */
|
||||
vTaskDelete( NULL );
|
||||
}
|
||||
}
|
||||
#endif /* configSTART_REGISTER_TESTS */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vFullDemoTickHook( void )
|
||||
{
|
||||
/* The full demo includes a software timer demo/test that requires
|
||||
prodding periodically from the tick interrupt. */
|
||||
vTimerPeriodicISRTests();
|
||||
|
||||
/* Call the periodic event group from ISR demo. */
|
||||
vPeriodicEventGroupsProcessing();
|
||||
|
||||
build the full test/demo applications. */
|
||||
#if( configSTART_TASK_NOTIFY_TESTS == 1 )
|
||||
{
|
||||
/* Use task notifications from an interrupt. */
|
||||
xNotifyTaskFromISR();
|
||||
}
|
||||
#endif /* configSTART_TASK_NOTIFY_TESTS */
|
||||
|
||||
#if( configSTART_TASK_NOTIFY_ARRAY_TESTS == 1 )
|
||||
{
|
||||
xNotifyArrayTaskFromISR();
|
||||
}
|
||||
#endif /* configSTART_TASK_NOTIFY_ARRAY_TESTS */
|
||||
|
||||
#if( configSTART_QUEUE_SET_TESTS == 1 )
|
||||
{
|
||||
vQueueSetAccessQueueSetFromISR();
|
||||
}
|
||||
#endif /* configSTART_QUEUE_SET_TESTS */
|
||||
|
||||
#if( configSTART_QUEUE_OVERWRITE_TESTS == 1 )
|
||||
{
|
||||
vQueueOverwritePeriodicISRDemo();
|
||||
}
|
||||
#endif /* configSTART_QUEUE_OVERWRITE_TESTS */
|
||||
|
||||
#if( configSTART_EVENT_GROUP_TESTS == 1 )
|
||||
{
|
||||
/* Call the periodic event group from ISR demo. */
|
||||
vPeriodicEventGroupsProcessing();
|
||||
}
|
||||
#endif /* configSTART_EVENT_GROUP_TESTS */
|
||||
|
||||
#if( configSTART_INTERRUPT_SEMAPHORE_TESTS == 1 )
|
||||
{
|
||||
vInterruptSemaphorePeriodicTest();
|
||||
}
|
||||
#endif /* configSTART_INTERRUPT_SEMAPHORE_TESTS */
|
||||
|
||||
#if( configSTART_QUEUE_SET_POLLING_TESTS == 1 )
|
||||
{
|
||||
vQueueSetPollingInterruptAccess();
|
||||
}
|
||||
#endif /* configSTART_QUEUE_SET_POLLING_TESTS */
|
||||
|
||||
#if( configSTART_STREAM_BUFFER_TESTS == 1 )
|
||||
{
|
||||
/* Writes to stream buffer byte by byte to test the stream buffer trigger
|
||||
level functionality. */
|
||||
vPeriodicStreamBufferProcessing();
|
||||
}
|
||||
#endif /* configSTART_STREAM_BUFFER_TESTS */
|
||||
|
||||
#if( configSTART_STREAM_BUFFER_INTERRUPT_TESTS == 1 )
|
||||
{
|
||||
/* Writes a string to a string buffer four bytes at a time to demonstrate
|
||||
a stream being sent from an interrupt to a task. */
|
||||
vBasicStreamBufferSendFromISR();
|
||||
}
|
||||
#endif /* configSTART_STREAM_BUFFER_INTERRUPT_TESTS */
|
||||
|
||||
/* Called from vApplicationTickHook() when the project is configured to
|
||||
build the full test/demo applications. */
|
||||
#if( ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) )
|
||||
{
|
||||
/* The full demo includes a software timer demo/test that requires
|
||||
prodding periodically from the tick interrupt. */
|
||||
|
||||
/* Only created when preemption is used. */
|
||||
vTimerPeriodicISRTests();
|
||||
}
|
||||
#endif /* ( configSTART_TIMER_TESTS == 1 ) && ( configUSE_PREEMPTION != 0 ) */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvSetupPeripheralTimers( void )
|
||||
{
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
|
@ -24,18 +24,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Create implementation of vPortSetupTimerInterrupt() if the CLINT is not
|
||||
* available, but make sure the configCLINT_BASE_ADDRESS constant is still
|
||||
* defined.
|
||||
*
|
||||
* Define vPortHandleInterrupt to whatever the interrupt handler is called. In
|
||||
* this case done by defining vPortHandleInterrupt=SystemIrqHandler on the
|
||||
* assembler command line as SystemIrqHandler is referenced from both FreeRTOS
|
||||
* code and the libraries that come with the Vega board.
|
||||
*/
|
||||
|
||||
/* FreeRTOS kernel includes. */
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
|
@ -222,7 +210,7 @@ void vTaskSwitchContext( void );
|
|||
the default SystemIrqHandler() implementation as that enables interrupts. A
|
||||
version that does not enable interrupts is provided below. THIS INTERRUPT
|
||||
HANDLER IS SPECIFIC TO THE VEGA BOARD WHICH DOES NOT INCLUDE A CLINT! */
|
||||
void SystemIrqHandler( uint32_t mcause )
|
||||
void freertos_risc_v_application_interrupt_handler( uint32_t mcause )
|
||||
{
|
||||
uint32_t ulInterruptNumber;
|
||||
typedef void ( * irq_handler_t )( void );
|
||||
|
@ -239,4 +227,5 @@ extern const irq_handler_t isrTable[];
|
|||
/* Now call the real irq handler for ulInterruptNumber */
|
||||
isrTable[ ulInterruptNumber ]();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
|
@ -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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "portContext.h"
|
||||
|
||||
.extern freertos_risc_v_exception_handler
|
||||
.extern freertos_risc_v_interrupt_handler
|
||||
.extern vTaskSwitchContext
|
||||
|
||||
.text
|
||||
.section .vectors, "ax"
|
||||
.option norvc
|
||||
freertos_vector_table:
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
jal x0, freertos_risc_v_interrupt_handler
|
||||
|
||||
/* Reset vector. */
|
||||
jal x0, Reset_Handler
|
||||
|
||||
/* Illegal instrution exception. */
|
||||
jal x0, freertos_risc_v_exception_handler
|
||||
|
||||
/* Ecall handler. */
|
||||
jal x0, Ecall_Handler
|
||||
|
||||
/* LSU error (Invalid Memory Access) exception. */
|
||||
jal x0, freertos_risc_v_exception_handler
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
.section .startup
|
||||
|
||||
/* Reset Handler */
|
||||
Reset_Handler:
|
||||
|
||||
/* Disable global interrupt. */
|
||||
csrci mstatus, 8
|
||||
|
||||
/* Initialize stack pointer. */
|
||||
la sp, __StackTop
|
||||
|
||||
/* Initialize global pointer */
|
||||
la gp, __global_pointer
|
||||
|
||||
#ifndef __NO_SYSTEM_INIT
|
||||
jal SystemInit
|
||||
#endif
|
||||
|
||||
call __libc_init_array
|
||||
|
||||
/* Enable global interrupt. */
|
||||
csrsi mstatus, 8
|
||||
|
||||
jal main
|
||||
ebreak
|
||||
|
||||
.size Reset_Handler, . - Reset_Handler
|
||||
|
||||
.global _init
|
||||
.global _fini
|
||||
_init:
|
||||
_fini:
|
||||
ret
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* RISC-V RI5CY core has a separate ecall entry point in the vector table.
|
||||
* Therefore we can write a more efficient ecall handler which do not need to
|
||||
* check the mcause value. */
|
||||
Ecall_Handler:
|
||||
portcontextSAVE_EXCEPTION_CONTEXT
|
||||
call vTaskSwitchContext
|
||||
portcontextRESTORE_CONTEXT
|
||||
/*-----------------------------------------------------------*/
|
Loading…
Add table
Add a link
Reference in a new issue