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

Adding support for ARM DS5 tool chain. #273

wants to merge 3 commits into from

Conversation

doingnz
Copy link
Contributor

@doingnz doingnz commented Aug 5, 2015

I need to add support for ARM DS5 or RVDS 4.1

Preference is for ARM DS5 as this is in theory the same compiler (5.05) as included in MDK and is the tool chain supported by ARM going forward. There are some differences in the install paths and folders for the ARM DS5 tools, library, and include files compared to what was setup for MDK..

The following files are based on the MDK files and edited to remove legacy MDK versions prior to 5.05, and accommodate the folder names etc.

They assume

COMPILER_TOOL= DS5
COMPILER_TOOL_VERSION_NUM=5.05
modified:   setenv_base.cmd
new file:   setenv_ds5.cmd
new file:   tools/Targets/Microsoft.Spot.system.ds5.settings
new file:   tools/Targets/Microsoft.Spot.system.ds5.targets

If I try build either MCBSTM32F400 or STM32F4DISCOVERY then I get the following errors.

Target "ArmCompileC" in file "C:\Projects\BP+\netmf\netmf-interpreter\tools\targets\Microsoft.SPOT.System.DS5.targets" from project "C:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm\Processors\CortexMx\ItmPort\dotNetMF.proj" (target "ArmBuildLib" depends on it):
Skipping target "ArmCompileC" because it has no outputs.
Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists.
Done building target "ArmCompileC" in project "dotNetMF.proj".
Target "ArmCompileCPP" in file "C:\Projects\BP+\netmf\netmf-interpreter\tools\targets\Microsoft.SPOT.System.DS5.targets" from project "C:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm\Processors\CortexMx\ItmPort\dotNetMF.proj" (target "ArmBuildLib" depends on it):
Building target "ArmCompileCPP" completely.
Output file "C:\Projects\BP+\netmf\netmf-interpreter\BuildOutput\THUMB2FP\DS55.05\le\FLASH\release\MCBSTM32F400\obj\DeviceCode\Cores\arm\Processors\CortexMx\ItmPort.obj" does not exist.
Task "Message"
  "C:\Program Files\DS-5 v5.22.0\sw\ARMCompiler5.05u2\bin\armcc.exe"  --cpp  --diag_suppress 2874,111,161,550,C3011,C4052 --diag_suppress 66,161,230,1293 --split_sections  -DMDK_V3_1 -DARM_V3_1 -DDS5_V5_05 --feedback C:\Projects\BP+\netmf\netmf-interpreter\tools\make\Feedback\MCBSTM32F400_DS55.05_loader.feedback -DTCPIP_LWIP_OS -DHAL_REDUCESIZE -DTINYCLR_ENABLE_SOURCELEVELDEBUGGING  -DCOMPILE_THUMB2  -DVERSION_MAJOR=4 -DVERSION_MINOR=4 -DVERSION_BUILD=0 -DVERSION_REVISION=0 -DOEMSYSTEMINFOSTRING="\"Copyright (C) Microsoft Open Technologies Inc.\"" -DPLATFORM_ARM_MCBSTM32F400  -DTARGETLOCATION_FLASH  -DLITTLE_ENDIAN   -D__CORTEX_M4F -DCORTEX_M4   --fpu softvfp   --littleend  --no_debug --dwarf2 --no_debug_macros -O2 --inline -Otime --no_autoinline  --asm --interleave   -DNDEBUG  -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm\Processors\CortexMx -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\include -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm -IC:\Projects\BP+\netmf\netmf-interpreter\Support\Include   -IC:\Projects\BP+\netmf\netmf-interpreter\crypto\inc  -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Include -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\CorLib -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\SPOT -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\SPOT_Hardware -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\SPOT_Graphics -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\SPOT_Net -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\SPOT_Net_Security -IC:\Projects\BP+\netmf\netmf-interpreter\Solutions\MCBSTM32F400 -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm\Processors\CortexMx -IC:\Projects\BP+\netmf\netmf-interpreter\Devicecode\Targets\Native\STM32F4 -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Targets\Native\STM32F4\DeviceCode -IC:\Projects\BP+\netmf\netmf-interpreter\CMSIS\CMSIS\Include -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm\Include -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Include -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Targets\Native\STM32F4\MCBSTM32F400 -IC:\Projects\BP+\netmf\netmf-interpreter\Support\Include -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\include -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\include -IC:\Projects\BP+\netmf\netmf-interpreter\Crypto\inc -IC:\Projects\BP+\netmf\netmf-interpreter\BuildOutput\THUMB2FP\DS55.05\le\ANY_MEDIA\release\lib -I"C:\Program Files\DS-5 v5.22.0\sw\ARMCompiler5.05u2\INCLUDE"    -o C:\Projects\BP+\netmf\netmf-interpreter\BuildOutput\THUMB2FP\DS55.05\le\FLASH\release\MCBSTM32F400\obj\DeviceCode\Cores\arm\Processors\CortexMx\ItmPort.obj -c C:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm\Processors\CortexMx\ItmPort\ItmPort.cpp
Done executing task "Message".
Task "Exec" skipped, due to false condition; (Exists('%(FastCompileCPPFile.FullPath)') and '@(FastCompileCPPFile)'!='' and '$(ENABLE_FASTCOMPILE)'=='true') was evaluated as (Exists('') and ''!='' and 'false'=='true').
Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Exec"
  "C:\Program Files\DS-5 v5.22.0\sw\ARMCompiler5.05u2\bin\armcc.exe"  --cpp  --diag_suppress 2874,111,161,550,C3011,C4052 --diag_suppress 66,161,230,1293 --split_sections  -DMDK_V3_1 -DARM_V3_1 -DDS5_V5_05 --feedback C:\Projects\BP+\netmf\netmf-interpreter\tools\make\Feedback\MCBSTM32F400_DS55.05_loader.feedback -DTCPIP_LWIP_OS -DHAL_REDUCESIZE -DTINYCLR_ENABLE_SOURCELEVELDEBUGGING  -DCOMPILE_THUMB2  -DVERSION_MAJOR=4 -DVERSION_MINOR=4 -DVERSION_BUILD=0 -DVERSION_REVISION=0 -DOEMSYSTEMINFOSTRING="\"Copyright (C) Microsoft Open Technologies Inc.\"" -DPLATFORM_ARM_MCBSTM32F400  -DTARGETLOCATION_FLASH  -DLITTLE_ENDIAN   -D__CORTEX_M4F -DCORTEX_M4   --fpu softvfp   --littleend  --no_debug --dwarf2 --no_debug_macros -O2 --inline -Otime --no_autoinline  --asm --interleave   -DNDEBUG  -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm\Processors\CortexMx -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\include -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm -IC:\Projects\BP+\netmf\netmf-interpreter\Support\Include   -IC:\Projects\BP+\netmf\netmf-interpreter\crypto\inc  -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Include -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\CorLib -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\SPOT -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\SPOT_Hardware -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\SPOT_Graphics -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\SPOT_Net -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\Libraries\SPOT_Net_Security -IC:\Projects\BP+\netmf\netmf-interpreter\Solutions\MCBSTM32F400 -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm\Processors\CortexMx -IC:\Projects\BP+\netmf\netmf-interpreter\Devicecode\Targets\Native\STM32F4 -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Targets\Native\STM32F4\DeviceCode -IC:\Projects\BP+\netmf\netmf-interpreter\CMSIS\CMSIS\Include -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm\Include -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Include -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Targets\Native\STM32F4\MCBSTM32F400 -IC:\Projects\BP+\netmf\netmf-interpreter\Support\Include -IC:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\include -IC:\Projects\BP+\netmf\netmf-interpreter\CLR\include -IC:\Projects\BP+\netmf\netmf-interpreter\Crypto\inc -IC:\Projects\BP+\netmf\netmf-interpreter\BuildOutput\THUMB2FP\DS55.05\le\ANY_MEDIA\release\lib -I"C:\Program Files\DS-5 v5.22.0\sw\ARMCompiler5.05u2\INCLUDE"    -o C:\Projects\BP+\netmf\netmf-interpreter\BuildOutput\THUMB2FP\DS55.05\le\FLASH\release\MCBSTM32F400\obj\DeviceCode\Cores\arm\Processors\CortexMx\ItmPort.obj -c C:\Projects\BP+\netmf\netmf-interpreter\DeviceCode\Cores\arm\Processors\CortexMx\ItmPort\ItmPort.cpp  
  "C:\Projects\BP+\netmf\netmf-interpreter\CMSIS\CMSIS\Include\core_cmFunc.h", line 66: Error:  #1114: this feature not supported on target architecture/processor
      register uint32_t __regControl         
  _ASM("control");
                                                   ^
  "C:\Projects\BP+\netmf\netmf-interpreter\CMSIS\CMSIS\Include\core_cmFunc.h", line 79: Error:  #1114: this feature not supported on target architecture/processor
      register uint32_t __regControl         
  _ASM("control");

etc. for the remaining lines with inline assembler ...

I have tried with and without the following line. I would have not expected it was required as MDK 5.05 did not needed it.

   <CC_CPP_ASM_INTERLEAVE Condition="'$(COMPILER_TOOL_VERSION)'=='DS55.05'"  > $(SWTC)asm $(SWTC)interleave </CC_CPP_ASM_INTERLEAVE>

Has anyone else managed to get DS5 to work correctly to build the sample projects?

Thank you for your help.

Richard

PS: I am a newbie to Git, sorry if this is the wrong way to present the new material with questions. Wiki pages suggest its an iterative process.

@smaillet-ms
Copy link
Member

Are you saying the pull request is a conceptual idea or you are looking for help in solving the problem as opposed to something you claim is working and production worthy? We don't have or use DS5 licenses so we can't test such a thing and I wouldn't want to accept this without knowing what the status is.

@doingnz
Copy link
Contributor Author

doingnz commented Aug 5, 2015

I am looking for help to solve the problem why it will not build the supplied MF samples with DS5. .
Can then add to the main system once they build OK.

I think it is very close to working given the MDK and DS5 compilers are the "same" and the edits are simply to do with paths to folders.

Currently the compiler is throwing up errors on inline __ASM(...) statements. .

  "C:\Projects\BP+\netmf\netmf-interpreter\CMSIS\CMSIS\Include\core_cmFunc.h", line 66: Error:  #1114: this feature not supported on target architecture/processor
      register uint32_t __regControl         
  _ASM("control");

.
.

@cw2
Copy link
Contributor

cw2 commented Aug 5, 2015

Unfortunately, I don't have DS5, so this is pretty wild guess, but try adding the following lines to DeviceCode\Targets\Native\STM32F4\STM32F4.settings:

    <PropertyGroup Condition="'$(COMPILER_TOOL)'=='DS5'">
        <DEVICE_TYPE Condition="'$(DEVICE_TYPE)' == ''">Cortex-M4.fp</DEVICE_TYPE>
    </PropertyGroup>

doingnz added 2 commits August 7, 2015 02:24
Define the DEVICE_TYPE in the DeviceCode/Targets/Native *.settings files under COMPILER_TOOL==DS5 Condition

In Framework/Tools/BuildTasks/ScatterFile.cs, add DS5 as a valid COMPILER_TOOL option along with RVDS and MDK to ensure the scatter files are processed.

Keil MDK 5.05 compiler is the same as DS5 version 5.05 compiler, so copy the existing MDK scatter files to DS5 equivalients for the build system to be happy.
Longer term solution is to consider defining a common ARM tool name to avoid duplications for RVDS, MDK and DS5.

Add DS5 block to setenv_base.cmd. Note the ARMCC50BIN, ARMCC50LIB and ARMCC50INC are not used and can be deleted. (Consider removing from MDK block too)

Modify tools/Targets/Microsoft.SPOT.System.Targets to include quotes around file names and paths. Needs review of other Settings/Targets files. This is to copy with end users who may have a '+' or ' ' in the folder names.

Add Settings/Targets files for DS5 based on MDK versions with pre v 5.05 MDK items removed.
@doingnz
Copy link
Contributor Author

doingnz commented Aug 6, 2015

Thank you for our suggestion. It help get me going down the right path.

I have made progress to the point I can delete BuildOutput folder and go through the steps to build the SDK and then build the STM32F4DISCOVERY solution using DS5..

I have forced a push to reset ARM_DS5 to include all the changes required.

It was necessary to add DS5 to Framework/Tools/BuildTasks/ScatterFile.cs to process the Scatter files.

To keep things interesting I had a "+" character in a folder name in my project hierarchy. This breaks the MSBuild scripts where a COPY xxx + yyy zzz is performed as the current MSBuild scripts do not quote all file names. I have made some changes to tools/Targets/Microsoft.SPOT.System.Targets to add escaped quotes. Probably need to apply this to all other files where a similar action is performed.

I do not have the STM32F4DISCOVERY hardware to load and run the images created.
I could put on DropBox if that is helpful.

@smaillet-ms
Copy link
Member

@doingnz What's the status of this PR? At this stage it seems incomplete and would require manual merging so should be re-worked and re-submitted so I'm closing it at this point.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants