FreeRTOS source changes:

+ heap_1.c and heap_2.c now support configAPPLICATION_ALLOCATED_HEAP (heap_4.c already did) which allows the heap to be placed by the user rather than the linker.

Demo app changes:
+ SAMD20 project has been updated to use Atmel Studio 7.
This commit is contained in:
Richard Barry 2015-11-22 21:14:39 +00:00
parent e9561c946c
commit fa86d4eece
5 changed files with 52 additions and 81 deletions

View file

@ -2,7 +2,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup> <PropertyGroup>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>6.1</ProjectVersion> <ProjectVersion>7.0</ProjectVersion>
<ProjectGuid>{2a475b6a-78b0-4237-8947-341bd379ab5c}</ProjectGuid> <ProjectGuid>{2a475b6a-78b0-4237-8947-341bd379ab5c}</ProjectGuid>
<Name>$(MSBuildProjectName)</Name> <Name>$(MSBuildProjectName)</Name>
<AssemblyName>$(MSBuildProjectName)</AssemblyName> <AssemblyName>$(MSBuildProjectName)</AssemblyName>
@ -165,7 +165,7 @@
<documentation help="http://asf.atmel.com/docs/3.11.0/common.applications.user_application.xplained_pro2.samd20_xplained_pro/html/index.html" /> <documentation help="http://asf.atmel.com/docs/3.11.0/common.applications.user_application.xplained_pro2.samd20_xplained_pro/html/index.html" />
<offline-documentation help="" /> <offline-documentation help="" />
<dependencies> <dependencies>
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.11.0" /> <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.18.1" />
</dependencies> </dependencies>
<project id="common.applications.user_application.xplained_pro2.samd20_xplained_pro" value="Add" config="" content-id="Atmel.ASF" /> <project id="common.applications.user_application.xplained_pro2.samd20_xplained_pro" value="Add" config="" content-id="Atmel.ASF" />
<board id="board.samd20_xplained_pro" value="Add" config="" content-id="Atmel.ASF" /> <board id="board.samd20_xplained_pro" value="Add" config="" content-id="Atmel.ASF" />
@ -216,6 +216,8 @@
<ToolNumber>000591000435</ToolNumber> <ToolNumber>000591000435</ToolNumber>
<ToolName>J-Link</ToolName> <ToolName>J-Link</ToolName>
</com_atmel_avrdbg_tool_samice> </com_atmel_avrdbg_tool_samice>
<preserveEEPROM>true</preserveEEPROM>
<ExternalProgrammingToolCommand />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings> <ToolchainSettings>
@ -282,38 +284,6 @@
</armgcc.linker.libraries.LibrarySearchPaths> </armgcc.linker.libraries.LibrarySearchPaths>
<armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections> <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
<armgcc.linker.miscellaneous.LinkerFlags>-Wl,--entry=Reset_Handler -Wl,--cref -mthumb -T../src/ASF/sam0/utils/linker_scripts/samd20/gcc/samd20j18_flash.ld</armgcc.linker.miscellaneous.LinkerFlags> <armgcc.linker.miscellaneous.LinkerFlags>-Wl,--entry=Reset_Handler -Wl,--cref -mthumb -T../src/ASF/sam0/utils/linker_scripts/samd20/gcc/samd20j18_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
<armgcc.assembler.general.IncludePaths>
<ListValues>
<Value>../src</Value>
<Value>../src/ASF/common/boards</Value>
<Value>../src/ASF/common/utils</Value>
<Value>../src/ASF/sam0/boards</Value>
<Value>../src/ASF/sam0/boards/samd20_xplained_pro</Value>
<Value>../src/ASF/sam0/drivers/port</Value>
<Value>../src/ASF/sam0/drivers/system</Value>
<Value>../src/ASF/sam0/drivers/system/clock</Value>
<Value>../src/ASF/sam0/drivers/system/interrupt</Value>
<Value>../src/ASF/sam0/drivers/system/pinmux</Value>
<Value>../src/ASF/sam0/utils</Value>
<Value>../src/ASF/sam0/utils/cmsis/samd20/include</Value>
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/component</Value>
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/instance</Value>
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/pio</Value>
<Value>../src/ASF/sam0/utils/cmsis/samd20/source</Value>
<Value>../src/ASF/sam0/utils/header_files</Value>
<Value>../src/ASF/sam0/utils/preprocessor</Value>
<Value>../src/ASF/thirdparty/CMSIS/Include</Value>
<Value>../src/ASF/thirdparty/CMSIS/Lib/GCC</Value>
<Value>../src/config</Value>
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel</Value>
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\CMSIS\Include</Value>
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\Device\ATMEL</Value>
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\Device\ATMEL\samd20\include</Value>
<Value>../src/ASF/common/services/serial</Value>
<Value>../src/ASF/sam0/drivers/sercom</Value>
<Value>../src/ASF/sam0/drivers/sercom/usart</Value>
</ListValues>
</armgcc.assembler.general.IncludePaths>
<armgcc.preprocessingassembler.general.AssemblerFlags>-DARM_MATH_CM0=true -DBOARD=SAMD20_XPLAINED_PRO -D__SAMD20J18__ -DUSART_CALLBACK_MODE=true</armgcc.preprocessingassembler.general.AssemblerFlags> <armgcc.preprocessingassembler.general.AssemblerFlags>-DARM_MATH_CM0=true -DBOARD=SAMD20_XPLAINED_PRO -D__SAMD20J18__ -DUSART_CALLBACK_MODE=true</armgcc.preprocessingassembler.general.AssemblerFlags>
<armgcc.preprocessingassembler.general.IncludePaths> <armgcc.preprocessingassembler.general.IncludePaths>
<ListValues> <ListValues>
@ -419,38 +389,6 @@
</armgcc.linker.libraries.LibrarySearchPaths> </armgcc.linker.libraries.LibrarySearchPaths>
<armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections> <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
<armgcc.linker.miscellaneous.LinkerFlags>-Wl,--entry=Reset_Handler -Wl,--cref -mthumb -T../src/ASF/sam0/utils/linker_scripts/samd20/gcc/samd20j18_flash.ld</armgcc.linker.miscellaneous.LinkerFlags> <armgcc.linker.miscellaneous.LinkerFlags>-Wl,--entry=Reset_Handler -Wl,--cref -mthumb -T../src/ASF/sam0/utils/linker_scripts/samd20/gcc/samd20j18_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
<armgcc.assembler.general.IncludePaths>
<ListValues>
<Value>../src</Value>
<Value>../src/ASF/common/boards</Value>
<Value>../src/ASF/common/utils</Value>
<Value>../src/ASF/sam0/boards</Value>
<Value>../src/ASF/sam0/boards/samd20_xplained_pro</Value>
<Value>../src/ASF/sam0/drivers/port</Value>
<Value>../src/ASF/sam0/drivers/system</Value>
<Value>../src/ASF/sam0/drivers/system/clock</Value>
<Value>../src/ASF/sam0/drivers/system/interrupt</Value>
<Value>../src/ASF/sam0/drivers/system/pinmux</Value>
<Value>../src/ASF/sam0/utils</Value>
<Value>../src/ASF/sam0/utils/cmsis/samd20/include</Value>
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/component</Value>
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/instance</Value>
<Value>../src/ASF/sam0/utils/cmsis/samd20/include/pio</Value>
<Value>../src/ASF/sam0/utils/cmsis/samd20/source</Value>
<Value>../src/ASF/sam0/utils/header_files</Value>
<Value>../src/ASF/sam0/utils/preprocessor</Value>
<Value>../src/ASF/thirdparty/CMSIS/Include</Value>
<Value>../src/ASF/thirdparty/CMSIS/Lib/GCC</Value>
<Value>../src/config</Value>
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel</Value>
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\CMSIS\Include</Value>
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\Device\ATMEL</Value>
<Value>%24(ToolchainDir)\..\..\CMSIS_Atmel\Device\ATMEL\samd20\include</Value>
<Value>../src/ASF/common/services/serial</Value>
<Value>../src/ASF/sam0/drivers/sercom</Value>
<Value>../src/ASF/sam0/drivers/sercom/usart</Value>
</ListValues>
</armgcc.assembler.general.IncludePaths>
<armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel> <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
<armgcc.preprocessingassembler.general.AssemblerFlags>-DARM_MATH_CM0=true -DBOARD=SAMD20_XPLAINED_PRO -D__SAMD20J18__ -DUSART_CALLBACK_MODE=true</armgcc.preprocessingassembler.general.AssemblerFlags> <armgcc.preprocessingassembler.general.AssemblerFlags>-DARM_MATH_CM0=true -DBOARD=SAMD20_XPLAINED_PRO -D__SAMD20J18__ -DUSART_CALLBACK_MODE=true</armgcc.preprocessingassembler.general.AssemblerFlags>
<armgcc.preprocessingassembler.general.IncludePaths> <armgcc.preprocessingassembler.general.IncludePaths>

View file

@ -137,7 +137,7 @@ int main (void)
/* 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();
} }

View file

@ -1,17 +1,30 @@
---------------------------------------------------------------------------- The FreeRTOS open source license covers the FreeRTOS source files,
which are located in the /FreeRTOS/Source directory of the official FreeRTOS
NOTE: The modification to the GPL documented below is included to allow you to download. It also covers most of the source files in the demo application
distribute a combined work that includes FreeRTOS without being obliged to projects, which are located in the /FreeRTOS/Demo directory of the official
provide the source code for proprietary components. FreeRTOS download. The demo projects may also include third party software that
is not part of FreeRTOS and is licensed separately to FreeRTOS. Examples of
third party software includes header files provided by chip or tools vendors,
linker scripts, peripheral drivers, etc. All the software in subdirectories of
the /FreeRTOS directory is either open source or distributed with permission,
and is free for use. For the avoidance of doubt, refer to the comments at the
top of each source file.
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
The FreeRTOS GPL Exception Text: NOTE: The modification to the GPL is included to allow you to distribute a
combined work that includes FreeRTOS without being obliged to provide the source
code for proprietary components.
Any FreeRTOS source code, whether modified or in it's original release form, ----------------------------------------------------------------------------
Applying to FreeRTOS V8.2.3 up to the latest version, the FreeRTOS GPL Exception
Text follows:
Any FreeRTOS *source code*, whether modified or in it's original release form,
or whether in whole or in part, can only be distributed by you under the terms or whether in whole or in part, can only be distributed by you under the terms
of version 2 of the GNU General Public License plus this exception. An of the GNU General Public License plus this exception. An independent module is
independent module is a module which is not derived from or based on FreeRTOS. a module which is not derived from or based on FreeRTOS.
Clause 1: Clause 1:
@ -35,9 +48,12 @@ express permission of Real Time Engineers Ltd. (this is the norm within the
industry and is intended to ensure information accuracy). industry and is intended to ensure information accuracy).
-------------------------------------------------------------------- --------------------------------------------------------------------
The standard GPL v2 text follows:
The standard GPL V2 text:
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE

View file

@ -91,7 +91,15 @@ task.h is included from an application file. */
#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT ) #define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )
/* Allocate the memory for the heap. */ /* Allocate the memory for the heap. */
/* Allocate the memory for the heap. */
#if( configAPPLICATION_ALLOCATED_HEAP == 1 )
/* The application writer has already defined the array used for the RTOS
heap - probably so it can be placed in a special segment or address. */
extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#else
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#endif /* configAPPLICATION_ALLOCATED_HEAP */
static size_t xNextFreeByte = ( size_t ) 0; static size_t xNextFreeByte = ( size_t ) 0;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -102,12 +110,14 @@ void *pvReturn = NULL;
static uint8_t *pucAlignedHeap = NULL; static uint8_t *pucAlignedHeap = NULL;
/* Ensure that blocks are always aligned to the required number of bytes. */ /* Ensure that blocks are always aligned to the required number of bytes. */
#if portBYTE_ALIGNMENT != 1 #if( portBYTE_ALIGNMENT != 1 )
{
if( xWantedSize & portBYTE_ALIGNMENT_MASK ) if( xWantedSize & portBYTE_ALIGNMENT_MASK )
{ {
/* Byte alignment required. */ /* Byte alignment required. */
xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ); xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
} }
}
#endif #endif
vTaskSuspendAll(); vTaskSuspendAll();

View file

@ -97,7 +97,14 @@ task.h is included from an application file. */
static void prvHeapInit( void ); static void prvHeapInit( void );
/* Allocate the memory for the heap. */ /* Allocate the memory for the heap. */
#if( configAPPLICATION_ALLOCATED_HEAP == 1 )
/* The application writer has already defined the array used for the RTOS
heap - probably so it can be placed in a special segment or address. */
extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#else
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
#endif /* configAPPLICATION_ALLOCATED_HEAP */
/* Define the linked list structure. This is used to link free blocks in order /* Define the linked list structure. This is used to link free blocks in order
of their size. */ of their size. */