Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Adding support for ARM DS5 tool chain. #273

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ Listings/
/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/Dependencies/WpdPack/

*.axfdump
/Test/Platform/Tests/CLR/Microsoft.SPOT.TinyCore/Presentation/OnBoardFlash.dat
/Test/Platform/Tests/CLR/Microsoft.SPOT.TinyCore/Presentation/OnBoardFlash.dat.smd
/Test/Platform/Tools/MFTestSystem/Results
/devenvdebug.cmd
/setenv.cmd
/setenv_base_classic.cmd
/setenv_rvds.cmd
5 changes: 4 additions & 1 deletion DeviceCode/Targets/Native/STM32/STM32.settings
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
<PropertyGroup>
<OEMSystemInfoString>Copyright Oberon microsystems, Inc.</OEMSystemInfoString>
</PropertyGroup>

<PropertyGroup Condition="'$(COMPILER_TOOL)'=='DS5'">
<DEVICE_TYPE Condition="'$(DEVICE_TYPE)' == ''">Cortex-M3</DEVICE_TYPE>
<BUILD_TOOL_GUID>{F7823E3C-8BCE-4D9A-AD56-9E06063C47CD}</BUILD_TOOL_GUID>
</PropertyGroup>
<PropertyGroup Condition="'$(COMPILER_TOOL)'=='RVDS'">
<DEVICE_TYPE Condition="'$(DEVICE_TYPE)' == ''">Cortex-M3</DEVICE_TYPE>
<BUILD_TOOL_GUID>{1942C531-3AAC-4abb-8B4F-C3111012F9D9}</BUILD_TOOL_GUID>
Expand Down
5 changes: 4 additions & 1 deletion DeviceCode/Targets/Native/STM32F4/STM32F2.settings
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
<ItemGroup>
<CC_CPP_Defines Include="__CORTEX_M3" />
</ItemGroup>

<PropertyGroup Condition="'$(COMPILER_TOOL)'=='DS5'">
<DEVICE_TYPE Condition="'$(DEVICE_TYPE)' == ''">Cortex-M3</DEVICE_TYPE>
<BUILD_TOOL_GUID>{F7823E3C-8BCE-4D9A-AD56-9E06063C47CD}</BUILD_TOOL_GUID>
</PropertyGroup>
<PropertyGroup Condition="'$(COMPILER_TOOL)'=='RVDS'">
<DEVICE_TYPE Condition="'$(DEVICE_TYPE)' == ''">Cortex-M3</DEVICE_TYPE>
<BUILD_TOOL_GUID>{1942C531-3AAC-4abb-8B4F-C3111012F9D9}</BUILD_TOOL_GUID>
Expand Down
5 changes: 4 additions & 1 deletion DeviceCode/Targets/Native/STM32F4/STM32F4.settings
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
<CC_CPP_Defines Include="__CORTEX_M4F" />
<CC_CPP_Defines Include="CORTEX_M4" />
</ItemGroup>

<PropertyGroup Condition="'$(COMPILER_TOOL)'=='DS5'">
<DEVICE_TYPE Condition="'$(DEVICE_TYPE)' == ''">Cortex-M3</DEVICE_TYPE>
<BUILD_TOOL_GUID>{F7823E3C-8BCE-4D9A-AD56-9E06063C47CD}</BUILD_TOOL_GUID>
</PropertyGroup>
<PropertyGroup Condition="'$(COMPILER_TOOL)'=='RVDS'">
<DEVICE_TYPE Condition="'$(DEVICE_TYPE)' == ''">Cortex-M4.fp</DEVICE_TYPE>
<BUILD_TOOL_GUID>{00C50096-00DD-00E7-BBA9-7FC84D408562}</BUILD_TOOL_GUID>
Expand Down
2 changes: 1 addition & 1 deletion Framework/Tools/BuildTasks/ScatterFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ internal object Parse( System.Xml.XmlNode node )
string name = node.Name;
IParse o = null;

if (GetVariable("COMPILER_TOOL").ToUpper() == "RVDS" || GetVariable("COMPILER_TOOL").ToUpper() == "MDK")
if (GetVariable("COMPILER_TOOL").ToUpper() == "RVDS" || GetVariable("COMPILER_TOOL").ToUpper() == "MDK" || GetVariable("COMPILER_TOOL").ToUpper() == "DS5")
{
if (name == "ScatterFile") o = new Group();
else if (name == "Set") o = new Variable();
Expand Down
118 changes: 118 additions & 0 deletions Solutions/MCBSTM32F400/MicroBooter/scatterfile_microbooter_ds5.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?xml version="1.0"?>
<ScatterFile xmlns="http://schemas.microsoft.com/netmf/ScatterfileSchema.xsd">

<!-- Freescale MC9328L, NO SRAM, SDRAM 32M/64M -->

<Set Name="Valid" Value="false"/>

<!-- ################################################################################ -->

<Set Name="Heap_Begin" Value="0x08100000"/>
<Set Name="Heap_End" Value="0x084FFFF8"/>
<Set Name="Stack_Bottom" Value="+0"/>
<Set Name="Stack_Top" Value="0x08502000"/>


<If Name="TARGETLOCATION" In="FLASH">

<!-- iMXS has 8MB of 32-bit FLASH at 0x10000000 -->
<Set Name="Code_BaseAddress" Value="0x10000000"/>
<Set Name="Code_Size" Value="0x00020000"/>
<Set Name="RAM_RO_Base" Value="0x00000000"/>
<Set Name="Valid" Value="true"/>

</If>

<If Name="TARGETLOCATION" In="RAM">

<Set Name="Code_BaseAddress" Value="0x08200000"/>
<Set Name="Code_Size" Value="0x00030000"/>
<Set Name="RAM_RO_Base" Value="+0"/>
<Set Name="Valid" Value="true"/>

</If>


<!-- ################################################################################ -->

<If Name="Valid" Value="false">
<Error Message="Configuration not recognized"/>
</If>

<!-- we start at 0x10080000 since PortBooter lives at 0x10000000 -->
<!-- the address and sizes for both load regions (LR_*) are chosen to start and completely fill a flash partition in the 28F320W18 flash chip -->

<LoadRegion Name="LR_%TARGETLOCATION%" Base="%Code_BaseAddress%" Options="ABSOLUTE" Size="%Code_Size%">

<!-- we have arbitrarily asigned 0x00080000 offset in FLASH for the CLR code, and size of 0x00080000 -->

<ExecRegion Name="ER_%TARGETLOCATION%" Base="%Code_BaseAddress%" Options="FIXED" Size="">

<FileMapping Name="FirstEntry.obj" Options="(+RO, +FIRST)" /> <!-- the entry pointer section goes into this region -->

<FileMapping Name="*" Options="(SectionForBootstrapOperations)" />
<FileMapping Name="*" Options="(+RO)" />

</ExecRegion>

<!-- skip vector area -->

<ExecRegion Name="ER_RAM_RO" Base="%RAM_RO_Base%" Options="ABSOLUTE" Size="">

<FileMapping Name="VectorsTrampolines.obj" Options="(+RO, +FIRST)" /> <!-- for vector handlers to be far from the vectors -->

<FileMapping Name="*" Options="(i.IDelayLoop)" Comment="00004a98 24 16 IDelayLoop" />
<FileMapping Name="*" Options="(i._Z23Time_Sleep_MicroSecondsj)" Comment="_Z23Time_Sleep_MicroSecondsj" />
<FileMapping Name="*" Options="(i._Z40Time_Sleep_MicroSeconds_InterruptEnabledj)" Comment="_Z40Time_Sleep_MicroSeconds_InterruptEnabledj" />
<FileMapping Name="*" Options="(i._Z23CPU_MicrosecondsToTicksj)" Comment="_Z23CPU_MicrosecondsToTicksj" />
<FileMapping Name="*" Options="(i._Z17Events_MaskedReadj)" Comment="000070ec 20 20787 Events_MaskedRead__FUi" />
<FileMapping Name="*" Options="(i._ZN16MC9328MXL_Driver5PauseEv)" />
<FileMapping Name="*" Options="(i._ZN21MC9328MXL_TIME_Driver12CounterValueEv)" Comment="00007840 40 712150 _ZN21MC9328MXL_TIME_Driver12CounterValueEv" />
<FileMapping Name="*" Options="(i._ZN21MC9328MXL_AITC_Driver17ActivateInterruptEjjPFvPvES0_h)" Comment="00007604 76 231095 _ZN21MC9328MXL_AITC_Driver17ActivateInterruptEjjPFvPvES0_h" />
<FileMapping Name="*" Options="(i._ZN21MC9328MXL_AITC_Driver19DeactivateInterruptEj)" Comment="00007604 76 231095 _ZN21MC9328MXL_AITC_Driver19DeactivateInterruptEj" />
<FileMapping Name="*" Options="(i._ZN21MC9328MXL_TIME_Driver15SetCompareValueEy)" Comment="00007868 96 181492 _ZN21MC9328MXL_TIME_Driver15SetCompareValueEy" />
<FileMapping Name="*" Options="(i._ZN21MC9328MXL_TIME_Driver11CurrentTimeEv)" Comment="000079d0 88 94500 _ZN21MC9328MXL_TIME_Driver11CurrentTimeEv" />
<FileMapping Name="*" Options="(i._ZN25MC9328MXL_WATCHDOG_Driver12ResetCounterEv)" Comment="00007adc 24 22218 _ZN25MC9328MXL_WATCHDOG_Driver12ResetCounterEv" />
<FileMapping Name="*" Options="(i._Z18SUPPORT_ComputeCRCPKvij)" Comment="00006654 72 1709347 SUPPORT_ComputeCRC__FPCviUi" />
<FileMapping Name="rt_sdiv.o" Options="(+RO)" />
<FileMapping Name="rt_memclr.o" Options="(+RO)" />
<FileMapping Name="rt_memclr_w.o" Options="(+RO)" />
<FileMapping Name="rt_memcpy.o" Options="(+RO)" />
<FileMapping Name="rt_memcpy_w.o" Options="(+RO)" />
<FileMapping Name="llshl.o" Options="(+RO)" />
<FileMapping Name="llsdiv.o" Options="(+RO)" />
<FileMapping Name="llushr.o" Options="(+RO)" />
<FileMapping Name="lludiv.o" Options="(+RO)" />

<FileMapping Name="*" Options="(SectionForFlashOperations)" />

</ExecRegion>

<ExecRegion Name="ER_RAM_RW" Base="+0" Options="ABSOLUTE" Size="">

<FileMapping Name="*" Options="(+RW-DATA, +ZI)" />

</ExecRegion>

<ExecRegion Name="ER_HEAP_BEGIN" Base="%Heap_Begin%" Options="ABSOLUTE" Size="UNINIT">
<FileMapping Name="*" Options="(SectionForHeapBegin)" />
</ExecRegion>

<!-- everything between heapbegin and heapend will be allocated for a heap -->

<ExecRegion Name="ER_HEAP_END" Base="%Heap_End%" Options="ABSOLUTE" Size="UNINIT">
<FileMapping Name="*" Options="(SectionForHeapEnd)" />
</ExecRegion>


<ExecRegion Name="ER_STACK_BOTTOM" Base="%Stack_Bottom%" Options="ABSOLUTE" Size="UNINIT">
<FileMapping Name="*" Options="(SectionForStackBottom)" />
</ExecRegion>

<ExecRegion Name="ER_STACK_TOP" Base="%Stack_Top%" Options="ABSOLUTE" Size="UNINIT">
<FileMapping Name="*" Options="(SectionForStackTop)" />
</ExecRegion>

</LoadRegion>

</ScatterFile>
158 changes: 158 additions & 0 deletions Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_ds5.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<?xml version="1.0"?>
<ScatterFile xmlns="http://schemas.microsoft.com/netmf/ScatterfileSchema.xsd">

<!-- STM32F4 with 1M Flash, 128k SRAM, and 64k DATA CCM -->

<Set Name="Valid" Value="false"/>

<!-- ################################################################################ -->

<!-- Memory Region base and size values for physical hardware to help clarify the mapping
by making Symbolic names available instead of a bunch of numbers. These values are
fixed in hardware and therefore, don't change.
-->
<!-- Internal FLASH -->
<Set Name="IFLASH_BaseAddress" Value="0x08000000"/>
<Set Name="IFLASH_Size" Value="0x00100000"/><!-- 1MB -->

<!-- Core Coupled Memory (CCM) [D-Bus] -->
<Set Name="CCM_BaseAddress" Value="0x10000000"/>
<Set Name="CCM_Size" Value="0x00010000"/><!-- 64KB -->

<!-- Internal SRAM -->
<Set Name="IRAM_BaseAddress" Value="0x20000000"/>
<Set Name="IRAM_Size" Value="0x00020000"/><!-- 128KB -->

<!-- External NOR Flash-->
<Set Name="NOR_BaseAddress" Value="0x60000000"/>
<Set Name="NOR_Size" Value="0x00800000"/><!-- 8MB -->

<!-- External SRAM -->
<Set Name="EXTRAM_BaseAddress" Value="0x68000000"/>
<Set Name="EXTRAM_Size" Value="0x00200000"/><!-- 2MB -->

<!-- Solution specific usage settings -->
<!-- Internal CCM (D-Bus) -->
<!-- Put Stack in CCM for high speed access, reducing overhead of stack usage -->
<Set Name="Stack_Bottom" Value="%CCM_BaseAddress%"/>

<!-- External SRAM -->
<Set Name="Heap_BaseAddress" Value="%EXTRAM_BaseAddress%"/>

<!-- External NOR FLASH -->
<!-- Configuration section is at base of external NOR flash
This needs to be in the same block storage device as the
deployment region to enable the MFDeploy to access it.
( Due to device side library implementation limit )
-->
<Set Name="Config_BaseAddress" Value="%NOR_BaseAddress%"/>
<Set Name="Config_Size" Value="0x00010000"/><!-- 64KB -->

<!-- DAT region goes into external NOR Flash -->
<Set Name="Data_BaseAddress" Value="%Config_BaseAddress% + %Config_Size%"/>
<Set Name="Data_Size" Value="0x00020000"/><!-- 128KB -->
<!-- Deployment fills the rest of external NOR flash... -->

<!-- Internal FLASH -->
<!-- TinyBooter sits at power on Reset vector-->
<Set Name="BooterCode_BaseAddress" Value="%IFLASH_BaseAddress%"/>
<Set Name="BooterCode_Size" Value="0x00010000"/><!-- 64KB -->

<If Name="TARGETLOCATION" Value="FLASH">
<!-- Internal FLASH -->

<!-- Native Code section -->
<Set Name="Code_BaseAddress" Value="%BooterCode_BaseAddress%"/>
<Set Name="Code_Size" Value="%BooterCode_Size%"/>

<!-- =========================================================== -->
<If Name="TARGETTYPE" Value="Release">
<!-- ALL of external RAM is enabled for the CLR HEAP -->
<Set Name="Heap_Size" Value="0x00080000"/><!-- 512K -->
<Set Name="CustomHeap_Size" Value="0x00080000"/><!-- 512K -->

<Set Name="Valid" Value="true"/>
</If>
<If Name="TARGETTYPE" Value="Debug">
<!-- Use only 1MB of external RAM for Debug builds.
Can't use all of external RAM as the address pins overlap
with the SWD pins used for ETM tracing in Debug builds.
-->
<Set Name="Heap_Size" Value="0x00100000"/><!--1MB-->
<Set Name="CustomHeap_Size" Value="0x00100000"/><!--1MB-->

<Set Name="Valid" Value="true"/>
</If>
</If>

<!-- ################################################################################ -->

<If Name="Valid" Value="false">
<Error Message="Configuration not recognized"/>
</If>

<LoadRegion Name="LR_%TARGETLOCATION%" Base="%Code_BaseAddress%" Options="ABSOLUTE" Size="%Code_Size%">

<!-- ========= INTERNAL FLASH ============================================ -->
<ExecRegion Name="ER_%TARGETLOCATION%" Base="%Code_BaseAddress%" Options="FIXED" Size="">
<FileMapping Name="*" Options="(SectionForPowerOnReset, +FIRST)" />
<FileMapping Name="*" Options="(SectionForBootstrapOperations)" />
<FileMapping Name="*" Options="(+RO-CODE)" />
<FileMapping Name="*" Options="(+RO-DATA)" />
</ExecRegion>

<!-- ========= INTERNAL RAM ============================================= -->
<!-- Writeable Vector table -->
<!-- NOTE:
Despite what you might hope for, this CANNOT go into the CCM area as the NVIC does not
have access to that space (it sees the AHB layer and below, rather than the core's D-Bus)
-->
<!-- Alignment for the vector table is important to allow the NVIC to decode the proper locations
(See Section 4.4.4 of the ARM Cortex-M4 Generic User Guide [ ARM DUI 0553A (ID121610) ] )
Since this starts the SRAM block, it's aligned just fine for any size table.
-->
<ExecRegion Name="ER_RAM_RW" Base="%IRAM_BaseAddress%" Options="ABSOLUTE" Size="">
<FileMapping Name="*" Options="(VectorTable)"/>
<FileMapping Name="*" Options="(+RW-DATA, +ZI)" />
</ExecRegion>

<ExecRegion Name="ER_RAM_RO" Base="+0" Options="ABSOLUTE" Size="">
<!-- Flash programming from Flash is safe on STM32 -->
<!-- No need to place Flash programming code in RAM -->
<!-- <FileMapping Name="*" Options="(SectionForFlashOperations)" /> -->
</ExecRegion>

<!-- ========= EXTERNAL RAM ============================================= -->
<ExecRegion Name="ER_HEAP_BEGIN" Base="%Heap_BaseAddress%" Options="ABSOLUTE UNINIT" Size="">
<FileMapping Name="*" Options="(SectionForHeapBegin)" />
</ExecRegion>

<!-- everything between heapbegin and heapend will be allocated for a heap -->

<ExecRegion Name="ER_HEAP_END" Base="+%Heap_Size%" Options="ABSOLUTE UNINIT" Size="">
<FileMapping Name="*" Options="(SectionForHeapEnd)" />
</ExecRegion>

<ExecRegion Name="ER_CUSTOM_HEAP_BEGIN" Base="+0" Options="ABSOLUTE UNINIT" Size="">
<FileMapping Name="*" Options="(SectionForCustomHeapBegin)" />
</ExecRegion>

<!-- everything between heapbegin and heapend will be allocated for the unmanaged SimpleHeap -->

<ExecRegion Name="ER_CUSTOM_HEAP_END" Base="+%CustomHeap_Size%" Options="ABSOLUTE UNINIT" Size="">
<FileMapping Name="*" Options="(SectionForCustomHeapEnd)" />
</ExecRegion>

<!-- ========= Internal CCM ============================================ -->
<ExecRegion Name="ER_STACK_BOTTOM" Base="%Stack_Bottom%" Options="ABSOLUTE UNINIT" Size="">
<FileMapping Name="*" Options="(SectionForStackBottom)" />
</ExecRegion>

<!-- -8 for the two 32bit values in the SectionForStack* sections, This keeps the region
limit from exceeding the size of physical memory.
-->
<ExecRegion Name="ER_STACK_TOP" Base="AlignExpr(+%CCM_Size% -8, 8 )" Options="ABSOLUTE UNINIT" Size="">
<FileMapping Name="*" Options="(SectionForStackTop +LAST)" />
</ExecRegion>
</LoadRegion>
</ScatterFile>
Loading