Change some data types in heap_4.c to allow it to be used on hardware that has 16-bit pointers without generating compiler warnings.

Add a small data model configuration to the MSP43FR5969 IAR demo.
Correct some code comments in the SAMA5D4 demo.
pull/4/head
Richard Barry 10 years ago
parent 976a9b44af
commit a9d1ff4f5e

@ -227,7 +227,7 @@ void vRegisterSampleCLICommands( void )
static BaseType_t prvTaskStatsCommand( char *pcWriteBuffer, size_t xWriteBufferLen, const char *pcCommandString )
{
const char *const pcHeader = " State Priority Stack #\r\n************************************************\r\n";
const char *const pcHeader = " State Priority Stack #\r\n************************************************\r\n";
BaseType_t xSpacePadding;
/* Remove compile time warnings about unused parameters, and check the
@ -300,8 +300,8 @@ BaseType_t xSpacePadding;
pcWriteBuffer += strlen( pcWriteBuffer );
/* Pad the string "task" with however many bytes necessary to make it the
length of a task name. Minus three for the null terminator and half the
number of characters in "Task" so the column lines up with the centre of
length of a task name. Minus three for the null terminator and half the
number of characters in "Task" so the column lines up with the centre of
the heading. */
for( xSpacePadding = strlen( "Task" ); xSpacePadding < ( configMAX_TASK_NAME_LEN - 3 ); xSpacePadding++ )
{

@ -0,0 +1,101 @@
;
; Windows USB CDC Driver Setup File for ATMEL AT91SAM products
;
; On Windows 7, right click to update driver software. It may take a while to
; get this option, even if you cancel the auto driver search.
; choose "browse my computer for driver software",
; choose "let me pick from a list of device drivers on my computer",
; Click "have disk" and browse to this .inf file
; If there is a problem, right click and uninstall, checking delete driver software.
;------------------------------------------------------------------------------
[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%ATMEL%
LayoutFile=layout.inf
DriverVer= 03/09/2011,2.0.0.0
[Manufacturer]
%ATMEL%=DeviceList,NTamd64
[DestinationDirs]
DefaultDestDir=12
;------------------------------------------------------------------------------
; Windows 2000/XP/Vista32 Support
;------------------------------------------------------------------------------
[DriverInstall.nt]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.nt
AddReg=DriverInstall.nt.AddReg
[DriverCopyFiles.nt]
usbser.sys,,,0x20
[DriverInstall.nt.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,usbser.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService.nt
[DriverService.nt]
DisplayName=%USBtoSerialConverter%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\usbser.sys
;------------------------------------------------------------------------------
; Windows Vista64 Support
;------------------------------------------------------------------------------
[DriverInstall.NTamd64]
include=mdmcpq.inf
CopyFiles=DriverCopyFiles.NTamd64
AddReg=DriverInstall.NTamd64.AddReg
[DriverCopyFiles.NTamd64]
usbser.sys,,,0x20
[DriverInstall.NTamd64.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,usbser.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
[DriverInstall.NTamd64.Services]
AddService=usbser, 0x00000002, DriverService.NTamd64
[DriverService.NTamd64]
DisplayName=%USBtoSerialConverter%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\usbser.sys
;------------------------------------------------------------------------------
; VID/PID Settings
;------------------------------------------------------------------------------
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%USBtoSerialConverter%=DriverInstall, USB\VID_03EB&PID_6119
[DeviceList.NTamd64]
%USBtoSerialConverter%=DriverInstall, USB\VID_03EB&PID_6119
;------------------------------------------------------------------------------
; String Definitions
;------------------------------------------------------------------------------
[Strings]
ATMEL="ATMEL Corp." ; String value for the ATMEL symbol
USBtoSerialConverter="AT91 USB to Serial Converter" ; String value for the USBtoSerialConverter symbol

@ -1,60 +1,64 @@
/*
FreeRTOS V8.0.1 - Copyright (C) 2014 Real Time Engineers Ltd.
FreeRTOS V8.2.1 - Copyright (C) 2015 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that has become a de facto standard. *
* *
* Help yourself get started quickly and support the FreeRTOS *
* project by purchasing a FreeRTOS tutorial book, reference *
* manual, or both from: http://www.FreeRTOS.org/Documentation *
* *
* Thank you! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. Full license text is available from the following
FOR A PARTICULAR PURPOSE. Full license text is available on the following
link: http://www.freertos.org/a00114.html
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong?" *
* 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. *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* 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 - Documentation, books, training, latest versions,
license and Real Time Engineers Ltd. contact details.
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.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and middleware.
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
@ -64,10 +68,10 @@
*/
/******************************************************************************
* NOTE 1: This project provides three demo applications. A simple blinky
* style project, a more comprehensive test and demo application, and an
* lwIP example. The mainSELECTED_APPLICATION setting in main.c is used to
* select between the three. See the notes on using mainSELECTED_APPLICATION
* NOTE 1: This project provides two demo applications. A simple blinky style
* project, and a more comprehensive test and demo application. The
* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select
* between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY
* in main.c. This file implements the simply blinky style version.
*
* NOTE 2: This file only contains the source code that is specific to the

@ -114,7 +114,7 @@ static void prvSetupHardware( void );
* 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.
*/
#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1
#if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
extern void main_blinky( void );
#else
extern void main_full( void );

@ -84,7 +84,6 @@
/* The array used as the heap is declared by the application to allow the
__persistent keyword to be used. See http://www.freertos.org/a00111.html#heap_4 */
#define configAPPLICATION_ALLOCATED_HEAP 1
#define configUSE_PREEMPTION 1
#define configMAX_PRIORITIES ( 5 )
#define configCPU_CLOCK_HZ ( 8000000 )
@ -112,7 +111,7 @@ __persistent keyword to be used. See http://www.freertos.org/a00111.html#heap_4
/* Hook function related definitions. */
#define configUSE_TICK_HOOK 1
#define configUSE_IDLE_HOOK 0
#define configUSE_IDLE_HOOK 1
#define configUSE_MALLOC_FAILED_HOOK 1
#define configCHECK_FOR_STACK_OVERFLOW 2

@ -3,7 +3,417 @@
<project>
<fileVersion>2</fileVersion>
<configuration>
<name>Debug</name>
<name>Debug_Large_Data_Model</name>
<toolchain>
<name>MSP430</name>
</toolchain>
<debug>1</debug>
<settings>
<name>C-SPY</name>
<archiveVersion>5</archiveVersion>
<data>
<version>27</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CInput</name>
<state>1</state>
</option>
<option>
<name>MacOverride</name>
<state>0</state>
</option>
<option>
<name>MacFile</name>
<state></state>
</option>
<option>
<name>IProcessor</name>
<state>0</state>
</option>
<option>
<name>GoToEnable</name>
<state>1</state>
</option>
<option>
<name>GoToName</name>
<state>main</state>
</option>
<option>
<name>DynDriver</name>
<state>430FET</state>
</option>
<option>
<name>dDllSlave</name>
<state>0</state>
</option>
<option>
<name>DdfFileSlave</name>
<state>1</state>
</option>
<option>
<name>DdfOverride</name>
<state>0</state>
</option>
<option>
<name>DdfFileName</name>
<state>$TOOLKIT_DIR$\config\debugger\msp430fr5969.ddf</state>
</option>
<option>
<name>ProcTMS</name>
<state>1</state>
</option>
<option>
<name>CExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>CExtraOptions</name>
<state></state>
</option>
<option>
<name>ProcMSP430X</name>
<state>1</state>
</option>
<option>
<name>CompilerDataModel</name>
<state>1</state>
</option>
<option>
<name>IVBASE</name>
<state>1</state>
</option>
<option>
<name>OCImagesSuppressCheck1</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath1</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck2</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath2</name>
<state></state>
</option>
<option>
<name>OCImagesSuppressCheck3</name>
<state>0</state>
</option>
<option>
<name>OCImagesPath3</name>
<state></state>
</option>
<option>
<name>CPUTAG</name>
<state>1</state>
</option>
<option>
<name>L092Mode</name>
<state>1</state>
</option>
<option>
<name>OCImagesOffset1</name>
<state></state>
</option>
<option>
<name>OCImagesOffset2</name>
<state></state>
</option>
<option>
<name>OCImagesOffset3</name>
<state></state>
</option>
<option>
<name>OCImagesUse1</name>
<state>0</state>
</option>
<option>
<name>OCImagesUse2</name>
<state>0</state>
</option>
<option>
<name>OCImagesUse3</name>
<state>0</state>
</option>
<option>
<name>ENERGYTRACE</name>
<state>1</state>
</option>
<option>
<name>FETIPE</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>430FET</name>
<archiveVersion>1</archiveVersion>
<data>
<version>29</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CFetMandatory</name>
<state>0</state>
</option>
<option>
<name>Erase</name>
<state>0</state>
</option>
<option>
<name>EMUVerifyDownloadP7</name>
<state>0</state>
</option>
<option>
<name>EraseOptionSlaveP7</name>
<state>0</state>
</option>
<option>
<name>ExitBreakpointP7</name>
<state>0</state>
</option>
<option>
<name>PutcharBreakpointP7</name>
<state>1</state>
</option>
<option>
<name>GetcharBreakpointP7</name>
<state>1</state>
</option>
<option>
<name>derivativeP7</name>
<state>0</state>
</option>
<option>
<name>ParallelPortP7</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>TargetVoltage</name>
<state>3.3</state>
</option>
<option>
<name>AllowLockedFlashAccessP7</name>
<state>0</state>
</option>
<option>
<name>EMUAttach</name>
<state>0</state>
</option>
<option>
<name>AttachOptionSlave</name>
<state>0</state>
</option>
<option>
<name>CRadioProtocolType</name>
<state>0</state>
</option>
<option>
<name>CCRadioModuleTypeSlave</name>
<state>1</state>
</option>
<option>
<name>EEMLevel</name>
<state>0</state>
</option>
<option>
<name>DiasbleMemoryCache</name>
<state>0</state>
</option>
<option>
<name>NeedLockedFlashAccess</name>
<state>1</state>
</option>
<option>
<name>UsbComPort</name>
<state>Automatic</state>
</option>
<option>
<name>FetConnection</name>
<version>4</version>
<state>0</state>
</option>
<option>
<name>SoftwareBreakpointEnable</name>
<state>1</state>
</option>
<option>
<name>RadioSoftwareBreakpointType</name>
<state>1</state>
</option>
<option>
<name>TargetSettlingtime</name>
<state>0</state>
</option>
<option>
<name>AllowAccessToBSL</name>
<state>0</state>
</option>
<option>
<name>OTargetVccTypeDefault</name>
<state>0</state>
</option>
<option>
<name>CCBetaDll</name>
<state>1</state>
</option>
<option>
<name>GPassword</name>
<state></state>
</option>
<option>
<name>DebugLPM5</name>
<state>0</state>
</option>
<option>
<name>LPM5Slave</name>
<state>0</state>
</option>
<option>
<name>CRadioAutoManualType</name>
<state>0</state>
</option>
<option>
<name>ExternalCodeDownload</name>
<state>0</state>
</option>
<option>
<name>CCVCCDefault</name>
<state>1</state>
</option>
<option>
<name>Retain</name>
<state>0</state>
</option>
<option>
<name>jstatebit</name>
<state>0</state>
</option>
<option>
<name>RadioJtagSpeedType</name>
<state>2</state>
</option>
<option>
<name>memoryTypeSlave</name>
<state>0</state>
</option>
<option>
<name>fuseBlowDisabledSlave</name>
<state>0</state>
</option>
<option>
<name>eraseTypeSlave</name>
<state>0</state>
</option>
<option>
<name>DataSampleBpReservation</name>
<state>0</state>
</option>
<option>
<name>cycleCounterLevel</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>SIM430</name>
<archiveVersion>1</archiveVersion>
<data>
<version>4</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>SimOddAddressCheckP7</name>
<state>1</state>
</option>
<option>
<name>CSimMandatory</name>
<state>1</state>
</option>
<option>
<name>derivativeSim</name>
<state>0</state>
</option>
<option>
<name>SimEnablePSP</name>
<state>0</state>
</option>
<option>
<name>SimPspOverrideConfig</name>
<state>0</state>
</option>
<option>
<name>SimPspConfigFile</name>
<state>$TOOLKIT_DIR$\CONFIG\test.psp.config</state>
</option>
</data>
</settings>
<debuggerPlugins>
<plugin>
<file>$TOOLKIT_DIR$\plugins\lcd\lcd.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxPlugin.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyPlugin.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
</debuggerPlugins>
</configuration>
<configuration>
<name>Debug_Small_Data_Model</name>
<toolchain>
<name>MSP430</name>
</toolchain>

File diff suppressed because it is too large Load Diff

@ -184,19 +184,8 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
void vApplicationIdleHook( void )
{
volatile size_t xFreeHeapSpace;
/* This is just a trivial example of an idle hook. It is called on each
cycle of the idle task. It must *NOT* attempt to block. In this case the
idle task just queries the amount of FreeRTOS heap that remains. See the
memory management section on the http://www.FreeRTOS.org web site for memory
management options. If there is a lot of heap memory free then the
configTOTAL_HEAP_SIZE value in FreeRTOSConfig.h can be reduced to free up
RAM. */
xFreeHeapSpace = xPortGetFreeHeapSize();
/* Remove compiler warning about xFreeHeapSpace being set but never used. */
( void ) xFreeHeapSpace;
__bis_SR_register( LPM4_bits + GIE );
__no_operation();
}
/*-----------------------------------------------------------*/

@ -368,20 +368,20 @@ static void prvHeapInit( void )
{
BlockLink_t *pxFirstFreeBlock;
uint8_t *pucAlignedHeap;
uint32_t ulAddress;
size_t uxAddress;
size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;
/* Ensure the heap starts on a correctly aligned boundary. */
ulAddress = ( uint32_t ) ucHeap;
uxAddress = ( size_t ) ucHeap;
if( ( ulAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
if( ( uxAddress & portBYTE_ALIGNMENT_MASK ) != 0 )
{
ulAddress += ( portBYTE_ALIGNMENT - 1 );
ulAddress &= ~( ( uint32_t ) portBYTE_ALIGNMENT_MASK );
xTotalHeapSize -= ulAddress - ( uint32_t ) ucHeap;
uxAddress += ( portBYTE_ALIGNMENT - 1 );
uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
xTotalHeapSize -= uxAddress - ( size_t ) ucHeap;
}
pucAlignedHeap = ( uint8_t * ) ulAddress;
pucAlignedHeap = ( uint8_t * ) uxAddress;
/* xStart is used to hold a pointer to the first item in the list of free
blocks. The void cast is used to prevent compiler warnings. */
@ -390,17 +390,17 @@ size_t xTotalHeapSize = configTOTAL_HEAP_SIZE;
/* pxEnd is used to mark the end of the list of free blocks and is inserted
at the end of the heap space. */
ulAddress = ( ( uint32_t ) pucAlignedHeap ) + xTotalHeapSize;
ulAddress -= xHeapStructSize;
ulAddress &= ~( ( uint32_t ) portBYTE_ALIGNMENT_MASK );
pxEnd = ( void * ) ulAddress;
uxAddress = ( ( size_t ) pucAlignedHeap ) + xTotalHeapSize;
uxAddress -= xHeapStructSize;
uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK );
pxEnd = ( void * ) uxAddress;
pxEnd->xBlockSize = 0;
pxEnd->pxNextFreeBlock = NULL;
/* To start with there is a single free block that is sized to take up the
entire heap space, minus the space taken by pxEnd. */
pxFirstFreeBlock = ( void * ) pucAlignedHeap;
pxFirstFreeBlock->xBlockSize = ulAddress - ( uint32_t ) pxFirstFreeBlock;
pxFirstFreeBlock->xBlockSize = uxAddress - ( size_t ) pxFirstFreeBlock;
pxFirstFreeBlock->pxNextFreeBlock = pxEnd;
/* Only one block exists - and it covers the entire usable heap space. */

Loading…
Cancel
Save