mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 21:41:59 -04:00
Wind up the baud rate on the TriCore UART to obtain an extra level of interrupt nesting.
Set the UART into loopback mode so a jumper is not required.
This commit is contained in:
parent
b89f1a729a
commit
9d4616eb55
|
@ -76,7 +76,6 @@
|
|||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\recmutex.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\semtest.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\list.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\MPU_Wrappers.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\port.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\porttrap.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\portable\MemMang\heap_2.o""/>
|
||||
|
@ -87,6 +86,7 @@
|
|||
<listOptionValue builtIn="false" value=""RTOSDemo\ThirdPartyCode\cpufreq.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\main.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\serial.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\InterruptNestTest.o""/>
|
||||
</option>
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.general.description.file.1129393828" name="Browse Linker Description File (-T)" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.general.description.file" value=""..\ld\iROM.ld"" valueType="string"/>
|
||||
</tool>
|
||||
|
@ -547,7 +547,6 @@
|
|||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/FreeRTOS_Source/include}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/FreeRTOS_Source/portable/GCC/TriCore_1782}""/>
|
||||
<listOptionValue builtIn="false" value=""${TRICORE_TOOLS}/tricore/include""/>
|
||||
</option>
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.assembler.symbols.defined.212143771" name="Defined symbols (-D)" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.assembler.symbols.defined" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
|
@ -557,7 +556,6 @@
|
|||
<tool id="com.rt.hightec.buildsystem.tricore.new.compiler.c.1160628898" name="TriCore C Compiler" superClass="com.rt.hightec.buildsystem.tricore.new.compiler.c">
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.symbols.defined.827024089" name="Defined symbols (-D)" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.symbols.defined" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="TRIBOARD_TC1782"/>
|
||||
<listOptionValue builtIn="false" value="BUILD_FOR_RAM_EXECUTION"/>
|
||||
</option>
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.general.paths.666426724" name="Include Paths" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.general.paths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/Common_Demo_Source/include}""/>
|
||||
|
@ -566,7 +564,7 @@
|
|||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Source/portable/PLS/TriCore_1782_MPU}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/RTOSDemo/FreeRTOS_Source/portable/GCC/TriCore_1782}""/>
|
||||
</option>
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.optimization.optimization.1251458415" name="Optimization Level" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.optimization.optimization" value="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.code.optimization.0" valueType="enumerated"/>
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.optimization.optimization.1251458415" name="Optimization Level" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.optimization.optimization" value="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.code.optimization.s" valueType="enumerated"/>
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.miscellaneous.options.538537192" name="Other options" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.compiler.miscellaneous.options" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="-Wextra"/>
|
||||
<listOptionValue builtIn="false" value="-ffunction-sections"/>
|
||||
|
@ -582,9 +580,37 @@
|
|||
</option>
|
||||
</tool>
|
||||
<tool id="com.rt.hightec.buildsystem.tricore.new.linker.c.1929159535" name="TriCore C Linker" superClass="com.rt.hightec.buildsystem.tricore.new.linker.c">
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.general.description.filesToLink.236609617" name="Link order" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.general.description.filesToLink" valueType="stringList"/>
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.general.description.filesToLink.236609617" name="Link order" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.general.description.filesToLink" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\BlockQ.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\GenQTest.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\PollQ.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\QPeek.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\TimerDemo.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\blocktim.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\comtest.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\countsem.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\death.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\dynamic.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\flash.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\flop.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\integer.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\recmutex.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\Common_Demo_Source\semtest.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\list.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\port.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\portable\GCC\TriCore_1782\porttrap.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\portable\MemMang\heap_2.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\queue.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\tasks.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\FreeRTOS_Source\timers.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\InterruptNestTest.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\ParTest.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\ThirdPartyCode\cpufreq.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\main.o""/>
|
||||
<listOptionValue builtIn="false" value=""RTOSDemo\serial.o""/>
|
||||
</option>
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.general.description.file.1135546526" name="Browse Linker Description File (-T)" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.general.description.file" value=""..\ld\iRAM.ld"" valueType="string"/>
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.miscellaneous.options.695697518" name="Other options" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.miscellaneous.options" valueType="stringList"/>
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.miscellaneous.options.695697518" name="Other options" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.miscellaneous.options"/>
|
||||
</tool>
|
||||
<tool id="com.rt.hightec.buildsystem.tricore.new.linker.cpp.2086148347" name="TriCore C++ Linker" superClass="com.rt.hightec.buildsystem.tricore.new.linker.cpp">
|
||||
<option id="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.general.description.file.998677471" name="Browse Linker Description File (-T)" superClass="com.rt.hightec.framework.buildsystem.abstract.hightec.tool.linker.general.description.file" value="..\ld\iRAM.ld"" valueType="string"/>
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>?children?</key>
|
||||
<value>?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\||</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>?name?</key>
|
||||
<value></value>
|
||||
|
@ -31,7 +35,7 @@
|
|||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildLocation</key>
|
||||
<value>${workspace_loc:/FreeRTOS_Demo/iRAM}</value>
|
||||
<value>${workspace_loc:/FreeRTOS_Demo/iROM}</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -168,7 +168,6 @@ static void prvPortHighFrequencyTimerHandler( int iArg )
|
|||
static volatile unsigned long ulExecutionCounter = 0UL;
|
||||
unsigned long ulHigherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
COUNT_NEST();
|
||||
/* Just to avoid compiler warnings about unused parameters. */
|
||||
( void ) iArg;
|
||||
|
||||
|
@ -192,5 +191,4 @@ COUNT_NEST();
|
|||
}
|
||||
|
||||
portYIELD_FROM_ISR( ulHigherPriorityTaskWoken );
|
||||
ulNest--;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
volatile unsigned long ulNest = 0UL, ulMaxNest = 0UL;
|
||||
/*
|
||||
FreeRTOS V7.0.2 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||
|
||||
|
@ -60,11 +59,17 @@ volatile unsigned long ulNest = 0UL, ulMaxNest = 0UL;
|
|||
*
|
||||
* To create a very simple LED flasher example, set the
|
||||
* mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY constant (defined below) to 1. When
|
||||
* this is done, only the standard demo flash tasks are created, whereby three
|
||||
* tasks each toggle an LED at a fixed but different frequency.
|
||||
* this is done, only the standard demo flash tasks are created. The standard
|
||||
* demo flash example creates three tasks, each toggle an LED at a fixed but
|
||||
* different frequency.
|
||||
*
|
||||
* To create a more comprehensive test and demo application, set
|
||||
* mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY to 0.
|
||||
*
|
||||
* Two build configurations are provided, one that executes from RAM and one
|
||||
* that executes from Flash. The RAM build uses size optimisation, the Flash
|
||||
* build has optimisation completely turned off. The documentation page for
|
||||
* this port on the FreeRTOS.org web site provides full information.
|
||||
******************************************************************************
|
||||
*
|
||||
* main() creates all the demo application tasks and timers, then starts the
|
||||
|
@ -96,7 +101,10 @@ volatile unsigned long ulNest = 0UL, ulMaxNest = 0UL;
|
|||
* ***NOTE*** This demo uses the standard comtest tasks, which has special
|
||||
* hardware requirements as a loopback connector, or UART echo server are
|
||||
* required. See the documentation page for this demo on the FreeRTOS.org web
|
||||
* site for more information.
|
||||
* site for more information. Note that the comtest tasks were tested by
|
||||
* placing the UART into loopback mode directly in the serial initialisation
|
||||
* sequence, and as such, the baud rate used has not been verified as actually
|
||||
* being correct.
|
||||
*/
|
||||
|
||||
/* Standard includes. */
|
||||
|
@ -129,7 +137,8 @@ volatile unsigned long ulNest = 0UL, ulMaxNest = 0UL;
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Constants for the ComTest tasks. */
|
||||
#define mainCOM_TEST_BAUD_RATE ( ( unsigned long ) 115200 )
|
||||
#define mainCOM_TEST_BAUD_RATE ( ( unsigned long ) 200000 )
|
||||
|
||||
#define mainCOM_TEST_LED ( 5 )
|
||||
|
||||
/* Priorities for the demo application tasks. */
|
||||
|
@ -147,12 +156,16 @@ error. */
|
|||
#define mainERROR_FLASH_PERIOD_MS ( ( portTickType ) 500 / portTICK_RATE_MS )
|
||||
#define mainON_BOARD_LED_BIT ( ( unsigned long ) 7 )
|
||||
|
||||
/* Constant used by the standard timer test functions. */
|
||||
#define mainTIMER_TEST_PERIOD ( 50 )
|
||||
/* Constant used by the standard timer test functions. The timers created by
|
||||
the timer test functions will all have a period that is a multiple of this
|
||||
value. */
|
||||
#define mainTIMER_TEST_PERIOD ( 200 )
|
||||
|
||||
/* Set mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY to 1 to create a simple demo.
|
||||
Set mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY to 0 to create a much more
|
||||
comprehensive test application. See the comments at the top of this file. */
|
||||
comprehensive test application. See the comments at the top of this file, and
|
||||
the documentation page on the http://www.FreeRTOS.org web site for more
|
||||
information. */
|
||||
#define mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY 0
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -177,13 +190,13 @@ static void prvSetupHardware( void );
|
|||
|
||||
/*
|
||||
* Writes to and checks the value of each register that is used in the context
|
||||
* of a task.
|
||||
* of a task. See the comments at the top of this file.
|
||||
*/
|
||||
static void prvRegisterCheckTask1( void *pvParameters );
|
||||
static void prvRegisterCheckTask2( void *pvParameters );
|
||||
|
||||
/*
|
||||
* Specific check to see if the Register test functions are still operating
|
||||
* Specific check to see if the register test functions are still operating
|
||||
* correctly.
|
||||
*/
|
||||
static portBASE_TYPE prvAreRegTestTasksStillRunning( void );
|
||||
|
@ -215,11 +228,11 @@ int main( void )
|
|||
/* Setup the hardware for use with the TriCore evaluation board. */
|
||||
prvSetupHardware();
|
||||
|
||||
/* Start standard demo/test application tasks. See the comments at the
|
||||
top of this file. The LED flash tasks are always created. The other tasks
|
||||
are only created if mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY is set to 1 (at
|
||||
the top of this file). See the comments at the top of this file for more
|
||||
information. */
|
||||
/* Start standard demo/test application flash tasks. See the comments at
|
||||
the top of this file. The LED flash tasks are always created. The other
|
||||
tasks are only created if mainCREATE_SIMPLE_LED_FLASHER_DEMO_ONLY is set to
|
||||
1 (at the top of this file). See the comments at the top of this file for
|
||||
more information. */
|
||||
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
|
||||
|
||||
/* The following function will only create more tasks and timers if
|
||||
|
|
|
@ -99,7 +99,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned port
|
|||
{
|
||||
unsigned long ulReloadValue = 0UL;
|
||||
|
||||
ulReloadValue = ( configPERIPHERAL_CLOCK_HZ / ( 32 * ulWantedBaud ) ) - 1;
|
||||
ulReloadValue = ( configPERIPHERAL_CLOCK_HZ / ( 48UL * ulWantedBaud ) ) - 1UL;
|
||||
|
||||
if( NULL == xSerialTransmitQueue )
|
||||
{
|
||||
|
@ -126,7 +126,13 @@ unsigned long ulReloadValue = 0UL;
|
|||
|
||||
/* Reconfigure and re-initialise the Operation. */
|
||||
ASC0_PISEL.reg = 0UL;
|
||||
ASC0_CON.reg = 0x00008011; /* 1 Start, 1 Stop, 8 Data, No Parity, No Error Checking, Receive On, Module On. */
|
||||
ASC0_CON.reg = 0UL;
|
||||
ASC0_CON.bits.M = 0x01; /* 8bit async. */
|
||||
ASC0_CON.bits.REN = 0x01; /* Receiver enabled. */
|
||||
ASC0_CON.bits.FDE = 0x01; /* Fractional divider enabled. */
|
||||
ASC0_CON.bits.BRS = 0x01; /* Divide by three. */
|
||||
ASC0_CON.bits.LB = 0x01; /* Loopback enabled. */
|
||||
ASC0_CON.bits.R = 0x01; /* Enable the baud rate generator. */
|
||||
|
||||
/* Install the Tx interrupt. */
|
||||
if( 0 != _install_int_handler( configINTERRUPT_PRIORITY_TX, prvTxBufferInterruptHandler, 0 ) )
|
||||
|
@ -188,8 +194,6 @@ static void prvTxBufferInterruptHandler( int iArg )
|
|||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||
unsigned char ucTx;
|
||||
|
||||
COUNT_NEST();
|
||||
|
||||
/* Just to remove compiler warnings about unused parameters. */
|
||||
( void ) iArg;
|
||||
|
||||
|
@ -210,7 +214,6 @@ COUNT_NEST();
|
|||
|
||||
/* Finally end ISR and switch Task. */
|
||||
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
ulNest--;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -218,7 +221,7 @@ static void prvRxInterruptHandler( int iArg )
|
|||
{
|
||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||
unsigned char ucRx;
|
||||
COUNT_NEST();
|
||||
|
||||
/* Just to remove compiler warnings about unused parameters. */
|
||||
( void ) iArg;
|
||||
|
||||
|
@ -236,7 +239,6 @@ COUNT_NEST();
|
|||
|
||||
/* Finally end ISR and switch Task. */
|
||||
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
ulNest--;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
|
|
Loading…
Reference in a new issue