mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 08:47:45 -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">
|
<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 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">
|
<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}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/RISC-V/chip_specific_extensions/Pulpino_Vega_RV32M1RM}""/>
|
||||||
</option>
|
</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">
|
<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="DEBUG"/>
|
||||||
<listOptionValue builtIn="false" value="portasmHANDLE_INTERRUPT=SystemIrqHandler"/>
|
|
||||||
</option>
|
</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.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"/>
|
<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"/>
|
||||||
|
@ -213,4 +213,4 @@
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||||
</cproject>
|
</cproject>
|
|
@ -29,11 +29,6 @@
|
||||||
<type>2</type>
|
<type>2</type>
|
||||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Source</locationURI>
|
<locationURI>FREERTOS_ROOT/FreeRTOS/Source</locationURI>
|
||||||
</link>
|
</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>
|
<link>
|
||||||
<name>common</name>
|
<name>common</name>
|
||||||
<type>2</type>
|
<type>2</type>
|
||||||
|
@ -84,6 +79,11 @@
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/AbortDelay.c</locationURI>
|
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/AbortDelay.c</locationURI>
|
||||||
</link>
|
</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>
|
<link>
|
||||||
<name>full_demo/common_demo_files/EventGroupsDemo.c</name>
|
<name>full_demo/common_demo_files/EventGroupsDemo.c</name>
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
|
@ -94,11 +94,41 @@
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/GenQTest.c</locationURI>
|
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/GenQTest.c</locationURI>
|
||||||
</link>
|
</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>
|
<link>
|
||||||
<name>full_demo/common_demo_files/MessageBufferDemo.c</name>
|
<name>full_demo/common_demo_files/MessageBufferDemo.c</name>
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/MessageBufferDemo.c</locationURI>
|
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/MessageBufferDemo.c</locationURI>
|
||||||
</link>
|
</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>
|
<link>
|
||||||
<name>full_demo/common_demo_files/StreamBufferDemo.c</name>
|
<name>full_demo/common_demo_files/StreamBufferDemo.c</name>
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
|
@ -114,6 +144,11 @@
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/TaskNotify.c</locationURI>
|
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/TaskNotify.c</locationURI>
|
||||||
</link>
|
</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>
|
<link>
|
||||||
<name>full_demo/common_demo_files/TimerDemo.c</name>
|
<name>full_demo/common_demo_files/TimerDemo.c</name>
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
|
@ -139,16 +174,31 @@
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/dynamic.c</locationURI>
|
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/dynamic.c</locationURI>
|
||||||
</link>
|
</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>
|
<link>
|
||||||
<name>full_demo/common_demo_files/include</name>
|
<name>full_demo/common_demo_files/include</name>
|
||||||
<type>2</type>
|
<type>2</type>
|
||||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/include</locationURI>
|
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/include</locationURI>
|
||||||
</link>
|
</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>
|
<link>
|
||||||
<name>full_demo/common_demo_files/recmutex.c</name>
|
<name>full_demo/common_demo_files/recmutex.c</name>
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/recmutex.c</locationURI>
|
<locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/recmutex.c</locationURI>
|
||||||
</link>
|
</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>
|
<link>
|
||||||
<name>common/rv32m1_sdk_riscv/RISCV/core_riscv32.h</name>
|
<name>common/rv32m1_sdk_riscv/RISCV/core_riscv32.h</name>
|
||||||
<type>1</type>
|
<type>1</type>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
<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.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" 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.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
|
|
|
@ -1,72 +1,28 @@
|
||||||
/*
|
/*
|
||||||
FreeRTOS V202112.00
|
* FreeRTOS V202112.00
|
||||||
All rights reserved
|
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
*
|
||||||
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
* 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
|
||||||
This file is part of the FreeRTOS distribution.
|
* the Software without restriction, including without limitation the rights to
|
||||||
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
the terms of the GNU General Public License (version 2) as published by the
|
* subject to the following conditions:
|
||||||
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
***************************************************************************
|
* copies or substantial portions of the Software.
|
||||||
>>! NOTE: The modification to the GPL is included to allow you to !<<
|
*
|
||||||
>>! distribute a combined work that includes FreeRTOS without being !<<
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
>>! obliged to provide the source code for proprietary components !<<
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
>>! outside of the FreeRTOS kernel. !<<
|
* 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
|
||||||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
*
|
||||||
FOR A PARTICULAR PURPOSE. Full license text is available on the following
|
* https://www.FreeRTOS.org
|
||||||
link: http://www.freertos.org/a00114.html
|
* https://github.com/FreeRTOS
|
||||||
|
*
|
||||||
***************************************************************************
|
*/
|
||||||
* *
|
|
||||||
* 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!
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef FREERTOS_CONFIG_H
|
#ifndef FREERTOS_CONFIG_H
|
||||||
#define FREERTOS_CONFIG_H
|
#define FREERTOS_CONFIG_H
|
||||||
|
@ -87,69 +43,98 @@
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
/* See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html */
|
/* See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html */
|
||||||
#define configMTIME_BASE_ADDRESS ( 0 )
|
#define configMTIME_BASE_ADDRESS ( 0 )
|
||||||
#define configMTIMECMP_BASE_ADDRESS ( 0 )
|
#define configMTIMECMP_BASE_ADDRESS ( 0 )
|
||||||
|
|
||||||
|
|
||||||
#define configUSE_PREEMPTION 1
|
#define configUSE_PREEMPTION 1
|
||||||
#define configUSE_IDLE_HOOK 1
|
#define configUSE_IDLE_HOOK 1
|
||||||
#define configUSE_TICK_HOOK 1
|
#define configUSE_TICK_HOOK 1
|
||||||
#define configCPU_CLOCK_HZ BOARD_BOOTCLOCKRUN_CORE_CLOCK
|
#define configCPU_CLOCK_HZ BOARD_BOOTCLOCKRUN_CORE_CLOCK
|
||||||
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
|
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
|
||||||
#define configMAX_PRIORITIES ( 5 )
|
#define configMAX_PRIORITIES ( 5 )
|
||||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 200 ) /* Can be as low as 60 but some of the demo tasks that use this constant require it to be higher. */
|
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 200 ) /* Can be as low as 60 but some of the demo tasks that use this constant require it to be higher. */
|
||||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 100 * 1024 ) )
|
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 100 * 1024 ) )
|
||||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||||
#define configUSE_TRACE_FACILITY 0
|
#define configUSE_TRACE_FACILITY 0
|
||||||
#define configUSE_16_BIT_TICKS 0
|
#define configUSE_16_BIT_TICKS 0
|
||||||
#define configIDLE_SHOULD_YIELD 0
|
#define configIDLE_SHOULD_YIELD 0
|
||||||
#define configUSE_MUTEXES 1
|
#define configUSE_MUTEXES 1
|
||||||
#define configQUEUE_REGISTRY_SIZE 8
|
#define configQUEUE_REGISTRY_SIZE 8
|
||||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
#define configCHECK_FOR_STACK_OVERFLOW 2
|
||||||
#define configUSE_RECURSIVE_MUTEXES 1
|
#define configUSE_RECURSIVE_MUTEXES 1
|
||||||
#define configUSE_MALLOC_FAILED_HOOK 1
|
#define configUSE_MALLOC_FAILED_HOOK 1
|
||||||
#define configUSE_APPLICATION_TASK_TAG 0
|
#define configUSE_APPLICATION_TASK_TAG 0
|
||||||
#define configUSE_COUNTING_SEMAPHORES 1
|
#define configUSE_COUNTING_SEMAPHORES 1
|
||||||
#define configGENERATE_RUN_TIME_STATS 0
|
#define configGENERATE_RUN_TIME_STATS 0
|
||||||
|
#define configUSE_QUEUE_SETS 1
|
||||||
|
#define configTASK_NOTIFICATION_ARRAY_ENTRIES 3
|
||||||
|
|
||||||
/* Co-routine definitions. */
|
/* Co-routine definitions. */
|
||||||
#define configUSE_CO_ROUTINES 0
|
#define configUSE_CO_ROUTINES 0
|
||||||
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
|
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
|
||||||
|
|
||||||
/* Software timer definitions. */
|
/* Software timer definitions. */
|
||||||
#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 ( configMINIMAL_STACK_SIZE )
|
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE )
|
||||||
|
|
||||||
/* Task priorities. Allow these to be overridden. */
|
/* Task priorities. Allow these to be overridden. */
|
||||||
#ifndef uartPRIMARY_PRIORITY
|
#ifndef uartPRIMARY_PRIORITY
|
||||||
#define uartPRIMARY_PRIORITY ( configMAX_PRIORITIES - 3 )
|
#define uartPRIMARY_PRIORITY ( configMAX_PRIORITIES - 3 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set the following definitions to 1 to include the API function, or zero
|
/* Set the following definitions to 1 to include the API function, or zero
|
||||||
to exclude the API function. */
|
to exclude the API function. */
|
||||||
#define INCLUDE_vTaskPrioritySet 1
|
#define INCLUDE_vTaskPrioritySet 1
|
||||||
#define INCLUDE_uxTaskPriorityGet 1
|
#define INCLUDE_uxTaskPriorityGet 1
|
||||||
#define INCLUDE_vTaskDelete 1
|
#define INCLUDE_vTaskDelete 1
|
||||||
#define INCLUDE_vTaskCleanUpResources 1
|
#define INCLUDE_vTaskCleanUpResources 1
|
||||||
#define INCLUDE_vTaskSuspend 1
|
#define INCLUDE_vTaskSuspend 1
|
||||||
#define INCLUDE_vTaskDelayUntil 1
|
#define INCLUDE_vTaskDelayUntil 1
|
||||||
#define INCLUDE_vTaskDelay 1
|
#define INCLUDE_vTaskDelay 1
|
||||||
#define INCLUDE_eTaskGetState 1
|
#define INCLUDE_eTaskGetState 1
|
||||||
#define INCLUDE_xTimerPendFunctionCall 1
|
#define INCLUDE_xTimerPendFunctionCall 1
|
||||||
#define INCLUDE_xTaskAbortDelay 1
|
#define INCLUDE_xTaskAbortDelay 1
|
||||||
#define INCLUDE_xTaskGetHandle 1
|
#define INCLUDE_xTaskGetHandle 1
|
||||||
#define INCLUDE_xSemaphoreGetMutexHolder 1
|
#define INCLUDE_xSemaphoreGetMutexHolder 1
|
||||||
|
|
||||||
/* Normal assert() semantics without relying on the provision of an assert.h
|
/* Normal assert() semantics without relying on the provision of an assert.h
|
||||||
header file. */
|
header file. */
|
||||||
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); __asm volatile( "ebreak" ); for( ;; ); }
|
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); __asm volatile( "ebreak" ); for( ;; ); }
|
||||||
|
|
||||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
|
||||||
#define configKERNEL_INTERRUPT_PRIORITY 7
|
#define configKERNEL_INTERRUPT_PRIORITY 7
|
||||||
|
|
||||||
/* Map to the platform printf function. */
|
/* Map to the platform printf function. */
|
||||||
#define configPRINT_STRING( pcString ) PRINTF( pcString )
|
#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 */
|
#endif /* FREERTOS_CONFIG_H */
|
||||||
|
|
|
@ -54,8 +54,7 @@ SECTIONS
|
||||||
__VECTOR_TABLE = .;
|
__VECTOR_TABLE = .;
|
||||||
KEEP(*(.vectors))
|
KEEP(*(.vectors))
|
||||||
} > m_vector
|
} > m_vector
|
||||||
|
|
||||||
|
|
||||||
/* The program code and other data goes into internal flash */
|
/* The program code and other data goes into internal flash */
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
|
@ -157,7 +156,7 @@ SECTIONS
|
||||||
|
|
||||||
.stack :
|
.stack :
|
||||||
{
|
{
|
||||||
. = ALIGN(8);
|
. = ALIGN(16);
|
||||||
__StackLimit = .;
|
__StackLimit = .;
|
||||||
. += STACK_SIZE;
|
. += STACK_SIZE;
|
||||||
__StackTop = .;
|
__StackTop = .;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* https://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* https://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -71,48 +71,82 @@
|
||||||
|
|
||||||
/* Standard demo application includes. */
|
/* Standard demo application includes. */
|
||||||
#include "dynamic.h"
|
#include "dynamic.h"
|
||||||
#include "blocktim.h"
|
#include "BlockQ.h"
|
||||||
|
#include "integer.h"
|
||||||
|
#include "semtest.h"
|
||||||
|
#include "PollQ.h"
|
||||||
#include "GenQTest.h"
|
#include "GenQTest.h"
|
||||||
|
#include "QPeek.h"
|
||||||
#include "recmutex.h"
|
#include "recmutex.h"
|
||||||
|
#include "flop.h"
|
||||||
#include "TimerDemo.h"
|
#include "TimerDemo.h"
|
||||||
#include "EventGroupsDemo.h"
|
|
||||||
#include "TaskNotify.h"
|
|
||||||
#include "AbortDelay.h"
|
|
||||||
#include "countsem.h"
|
#include "countsem.h"
|
||||||
#include "death.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 "MessageBufferDemo.h"
|
||||||
#include "StreamBufferDemo.h"
|
#include "StreamBufferDemo.h"
|
||||||
#include "StreamBufferInterrupt.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. */
|
/* Priorities for the demo application tasks. */
|
||||||
#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
|
#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
|
/* 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
|
pdMS_TO_TICKS() macro. mainNO_ERROR_CHECK_TASK_PERIOD is used if no errors have
|
||||||
been found, mainERROR_CHECK_TASK_PERIOD is used if an error has been found. */
|
been found, mainERROR_CHECK_TASK_PERIOD is used if an error has been found. */
|
||||||
#define mainNO_ERROR_CHECK_TASK_PERIOD pdMS_TO_TICKS( 3000UL )
|
#define mainNO_ERROR_CHECK_TASK_PERIOD pdMS_TO_TICKS( 3000UL )
|
||||||
#define mainERROR_CHECK_TASK_PERIOD pdMS_TO_TICKS( 500UL )
|
#define mainERROR_CHECK_TASK_PERIOD pdMS_TO_TICKS( 500UL )
|
||||||
|
|
||||||
/* Parameters that are passed into the register check tasks solely for the
|
/* Parameters that are passed into the register check tasks solely for the
|
||||||
purpose of ensuring parameters are passed into tasks correctly. */
|
purpose of ensuring parameters are passed into tasks correctly. */
|
||||||
#define mainREG_TEST_TASK_1_PARAMETER ( ( void * ) 0x12345678 )
|
#define mainREG_TEST_TASK_1_PARAMETER ( ( void * ) 0x12345678 )
|
||||||
#define mainREG_TEST_TASK_2_PARAMETER ( ( void * ) 0x87654321 )
|
#define mainREG_TEST_TASK_2_PARAMETER ( ( void * ) 0x87654321 )
|
||||||
|
|
||||||
/* The base period used by the timer test tasks. */
|
/* The base period used by the timer test tasks. */
|
||||||
#define mainTIMER_TEST_PERIOD ( 50 )
|
#define mainTIMER_TEST_PERIOD ( 50 )
|
||||||
|
|
||||||
/* The size of the stack allocated to the check task (as described in the
|
/* The size of the stack allocated to the check task (as described in the
|
||||||
comments at the top of this file. This is surprisingly large as it calls
|
comments at the top of this file. This is surprisingly large as it calls
|
||||||
the logging library's print function, which allocates a 128 byte buffer on its
|
the logging library's print function, which allocates a 128 byte buffer on its
|
||||||
stack. */
|
stack. */
|
||||||
#define mainCHECK_TASK_STACK_SIZE_WORDS 200
|
#define mainCHECK_TASK_STACK_SIZE_WORDS 200
|
||||||
|
|
||||||
/* Size of the stacks to allocated for the register check tasks. */
|
/* Size of the stacks to allocated for the register check tasks. */
|
||||||
#define mainREG_TEST_STACK_SIZE_WORDS 150
|
#define mainREG_TEST_STACK_SIZE_WORDS 150
|
||||||
|
|
||||||
/* Success output messages. This is used by the CI - do not change. */
|
/* Success output messages. This is used by the CI - do not change. */
|
||||||
#define mainDEMO_SUCCESS_MESSAGE "FreeRTOS Demo SUCCESS\r\n"
|
#define mainDEMO_SUCCESS_MESSAGE "FreeRTOS Demo SUCCESS\r\n"
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -126,22 +160,18 @@ void main_full( void );
|
||||||
*/
|
*/
|
||||||
static void prvCheckTask( void *pvParameters );
|
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
|
* 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
|
* 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
|
* entry points are kept in the C file for the convenience of checking the task
|
||||||
* parameter.
|
* parameter.
|
||||||
*/
|
*/
|
||||||
static void prvRegTestTaskEntry1( void *pvParameters );
|
#if( configSTART_REGISTER_TESTS == 1 )
|
||||||
extern void vRegTest1Implementation( void );
|
static void prvRegTestTaskEntry1( void *pvParameters );
|
||||||
static void prvRegTestTaskEntry2( void *pvParameters );
|
extern void vRegTest1Implementation( void );
|
||||||
extern void vRegTest2Implementation( 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
|
* Tick hook used by the full demo, which includes code that interacts with
|
||||||
|
@ -155,61 +185,194 @@ void vFullDemoTickHook( void );
|
||||||
register check tasks to the check task. If the variables keep incrementing,
|
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
|
then the register check tasks have not discovered any errors. If a variable
|
||||||
stops incrementing, then an error has been found. */
|
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 )
|
void main_full( void )
|
||||||
{
|
{
|
||||||
/* Start all the other standard demo/test tasks. They have no particular
|
BaseType_t xResult;
|
||||||
functionality, but do demonstrate how to use the FreeRTOS API and test the
|
xResult = xTaskCreate( prvCheckTask, "Check", mainCHECK_TASK_STACK_SIZE_WORDS, NULL, mainCHECK_TASK_PRIORITY, NULL );
|
||||||
kernel port. */
|
/* Start all the other standard demo/test tasks. They have no particular
|
||||||
vStartDynamicPriorityTasks();
|
functionality, but do demonstrate how to use the FreeRTOS API and test the
|
||||||
vCreateBlockTimeTasks();
|
kernel port. */
|
||||||
vStartGenericQueueTasks( tskIDLE_PRIORITY );
|
if( xResult == pdPASS )
|
||||||
vStartRecursiveMutexTasks();
|
{
|
||||||
vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
|
#if( configSTART_TASK_NOTIFY_TESTS == 1 )
|
||||||
vStartEventGroupTasks();
|
{
|
||||||
vStartTaskNotifyTask();
|
vStartTaskNotifyTask();
|
||||||
vCreateAbortDelayTasks();
|
}
|
||||||
vStartCountingSemaphoreTasks();
|
#endif /* configSTART_TASK_NOTIFY_TESTS */
|
||||||
vStartMessageBufferTasks( configMINIMAL_STACK_SIZE );
|
|
||||||
vStartStreamBufferTasks();
|
|
||||||
vStartStreamBufferInterruptDemo();
|
|
||||||
|
|
||||||
/* Create the register check tasks, as described at the top of this file.
|
#if( configSTART_TASK_NOTIFY_ARRAY_TESTS == 1 )
|
||||||
Use xTaskCreateStatic() to create a task using only statically allocated
|
{
|
||||||
memory. */
|
vStartTaskNotifyArrayTask();
|
||||||
xTaskCreate( prvRegTestTaskEntry1, /* The function that implements the task. */
|
}
|
||||||
"Reg1", /* The name of the task. */
|
#endif /* configSTART_TASK_NOTIFY_ARRAY_TESTS */
|
||||||
mainREG_TEST_STACK_SIZE_WORDS, /* Size of stack to allocate for the task - in words not bytes!. */
|
|
||||||
mainREG_TEST_TASK_1_PARAMETER, /* Parameter passed into the task. */
|
|
||||||
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
|
#if( configSTART_BLOCKING_QUEUE_TESTS == 1 )
|
||||||
the top of this file. */
|
{
|
||||||
xTaskCreate( prvCheckTask, "Check", mainCHECK_TASK_STACK_SIZE_WORDS, NULL, mainCHECK_TASK_PRIORITY, NULL );
|
vStartBlockingQueueTasks( testrunnerBLOCK_Q_PRIORITY );
|
||||||
|
}
|
||||||
|
#endif /* configSTART_BLOCKING_QUEUE_TESTS */
|
||||||
|
|
||||||
/* The set of tasks created by the following function call have to be
|
#if( configSTART_SEMAPHORE_TESTS == 1 )
|
||||||
created last as they keep account of the number of tasks they expect to see
|
{
|
||||||
running. */
|
vStartSemaphoreTasks( testrunnerSEM_TEST_PRIORITY );
|
||||||
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
|
}
|
||||||
|
#endif /* configSTART_SEMAPHORE_TESTS */
|
||||||
|
|
||||||
/* Start the timers that are used to exercise external interrupt handling. */
|
#if( configSTART_POLLED_QUEUE_TESTS == 1 )
|
||||||
prvSetupPeripheralTimers();
|
{
|
||||||
|
vStartPolledQueueTasks( testrunnerQUEUE_POLL_PRIORITY );
|
||||||
|
}
|
||||||
|
#endif /* configSTART_POLLED_QUEUE_TESTS */
|
||||||
|
|
||||||
/* Start the scheduler. */
|
#if( configSTART_INTEGER_MATH_TESTS == 1 )
|
||||||
vTaskStartScheduler();
|
{
|
||||||
|
vStartIntegerMathTasks( testrunnerINTEGER_TASK_PRIORITY );
|
||||||
|
}
|
||||||
|
#endif /* configSTART_INTEGER_MATH_TESTS */
|
||||||
|
|
||||||
/* If all is well, the scheduler will now be running, and the following
|
#if( configSTART_GENERIC_QUEUE_TESTS == 1 )
|
||||||
line will never be reached. If the following line does execute, then
|
{
|
||||||
there was insufficient FreeRTOS heap memory available for the Idle and/or
|
vStartGenericQueueTasks( testrunnerGEN_QUEUE_TASK_PRIORITY );
|
||||||
timer tasks to be created. See the memory management section on the
|
}
|
||||||
FreeRTOS web site for more details on the FreeRTOS heap
|
#endif /* configSTART_GENERIC_QUEUE_TESTS */
|
||||||
http://www.freertos.org/a00111.html. */
|
|
||||||
for( ;; );
|
#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!. */
|
||||||
|
mainREG_TEST_TASK_1_PARAMETER, /* Parameter passed into the task. */
|
||||||
|
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 );
|
||||||
|
}
|
||||||
|
#endif /* configSTART_REGISTER_TESTS */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Start the scheduler. */
|
||||||
|
vTaskStartScheduler();
|
||||||
|
|
||||||
|
/* If all is well, the scheduler will now be running, and the following
|
||||||
|
line will never be reached. If the following line does execute, then
|
||||||
|
there was insufficient FreeRTOS heap memory available for the Idle and/or
|
||||||
|
timer tasks to be created. See the memory management section on the
|
||||||
|
FreeRTOS web site for more details on the FreeRTOS heap
|
||||||
|
http://www.freertos.org/a00111.html. */
|
||||||
|
for( ;; );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -217,190 +380,396 @@ static void prvCheckTask( void *pvParameters )
|
||||||
{
|
{
|
||||||
TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;
|
TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD;
|
||||||
TickType_t xLastExecutionTime;
|
TickType_t xLastExecutionTime;
|
||||||
uint32_t ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
|
|
||||||
char * const pcPassMessage = mainDEMO_SUCCESS_MESSAGE;
|
char * const pcPassMessage = mainDEMO_SUCCESS_MESSAGE;
|
||||||
char * pcStatusMessage = pcPassMessage;
|
char * pcStatusMessage = pcPassMessage;
|
||||||
extern void vToggleLED( void );
|
extern void vToggleLED( void );
|
||||||
|
|
||||||
/* Just to stop compiler warnings. */
|
#if( configSTART_REGISTER_TESTS == 1 )
|
||||||
( void ) pvParameters;
|
uint32_t ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
|
||||||
|
#endif /* configSTART_REGISTER_TESTS */
|
||||||
|
|
||||||
/* Demo start marker. */
|
/* Just to stop compiler warnings. */
|
||||||
configPRINT_STRING( "FreeRTOS Demo Start\r\n" );
|
( void ) pvParameters;
|
||||||
|
|
||||||
/* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
|
/* Demo start marker. */
|
||||||
works correctly. */
|
configPRINT_STRING( "FreeRTOS Demo Start\r\n" );
|
||||||
xLastExecutionTime = xTaskGetTickCount();
|
|
||||||
|
|
||||||
/* Cycle for ever, delaying then checking all the other tasks are still
|
/* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
|
||||||
operating without error. The onboard LED is toggled on each iteration.
|
works correctly. */
|
||||||
If an error is detected then the delay period is decreased from
|
xLastExecutionTime = xTaskGetTickCount();
|
||||||
mainNO_ERROR_CHECK_TASK_PERIOD to mainERROR_CHECK_TASK_PERIOD. This has the
|
|
||||||
effect of increasing the rate at which the onboard LED toggles, and in so
|
|
||||||
doing gives visual feedback of the system status. */
|
|
||||||
for( ;; )
|
|
||||||
{
|
|
||||||
/* Delay until it is time to execute again. */
|
|
||||||
vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod );
|
|
||||||
|
|
||||||
/* Check all the demo tasks (other than the flash tasks) to ensure
|
/* Cycle for ever, delaying then checking all the other tasks are still
|
||||||
that they are all still running, and that none have detected an error. */
|
operating without error. The onboard LED is toggled on each iteration.
|
||||||
if( xAreDynamicPriorityTasksStillRunning() == pdFALSE )
|
If an error is detected then the delay period is decreased from
|
||||||
{
|
mainNO_ERROR_CHECK_TASK_PERIOD to mainERROR_CHECK_TASK_PERIOD. This has the
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Dynamic priority demo/tests.\r\n";
|
effect of increasing the rate at which the onboard LED toggles, and in so
|
||||||
}
|
doing gives visual feedback of the system status. */
|
||||||
|
for( ;; )
|
||||||
|
{
|
||||||
|
/* Delay until it is time to execute again. */
|
||||||
|
vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod );
|
||||||
|
|
||||||
if( xAreBlockTimeTestTasksStillRunning() == pdFALSE )
|
/* 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. */
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Block time demo/tests.\r\n";
|
#if( configSTART_TASK_NOTIFY_TESTS == 1 )
|
||||||
}
|
{
|
||||||
|
if( xAreTaskNotificationTasksStillRunning() != pdTRUE )
|
||||||
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: Notification";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_TASK_NOTIFY_TESTS */
|
||||||
|
|
||||||
if( xAreGenericQueueTasksStillRunning() == pdFALSE )
|
#if( configSTART_TASK_NOTIFY_ARRAY_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Generic queue demo/tests.\r\n";
|
if( xAreTaskNotificationArrayTasksStillRunning() != pdTRUE )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: Notification Array";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_TASK_NOTIFY_ARRAY_TESTS */
|
||||||
|
|
||||||
if( xAreRecursiveMutexTasksStillRunning() == pdFALSE )
|
#if( configSTART_BLOCKING_QUEUE_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Recursive mutex demo/tests.\r\n";
|
if( xAreBlockingQueuesStillRunning() != pdTRUE )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: BlockQueue";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_BLOCKING_QUEUE_TESTS */
|
||||||
|
|
||||||
if( xAreTimerDemoTasksStillRunning( ( TickType_t ) xDelayPeriod ) == pdFALSE )
|
#if( configSTART_SEMAPHORE_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Timer demo/tests.\r\n";
|
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: SemTest";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_SEMAPHORE_TESTS */
|
||||||
|
|
||||||
if( xAreEventGroupTasksStillRunning() == pdFALSE )
|
#if( configSTART_POLLED_QUEUE_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Event group demo/tests.\r\n";
|
if( xArePollingQueuesStillRunning() != pdTRUE )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: PollQueue";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_POLLED_QUEUE_TESTS */
|
||||||
|
|
||||||
if( xAreTaskNotificationTasksStillRunning() == pdFALSE )
|
#if( configSTART_INTEGER_MATH_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Task notification demo/tests.\r\n";
|
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: IntMath";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_INTEGER_MATH_TESTS */
|
||||||
|
|
||||||
if( xAreAbortDelayTestTasksStillRunning() == pdFALSE )
|
#if( configSTART_GENERIC_QUEUE_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Abort delay.\r\n";
|
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: GenQueue";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_GENERIC_QUEUE_TESTS */
|
||||||
|
|
||||||
if( xAreCountingSemaphoreTasksStillRunning() == pdFALSE )
|
#if( configSTART_PEEK_QUEUE_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Counting semaphores.\r\n";
|
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: QueuePeek";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_PEEK_QUEUE_TESTS */
|
||||||
|
|
||||||
if( xIsCreateTaskStillRunning() == pdFALSE )
|
#if( configSTART_MATH_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Suicide tasks.\r\n";
|
if( xAreMathsTaskStillRunning() != pdPASS )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: Flop";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_MATH_TESTS */
|
||||||
|
|
||||||
if( xAreMessageBufferTasksStillRunning() == pdFALSE )
|
#if( configSTART_RECURSIVE_MUTEX_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Message buffer.\r\n";
|
if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: RecMutex";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_RECURSIVE_MUTEX_TESTS */
|
||||||
|
|
||||||
if( xAreStreamBufferTasksStillRunning() == pdFALSE )
|
#if( configSTART_COUNTING_SEMAPHORE_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Stream buffer.\r\n";
|
if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: CountSem";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_COUNTING_SEMAPHORE_TESTS */
|
||||||
|
|
||||||
if( xIsInterruptStreamBufferDemoStillRunning() == pdFALSE )
|
#if( configSTART_QUEUE_SET_TESTS == 1 )
|
||||||
{
|
{
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Stream buffer interrupt.\r\n";
|
if( xAreQueueSetTasksStillRunning() != pdPASS )
|
||||||
}
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: Queue set";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_QUEUE_SET_TESTS */
|
||||||
|
|
||||||
/* Check that the register test 1 task is still running. */
|
#if( configSTART_QUEUE_OVERWRITE_TESTS == 1 )
|
||||||
if( ulLastRegTest1Value == ulRegTest1LoopCounter )
|
{
|
||||||
{
|
if( xIsQueueOverwriteTaskStillRunning() != pdPASS )
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Register test 1.\r\n";
|
{
|
||||||
}
|
pcStatusMessage = "FreeRTOS Demo ERROR: Queue overwrite";
|
||||||
ulLastRegTest1Value = ulRegTest1LoopCounter;
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_QUEUE_OVERWRITE_TESTS */
|
||||||
|
|
||||||
/* Check that the register test 2 task is still running. */
|
#if( configSTART_EVENT_GROUP_TESTS == 1 )
|
||||||
if( ulLastRegTest2Value == ulRegTest2LoopCounter )
|
{
|
||||||
{
|
if( xAreEventGroupTasksStillRunning() != pdTRUE )
|
||||||
pcStatusMessage = "FreeRTOS Demo ERROR: Register test 2.\r\n";
|
{
|
||||||
}
|
pcStatusMessage = "FreeRTOS Demo ERROR: EventGroup";
|
||||||
ulLastRegTest2Value = ulRegTest2LoopCounter;
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_EVENT_GROUP_TESTS */
|
||||||
|
|
||||||
/* Write the status message to the UART. */
|
#if( configSTART_INTERRUPT_SEMAPHORE_TESTS == 1 )
|
||||||
vToggleLED();
|
{
|
||||||
configPRINT_STRING( pcStatusMessage );
|
if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE )
|
||||||
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: IntSem";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* configSTART_INTERRUPT_SEMAPHORE_TESTS */
|
||||||
|
|
||||||
/* If an error has been found then increase the LED toggle rate by
|
#if( configSTART_QUEUE_SET_POLLING_TESTS == 1 )
|
||||||
increasing the cycle frequency. */
|
{
|
||||||
if( pcStatusMessage != pcPassMessage )
|
if( xAreQueueSetPollTasksStillRunning() != pdPASS )
|
||||||
{
|
{
|
||||||
xDelayPeriod = mainERROR_CHECK_TASK_PERIOD;
|
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( configSTART_REGISTER_TESTS == 1 )
|
||||||
|
{
|
||||||
|
/* Check that the register test 1 task is still running. */
|
||||||
|
if( ulLastRegTest1Value == ulRegTest1LoopCounter )
|
||||||
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: Register test 1.\r\n";
|
||||||
|
}
|
||||||
|
ulLastRegTest1Value = ulRegTest1LoopCounter;
|
||||||
|
|
||||||
|
/* Check that the register test 2 task is still running. */
|
||||||
|
if( ulLastRegTest2Value == ulRegTest2LoopCounter )
|
||||||
|
{
|
||||||
|
pcStatusMessage = "FreeRTOS Demo ERROR: Register test 2.\r\n";
|
||||||
|
}
|
||||||
|
ulLastRegTest2Value = ulRegTest2LoopCounter;
|
||||||
|
}
|
||||||
|
#endif /* configSTART_REGISTER_TESTS */
|
||||||
|
|
||||||
|
/* Write the status message to the UART. */
|
||||||
|
vToggleLED();
|
||||||
|
|
||||||
|
/* If an error has been found then increase the LED toggle rate by
|
||||||
|
increasing the cycle frequency. */
|
||||||
|
if( pcStatusMessage != pcPassMessage )
|
||||||
|
{
|
||||||
|
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
|
/* Although the regtest task is written in assembler, its entry point is
|
||||||
in correctly. */
|
written in C for convenience of checking the task parameter is being passed
|
||||||
if( pvParameters == mainREG_TEST_TASK_1_PARAMETER )
|
in correctly. */
|
||||||
{
|
if( pvParameters == mainREG_TEST_TASK_1_PARAMETER )
|
||||||
/* Start the part of the test that is written in assembler. */
|
{
|
||||||
vRegTest1Implementation();
|
/* Start the part of the test that is written in assembler. */
|
||||||
}
|
vRegTest1Implementation();
|
||||||
|
}
|
||||||
|
|
||||||
/* The following line will only execute if the task parameter is found to
|
/* The following line will only execute if the task parameter is found to
|
||||||
be incorrect. The check task will detect that the regtest loop counter is
|
be incorrect. The check task will detect that the regtest loop counter is
|
||||||
not being incremented and flag an error. */
|
not being incremented and flag an error. */
|
||||||
vTaskDelete( NULL );
|
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
|
/* Although the regtest task is written in assembler, its entry point is
|
||||||
in correctly. */
|
written in C for convenience of checking the task parameter is being passed
|
||||||
if( pvParameters == mainREG_TEST_TASK_2_PARAMETER )
|
in correctly. */
|
||||||
{
|
if( pvParameters == mainREG_TEST_TASK_2_PARAMETER )
|
||||||
/* Start the part of the test that is written in assembler. */
|
{
|
||||||
vRegTest2Implementation();
|
/* Start the part of the test that is written in assembler. */
|
||||||
}
|
vRegTest2Implementation();
|
||||||
|
}
|
||||||
|
|
||||||
/* The following line will only execute if the task parameter is found to
|
/* The following line will only execute if the task parameter is found to
|
||||||
be incorrect. The check task will detect that the regtest loop counter is
|
be incorrect. The check task will detect that the regtest loop counter is
|
||||||
not being incremented and flag an error. */
|
not being incremented and flag an error. */
|
||||||
vTaskDelete( NULL );
|
vTaskDelete( NULL );
|
||||||
}
|
}
|
||||||
|
#endif /* configSTART_REGISTER_TESTS */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vFullDemoTickHook( void )
|
void vFullDemoTickHook( void )
|
||||||
{
|
{
|
||||||
/* The full demo includes a software timer demo/test that requires
|
/* The full demo includes a software timer demo/test that requires
|
||||||
prodding periodically from the tick interrupt. */
|
build the full test/demo applications. */
|
||||||
vTimerPeriodicISRTests();
|
#if( configSTART_TASK_NOTIFY_TESTS == 1 )
|
||||||
|
{
|
||||||
|
/* Use task notifications from an interrupt. */
|
||||||
|
xNotifyTaskFromISR();
|
||||||
|
}
|
||||||
|
#endif /* configSTART_TASK_NOTIFY_TESTS */
|
||||||
|
|
||||||
/* Call the periodic event group from ISR demo. */
|
#if( configSTART_TASK_NOTIFY_ARRAY_TESTS == 1 )
|
||||||
vPeriodicEventGroupsProcessing();
|
{
|
||||||
|
xNotifyArrayTaskFromISR();
|
||||||
|
}
|
||||||
|
#endif /* configSTART_TASK_NOTIFY_ARRAY_TESTS */
|
||||||
|
|
||||||
/* Use task notifications from an interrupt. */
|
#if( configSTART_QUEUE_SET_TESTS == 1 )
|
||||||
xNotifyTaskFromISR();
|
{
|
||||||
|
vQueueSetAccessQueueSetFromISR();
|
||||||
|
}
|
||||||
|
#endif /* configSTART_QUEUE_SET_TESTS */
|
||||||
|
|
||||||
/* Writes to stream buffer byte by byte to test the stream buffer trigger
|
#if( configSTART_QUEUE_OVERWRITE_TESTS == 1 )
|
||||||
level functionality. */
|
{
|
||||||
vPeriodicStreamBufferProcessing();
|
vQueueOverwritePeriodicISRDemo();
|
||||||
|
}
|
||||||
|
#endif /* configSTART_QUEUE_OVERWRITE_TESTS */
|
||||||
|
|
||||||
/* Writes a string to a string buffer four bytes at a time to demonstrate
|
#if( configSTART_EVENT_GROUP_TESTS == 1 )
|
||||||
a stream being sent from an interrupt to a task. */
|
{
|
||||||
vBasicStreamBufferSendFromISR();
|
/* Call the periodic event group from ISR demo. */
|
||||||
|
vPeriodicEventGroupsProcessing();
|
||||||
|
}
|
||||||
|
#endif /* configSTART_EVENT_GROUP_TESTS */
|
||||||
|
|
||||||
/* Called from vApplicationTickHook() when the project is configured to
|
#if( configSTART_INTERRUPT_SEMAPHORE_TESTS == 1 )
|
||||||
build the full test/demo applications. */
|
{
|
||||||
|
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 */
|
||||||
|
|
||||||
|
#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. */
|
/* FreeRTOS kernel includes. */
|
||||||
#include <FreeRTOS.h>
|
#include <FreeRTOS.h>
|
||||||
#include <task.h>
|
#include <task.h>
|
||||||
|
@ -67,16 +55,16 @@
|
||||||
|
|
||||||
/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,
|
/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,
|
||||||
or 0 to run the more comprehensive test and demo application. */
|
or 0 to run the more comprehensive test and demo application. */
|
||||||
#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0
|
#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.
|
* main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.
|
||||||
* main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.
|
* main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.
|
||||||
*/
|
*/
|
||||||
#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1
|
#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1
|
||||||
extern void main_blinky( void );
|
extern void main_blinky( void );
|
||||||
#else
|
#else
|
||||||
extern void main_full( void );
|
extern void main_full( void );
|
||||||
#endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */
|
#endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */
|
||||||
|
|
||||||
/* Prototypes for the standard FreeRTOS callback/hook functions implemented
|
/* Prototypes for the standard FreeRTOS callback/hook functions implemented
|
||||||
|
@ -93,19 +81,19 @@ static void prvSetupHardware( void );
|
||||||
|
|
||||||
void main( void )
|
void main( void )
|
||||||
{
|
{
|
||||||
prvSetupHardware();
|
prvSetupHardware();
|
||||||
|
|
||||||
/* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
|
/* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
|
||||||
of this file. */
|
of this file. */
|
||||||
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
|
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
|
||||||
{
|
{
|
||||||
main_blinky();
|
main_blinky();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
main_full();
|
main_full();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -113,79 +101,79 @@ static void prvSetupHardware( void )
|
||||||
{
|
{
|
||||||
gpio_pin_config_t mGpioPinConfigStruct;
|
gpio_pin_config_t mGpioPinConfigStruct;
|
||||||
|
|
||||||
/* Init board hardware. */
|
/* Init board hardware. */
|
||||||
BOARD_InitPins();
|
BOARD_InitPins();
|
||||||
BOARD_BootClockRUN();
|
BOARD_BootClockRUN();
|
||||||
BOARD_InitDebugConsole();
|
BOARD_InitDebugConsole();
|
||||||
|
|
||||||
/* For LED. */
|
/* For LED. */
|
||||||
mGpioPinConfigStruct.outputLogic = 1U; /* High. */
|
mGpioPinConfigStruct.outputLogic = 1U; /* High. */
|
||||||
mGpioPinConfigStruct.pinDirection = kGPIO_DigitalOutput;
|
mGpioPinConfigStruct.pinDirection = kGPIO_DigitalOutput;
|
||||||
GPIO_PinInit( BOARD_LED1_GPIO, BOARD_LED1_GPIO_PIN, &mGpioPinConfigStruct );
|
GPIO_PinInit( BOARD_LED1_GPIO, BOARD_LED1_GPIO_PIN, &mGpioPinConfigStruct );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vToggleLED( void )
|
void vToggleLED( void )
|
||||||
{
|
{
|
||||||
GPIO_TogglePinsOutput( BOARD_LED1_GPIO, 1U << BOARD_LED1_GPIO_PIN );
|
GPIO_TogglePinsOutput( BOARD_LED1_GPIO, 1U << BOARD_LED1_GPIO_PIN );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vApplicationMallocFailedHook( void )
|
void vApplicationMallocFailedHook( void )
|
||||||
{
|
{
|
||||||
/* vApplicationMallocFailedHook() will only be called if
|
/* vApplicationMallocFailedHook() will only be called if
|
||||||
configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook
|
configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook
|
||||||
function that will get called if a call to pvPortMalloc() fails.
|
function that will get called if a call to pvPortMalloc() fails.
|
||||||
pvPortMalloc() is called internally by the kernel whenever a task, queue,
|
pvPortMalloc() is called internally by the kernel whenever a task, queue,
|
||||||
timer or semaphore is created. It is also called by various parts of the
|
timer or semaphore is created. It is also called by various parts of the
|
||||||
demo application. If heap_1.c or heap_2.c are used, then the size of the
|
demo application. If heap_1.c or heap_2.c are used, then the size of the
|
||||||
heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in
|
heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in
|
||||||
FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used
|
FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used
|
||||||
to query the size of free heap space that remains (although it does not
|
to query the size of free heap space that remains (although it does not
|
||||||
provide information on how the remaining heap might be fragmented). */
|
provide information on how the remaining heap might be fragmented). */
|
||||||
taskDISABLE_INTERRUPTS();
|
taskDISABLE_INTERRUPTS();
|
||||||
__asm volatile( "ebreak" );
|
__asm volatile( "ebreak" );
|
||||||
for( ;; );
|
for( ;; );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vApplicationIdleHook( void )
|
void vApplicationIdleHook( void )
|
||||||
{
|
{
|
||||||
/* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set
|
/* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set
|
||||||
to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle
|
to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle
|
||||||
task. It is essential that code added to this hook function never attempts
|
task. It is essential that code added to this hook function never attempts
|
||||||
to block in any way (for example, call xQueueReceive() with a block time
|
to block in any way (for example, call xQueueReceive() with a block time
|
||||||
specified, or call vTaskDelay()). If the application makes use of the
|
specified, or call vTaskDelay()). If the application makes use of the
|
||||||
vTaskDelete() API function (as this demo application does) then it is also
|
vTaskDelete() API function (as this demo application does) then it is also
|
||||||
important that vApplicationIdleHook() is permitted to return to its calling
|
important that vApplicationIdleHook() is permitted to return to its calling
|
||||||
function, because it is the responsibility of the idle task to clean up
|
function, because it is the responsibility of the idle task to clean up
|
||||||
memory allocated by the kernel to any task that has since been deleted. */
|
memory allocated by the kernel to any task that has since been deleted. */
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
|
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
|
||||||
{
|
{
|
||||||
( void ) pcTaskName;
|
( void ) pcTaskName;
|
||||||
( void ) pxTask;
|
( void ) pxTask;
|
||||||
|
|
||||||
/* Run time stack overflow checking is performed if
|
/* Run time stack overflow checking is performed if
|
||||||
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
|
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
|
||||||
function is called if a stack overflow is detected. */
|
function is called if a stack overflow is detected. */
|
||||||
taskDISABLE_INTERRUPTS();
|
taskDISABLE_INTERRUPTS();
|
||||||
__asm volatile( "ebreak" );
|
__asm volatile( "ebreak" );
|
||||||
for( ;; );
|
for( ;; );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vApplicationTickHook( void )
|
void vApplicationTickHook( void )
|
||||||
{
|
{
|
||||||
/* The tests in the full demo expect some interaction with interrupts. */
|
/* The tests in the full demo expect some interaction with interrupts. */
|
||||||
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY != 1 )
|
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY != 1 )
|
||||||
{
|
{
|
||||||
extern void vFullDemoTickHook( void );
|
extern void vFullDemoTickHook( void );
|
||||||
vFullDemoTickHook();
|
vFullDemoTickHook();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -193,10 +181,10 @@ void vPortSetupTimerInterrupt( void )
|
||||||
{
|
{
|
||||||
extern void SystemSetupSystick(uint32_t tickRateHz, uint32_t intPriority );
|
extern void SystemSetupSystick(uint32_t tickRateHz, uint32_t intPriority );
|
||||||
|
|
||||||
/* No CLINT so use the LPIT (Low Power Interrupt Timer) to generate the tick
|
/* No CLINT so use the LPIT (Low Power Interrupt Timer) to generate the tick
|
||||||
interrupt. */
|
interrupt. */
|
||||||
CLOCK_SetIpSrc( kCLOCK_Lpit0, kCLOCK_IpSrcFircAsync );
|
CLOCK_SetIpSrc( kCLOCK_Lpit0, kCLOCK_IpSrcFircAsync );
|
||||||
SystemSetupSystick( configTICK_RATE_HZ, configKERNEL_INTERRUPT_PRIORITY - 1 );
|
SystemSetupSystick( configTICK_RATE_HZ, configKERNEL_INTERRUPT_PRIORITY - 1 );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -207,14 +195,14 @@ void vTaskSwitchContext( void );
|
||||||
|
|
||||||
#warning requires critical section if interrupt nesting is used.
|
#warning requires critical section if interrupt nesting is used.
|
||||||
|
|
||||||
/* vPortSetupTimerInterrupt() uses LPIT0 to generate the tick interrupt. */
|
/* vPortSetupTimerInterrupt() uses LPIT0 to generate the tick interrupt. */
|
||||||
if( xTaskIncrementTick() != 0 )
|
if( xTaskIncrementTick() != 0 )
|
||||||
{
|
{
|
||||||
vTaskSwitchContext();
|
vTaskSwitchContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear LPIT0 interrupt. */
|
/* Clear LPIT0 interrupt. */
|
||||||
LPIT0->MSR = 1U;
|
LPIT0->MSR = 1U;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -222,21 +210,22 @@ void vTaskSwitchContext( void );
|
||||||
the default SystemIrqHandler() implementation as that enables interrupts. A
|
the default SystemIrqHandler() implementation as that enables interrupts. A
|
||||||
version that does not enable interrupts is provided below. THIS INTERRUPT
|
version that does not enable interrupts is provided below. THIS INTERRUPT
|
||||||
HANDLER IS SPECIFIC TO THE VEGA BOARD WHICH DOES NOT INCLUDE A CLINT! */
|
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;
|
uint32_t ulInterruptNumber;
|
||||||
typedef void ( * irq_handler_t )( void );
|
typedef void ( * irq_handler_t )( void );
|
||||||
extern const irq_handler_t isrTable[];
|
extern const irq_handler_t isrTable[];
|
||||||
|
|
||||||
ulInterruptNumber = mcause & 0x1FUL;
|
ulInterruptNumber = mcause & 0x1FUL;
|
||||||
|
|
||||||
/* Clear pending flag in EVENT unit .*/
|
/* Clear pending flag in EVENT unit .*/
|
||||||
EVENT_UNIT->INTPTPENDCLEAR = ( 1U << ulInterruptNumber );
|
EVENT_UNIT->INTPTPENDCLEAR = ( 1U << ulInterruptNumber );
|
||||||
|
|
||||||
/* Read back to make sure write finished. */
|
/* Read back to make sure write finished. */
|
||||||
(void)(EVENT_UNIT->INTPTPENDCLEAR);
|
(void)(EVENT_UNIT->INTPTPENDCLEAR);
|
||||||
|
|
||||||
/* Now call the real irq handler for ulInterruptNumber */
|
/* Now call the real irq handler for ulInterruptNumber */
|
||||||
isrTable[ 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