Kinetis Compiler/IDE Information

The µTasker project offers users of a variety of tools the ability to work easily and efficiently with compilers/integrated development environments (IDE) of their choice. All project code is designed to be compiler independent whenever possible or includes dedicated code or configurations in cases where this is needed to ensure compatibility. The following compilers/IDEs are supported so that the project and its many targets and configurations can be used with which-ever tools are chosen.

Click on a link to go to the manufacturer's web site. The list is in no particular order and so doesn't signify preference or recommendations.



MCUXpresso

MCUXpresso is an Eclipse based environment that is made available free of charge by NXP for Kinetis (and some other NXP chip) developments. At the time of writing MPUXpresso is expected to become the IDE of preference since it looks to be planned as the only one that will continue to be supported by NXP.

To import the µTasker project into MCUXpresso the following simple steps can be followed: This video shows KDS being used but the method is very similar for MCUXpresso too!

  • To prepare the MCUXpresso import (as opposed to KDS, S32, CodeWarrior or Atollic) start by deleting the directory ".settings" in the root directory of the µTasker project (the root directory the folder where the project was extracted to including directories "uTasker", "Hardware", "Applications" etc.) as well as other files at this location which begin with a '.' (eg. ".cproject") since these may be for alternative Eclipse based environments (if they exist there)

  • Now copy the MCUXpresso project settings from the folder \Applications\uTaskerV1.4\MCUXpresso\Project_Settings to the root (these are the directory ".settings" and files ".cproject", and ".project").
    There is also a read.me file at that location explaining the procedure and why it is necessary. If you already know and are sure that the MCUXpresso files are located in the root these steps are of course not necessary.

  • Start MCUXpresso - it will ask for a workspace which can be anywhere, eg. enter "uTaskerKinetis".

  • The project import can be started by File | Import... which will open the Import dialog.

  • Expand "General" and select "Existing Projects into Workspace":


  • Click on "Next >" and then browse to the µTasker project root directory on the PC (the location of the root directory is explained in the first step), which will then show up under the Projects list.

  • Without changing any other settings simply click on "Finish" to start the import.
  • The project will now appear in the Project Explorer as shown below:

  • Note that the project framework contains the three µTasker projects (newer versions may have more application targets): two boot loaders plus the main application. The project to be built can be selected with "Project | Build Configurations | Set Active" which shows the following target and build options:

The next section shows how to configure the target of choice for a particular processor/board and build the project. The same is also shown in the video for CodeWarrior which is however also relevant for MCUXpresso.

  • Choose the board type in the project's "config.h" file (for the main application this is the file "\Applications\uTaskerV1.4\config.h"). For example select #define FRDM_KL25Z for the FRDM-KL25Z or #define TWR_K60F120M for the TWR-K60F120M, but make sure that only one target is selected. There are many project options that can be set in this file, and more specific to the particular hardware in app_hw_kinetis.h, but all targets can usually be built with the default settings.

  • Now check the compiler setting to ensure that it is configured to match the type used (KL and KE parts are based on the the Cortex m0+ and so need this to be selected and K parts on Cortex M4). The setting is found in File | Properties | C/C++ Build | Settings | Tool Settings | MCU Setting whereby the following shows the two possible valid settings that must match the target in question:


  • In the properties Settings for MCU C Compiler | Architecture there is a further choice of soft or hard floating point for the Cortex-M4 - the hard floating point setting can be selected when the processor has an M4F core but must not be set if not. Beware that when moving from Cortex-M4F to Cortex-M0+ that the FPU setting is first set to Soft because it is greyed out when the Cortex-M0+ is selected and then can't be changed - if left as FPU hard there WILL be build errors!
  • When using Cortex-M0+ processors add the pre-processor define ARM_MATH_CM0PLUS to the Assembler pre-processor setting by adding "-DARM_MATH_CM0PLUS". When not using Cortex-M0+ types remove this pre-processor define (delete it). If this step doesn't match, assembler files in the project (if present) will generate corresponding errors.
  • The final thing to check is that the correct linker script is being used, which is found in File | Properties | C/C++ Build | Settings | Tool settings | MCU Linker | Managed Linker Script:



    Note that there is a collection of linker scripts in the folder "\Applications\uTaskerV1.4\GNU_Kinetis" which are shared by all Eclipse based Kinetis projects. The naming convention is simple and just needs the amount of program flash and RAM to be known in the device being used. For example, for the FRDM-KL25Z with 128k program flash and 16k RAM the linker script KL_128_16.ld should be used, for the TWR-K60F120M with 1M program flash and 128k RAM K_1M_128.ld would be suitable. When building for operation with the boot loader the linker scripts KL_128_16_BM.ld and K_1M_128_BM.ld would be used respectively; for KE parts KE_64_4.ld and KE_64_4_BM.ld are suitable examples. It is to be noted that it is very important to use the linker script belonging to the appropriate family since the RAM layout is usually different between these types!

  • Once the previous settings have been made and checked to suit the device used, the target can be built by commanding "Project | Build All".
    There is a post build step executed after a successful build which generates several output formats and locates the result in a target directory situated in the MCUXpresso project folder (eg. \Applications\uTaskerV1.4\MCUXpresso\uTaskerV1.4_FLASH when building the flash target from the application project). This is controlled by a batch file "generate.bat" also located there, used to automate some things that can't be fully configured in MCUXpresso. This results in images being available for loading to the target using various programming techniques.

Following the above instructions for MCUXpresso import and project/target building allows the µTasker project (boot loaders and application) to be simply imported and built for any of its supported targets. Users can easily extend the framework with further target configurations by adding their own board types to the files config.h and app_hw_kinetis.h.



Kinetis Design Studio (KDS)

KDS is an Eclipse based environment that is made available free of charge by NXP for Kinetis developments. It fully supports newer Kinetis parts but can still be used for building projects for any Kinetis device.

To import the µTasker project into KDS the following simple steps can be followed:

  • To prepare the KDS import (as opposed to MCUXpresso, CodeWarrior, S32 or Atollic) start by deleting the directory ".settings" in the root directory of the µTasker project (the root directory the folder where the project was extracted to including directories "uTasker", "Hardware", "Applications" etc.) as well as other files at this location which begin with a '.' (eg. ".cproject") since these may be for alternative Eclipse based environments.

  • Now copy the KDS project settings from the folder \Applications\uTaskerV1.4\KinetisDesignStudio\Project_Settings to the root (these are the directory ".settings" and files ".cproject", ".cwGeneratedFileSetLog" and ".project").
    There is also a read.me file at that location explaining the procedure and why it is necessary. If you already know and are sure that the KDS files are located in the root these steps are of course not necessary.

  • Start Kinetis Design Studio - it will ask for a workspace which can be anywhere, eg. enter "uTaskerKinetis".

  • The project import can be started by File | Import... which will open the Import dialog.

  • Expand "General" and select "Existing Projects into Workspace":


  • Click on "Next" and then browse to the µTasker project root directory on the PC (the location of the root directory is explained in the first step), which will then show up under the Projects list.

  • Without changing any other settings simply click on "Finish" to start the import.
  • The project will now appear in the Project Explorer as shown below:

  • Note that the project framework contains the three µTasker projects (newer versions may have more application targets): two boot loaders plus the main application. The project to be built can be selected with "Project | Build Configurations | Set Active" which shows the following target and build options:

The next section shows how to configure the target of choice for a particular processor/board and build the project. The same is also shown in the video for CodeWarrior which is however also relevant for KDS.

  • Choose the board type in the project's "config.h" file (for the main application this is the file "\Applications\uTaskerV1.4\config.h"). For example select #define FRDM_KL25Z for the FRDM-KL25Z or #define TWR_K60F120M for the TWR-K60F120M, but make sure that only one target is selected. There are many project options that can be set in this file, and more specific to the particular hardware in app_hw_kinetis.h, but all targets can usually be built with the default settings.

  • Now check the compiler setting to ensure that it is configured to match the type used (KL and KE parts are based on the the Cortex m0+ and so need this to be selected and K parts on Cortex M4). The setting is found in File | Properties | C/C++ Build | Settings | Tool Settings | Target Processor | ARM family whereby the following shows the two possible valid settings that must match the target in question:


  • Beware that there is also an FPU setting which should be disabled when using a processor without hardware FPU. When switching from Cortex-M4 with HW FPU to Cortex-M0+ make sure that this setting is disabled before selecting the M0+ core otherwise it will be left on but greyed out - see this forum post for more information: KDS Compile Error.

  • When using Cortex-M0+ processors add the pre-processor define ARM_MATH_CM0PLUS to the Assembler pre-processor setting by adding "-DARM_MATH_CM0PLUS". When not using Cortex-M0+ types remove this pre-processor define (delete it). If this step doesn't match, assembler files in the project (if present) will generate corresponding errors.
  • The final thing to check is that the correct linker script is being used, which is found in File | Properties | C/C++ Build | Settings | Tool settings | Cross ARM C++ Linker | General:



    Note that there is a collection of linker scripts in the folder "\Applications\uTaskerV1.4\GNU_Kinetis" which are shared by all Eclipse based Kinetis projects. The naming convention is simple and just needs the amount of program flash and RAM to be known in the device being used. For example, for the FRDM-KL25Z with 128k program flash and 16k RAM the linker script KL_128_16.ld should be used, for the TWR-K60F120M with 1M program flash and 128k RAM K_1M_128.ld would be suitable. When building for operation with the boot loader the linker scripts KL_128_16_BM.ld and K_1M_128_BM.ld would be used respectively; for KE parts KE_64_4.ld and KE_64_4_BM.ld are suitable examples. It is to be noted that it is very important to use the linker script belonging to the appropriate family since the RAM layout is usually different between these types!

  • Once the previous settings have been made and checked to suit the device used, the target can be built by commanding "Project | Build All".
    There is a post build step executed after a successful build which generates several output formats and locates the result in a target directory situated in the KDS project folder (eg. \Applications\uTaskerV1.4\KinetisDesignStudio\uTaskerV1.4_FLASH when building the flash target from the application project). This is controlled by a batch file "generate.bat" also located there, used to automate some things that can't be fully configured in KDS. This results in images being available for loading to the target using various programming techniques.

Following the above instructions for KDS import and project/target building allows the µTasker project (boot loaders and application) to be simply imported and built for any of its supported targets. Users can easily extend the framework with further target configurations by adding their own board types to the files config.h and app_hw_kinetis.h.



CodeWarrior 10.x

CodeWarrior 10.x is an Eclipse based environment that is made available free of charge by Freescale for Kinetis developments as long as the code size is less that 128k. It can be licensed for unrestricted use. It fully supports older Kinetis parts but doesn't include support for newer ones - such support will also not be included in the future - it can however still be used for building projects for any Kinetis device.

To import the µTasker project into CodeWarrior 10.x the following simple steps can be followed:

  • To prepare the CodeWarrior import (as opposed to MCUXpresso, KDS, S32 or Atollic) start by deleting the directory ".settings" in the root directory of the µTasker project (the root directory the folder where the project was extracted to including directories "uTasker", "Hardware", "Applications" etc.) as well as other files at this location which begin with a '.' (eg. ".cproject") since these may be for alternative Eclipse based environments.

  • Now copy the CodeWarrior project settings from the folder \Applications\uTaskerV1.4\KinetisCodeWarrior\Project_Settings to the root (these are the directory ".settings" and files ".cproject", ".cwGeneratedFileSetLog", ".project" etc.).
    There is also a read.me file in the project root directory explaining the procedure and why it is necessary. If you already know and are sure that the CodeWarrior files are located in the root these steps are of course not necessary.

  • Start CodeWarrior 10.x - it will ask for a workspace which can be anywhere, eg. enter "uTaskerKinetis".

  • The project import can be started by File | Import... which will open the Import dialog.

  • Expand "General" and select "Existing Projects into Workspace":


  • Click on "Next >" and then browse to the µTasker project root directory on the PC (the location of the root directory is explained in the first step), which will then show up under the Projects list.

  • Without changing any other settings simply click on "Finish" to start the import.
  • The project will now appear in the Project Explorer as shown below:

  • Note that the project framework contains the three µTasker projects (newer versions may have more application targets): two boot loaders plus the main application. The project to be built can be selected with "Project | Build Configurations | Set Active" which shows the following target and build options:

The next section shows how to configure the target of choice for a particular processor/board and build the project. The same is also shown in the video for CodeWarrior.

  • Choose the board type in the project's "config.h" file (for the main application this is the file "\Applications\uTaskerV1.4\config.h"). For example, select #define FRDM_KL25Z for the FRDM-KL25Z or #define TWR_K60F120M for the TWR-K60F120M, but make sure that only one target is selected. There are many project options that can be set in this file, and more specific to the particular hardware in app_hw_kinetis.h, but all targets can usually be built with the default settings.

  • Now check the compiler setting to ensure that it is configured to match the type used (KL and KE parts are based on the the Cortex m0+ and so need this to be selected and K parts on Cortex M4). The setting is found in File | Properties | C/C++ Build | Settings | Tool Settings | Target Processor | ARM family whereby the following shows the two possible valid settings that must match the target in question:


  • When using Cortex-M0+ processors add the pre-processor define ARM_MATH_CM0PLUS to the Assembler pre-processor setting by adding "-DARM_MATH_CM0PLUS". When not using Cortex-M0+ types remove this pre-processor define (delete it). If this step doesn't match, assembler files in the project (if present) will generate corresponding errors.
  • The final thing to check is that the correct linker script is being used, which is found in File | Properties | C/C++ Build | Settings | Tool settings | ARM Ltd Windows GCC C Linker | General:



    Note that there is a collection of linker scripts in the folder "\Applications\uTaskerV1.4\GNU_Kinetis" which are shared by all Eclipse based Kinetis projects. The naming convention is simple and just needs the amount of program flash and RAM to be known in the device being used. For example, for the FRDM-KL25Z with 128k program flash and 16k RAM the linker script KL_128_16.ld should be used, for the TWR-K60F120M with 1M program flash and 128k RAM K_1M_128.ld would be suitable. When building for operation with the boot loader the linker scripts KL_128_16_BM.ld and K_1M_128_BM.ld would be used respectively; for KE parts KE_64_4.ld and KE_64_4_BM.ld are suitable examples. It is to be noted that it is very important to use the linker script belonging to the appropriate family since the RAM layout is usually different between these types!

  • Once the previous settings have been made and checked to suit the device used, the target can be built by commanding "Project | Build All".
    There is a post build step executed after a successful build which generates several output formats and locates the result in a target directory situated in the CodeWarrior project folder (eg. \Applications\uTaskerV1.4\KinetisCodeWarrior\uTaskerV1.4_FLASH when building the flash target from the application project). This is controlled by a batch file "generate.bat" located in \Applications\uTaskerV1.4\KinetisCodeWarrior, used to automate some things that can't be fully configured in CodeWarrior. This results in images being available for loading to the target using various programming techniques.

Following the above instructions for CodeWarrior 10.x import and project/target building allows the µTasker project (boot loaders and application) to be simply imported and built for any of its supported targets. Users can easily extend the framework with further target configurations by adding their own board types to the files config.h and app_hw_kinetis.h.

Rowley Associate's Crossworks

The µTasker project framework contains Rowley Crossworks projects for the boot loaders and main application, which allow the project to be simply opened in Crossworks by double clicking the corresponding project file (eg. uTaskerV1_4.hpz). For example, to open the main application project double click on the file \Applications\uTaskerV1.4\Rowley_Kinetis\uTaskerV1_4.hpz, which will then be opened in CrossStudio. The workspace shows the files belonging to the project organised in groups similar to the directory orgainsation in the project directory.



There are typically targets for execution in Flash (release), RAM (debug) and for operation together with a boot loader. The target to be used can be selected by clicking on the active target so that a drop-down list appears and then selecting the one that is to be used:

The next section shows how to configure the target of choice for a particular processor/board and build the project.

  • Choose the board type in the project's "config.h" file (for the main application this is the file "\Applications\uTaskerV1.4\config.h"). For example, select #define FRDM_KE02Z for the FRDM-KE02Z or #define TWR_K60F120M for the TWR-K60F120M, but make sure that only one target is selected. There are many project options that can be set in this file, and more specific to the particular hardware in app_hw_kinetis.h, but all targets can usually be built with the default settings.

  • Now check the compiler setting to ensure that it is configured to match the type used (KL and KE parts are based on the the Cortex m0+ and so need this to be selected and K parts on Cortex M4). CrossStudio is particularly easy to use because the processor type can directly be selected, which will automatically configure for the appropriate core settings. The setting is found in Project | Properties | Build Options | Target Processor, although it is usually easiest to select by clicking on the Project in the Project Explorer and then selecting the target processor in the context menu that appears when clicking the right mouse button:


  • The next thing to check is that the correct linker script is being used, which is found in the projects Hardware folder:



    Note that the presently used one is darker than the non-used ones and if the required linker script file is not there it can be included in the project from a large selection of files located in \Applications\uTaskerV1.4\GNU_Kinetis, which can be added using the command "Add Existing File..." in the "Hardware" folder's conect menu.
    The naming convention is simple and just needs the amount of program flash and RAM to be known in the device being used. For example, for the FRDM-KE02Z with 64k program flash and 4k RAM the linker script KE_64_4.ld should be used, for the TWR-K60F120M with 1M program flash and 128k RAM K_1M_128.ld would be suitable. When building for operation with the boot loader the linker scripts KE_64_4_BM.ld and K_1M_128_BM.ld would be used respectively; for KL parts KL_128_32.ld and KL_128_32_BM.ld are suitable examples. It is to be noted that it is very important to use the linker script belonging to the appropriate family since the RAM layout is usually different between these types!

  • The final step is to modify (if needed) the linker script file in the Harware directory to be used for the build, which is a little complicated but achieved as follows:

    The properties of the present linker script, which is to be disabled, and the properties of the new linker script, which is to be enabled, can be opened by clicking on the corresponding file and then selecting "Properties..." in its context menu:



    In the files' properties the original one can be excluded from the build:



    and then the new one can be "not-excluded" from the build if it presently is included and its file type must be adjusted to "Linker Script" if it has just been added:



  • Once the previous settings have been made and checked to suit the device used, the target can be built by commanding "Build | Build uTaskerV1_4".

Following the above instructions for configuring and building with Rowley Crossworks CrossStudio allows the µTasker project (boot loaders and application) to be simply opened and built for any of its supported targets. Users can easily extend the framework with further target configurations by adding their own board types to the files config.h and app_hw_kinetis.h.


CooCox CoIDE

CooCox CoIDE support is included in the project and more details will appear here shortly.

IAR Embedded Workbench

The µTasker project framework contains IAR workspaces for the boot loaders and main application, which allow the project to be simply opened in IAR studio by double clicking the corresponding workspace file. For example, to open the main application project double click on the file \Applications\uTaskerV1.4\IAR7_Kinetis\uTaskerV1.4.eww, which will then be opened in IAR Embedded Worbench. The workspace shows the files belonging to the project organised in groups similar to the directory orgainsation in the project directory.



There are typically targets for execution in Flash (shown seleted above), RAM and for operation together with a boot loader. The target to be used can be selected by clicking on the active target so that a drop-down list appears and then selecting the one that is to be used:


The next section shows how to configure the target of choice for a particular processor/board and build the project.

  • Choose the board type in the project's "config.h" file (for the main application this is the file "\Applications\uTaskerV1.4\config.h"). For example, select #define FRDM_KL25Z for the FRDM-KL25Z or #define TWR_K60F120M for the TWR-K60F120M, but make sure that only one target is selected. There are many project options that can be set in this file, and more specific to the particular hardware in app_hw_kinetis.h, but all targets can usually be built with the default settings.

  • Now check the compiler setting to ensure that it is configured to match the type used (KL and KE parts are based on the the Cortex m0+ and so need this to be selected and K parts on Cortex M4). IAR is particularly easy to use because the processor type can directly be selected, which will automatically select the appropriate core settings. The setting is found in Project | Options... which opens the Options dialog and the Device can be selected from the tree of processor types - eg. Freescale -> KL2x -> MKL25Z128xxx4:


  • The final thing to check is that the correct linker script is being used, which is found in the Options dialog under Linker:



    Note that there is a collection of linker scripts in the folder "\Applications\uTaskerV1.4\IAR7_Kinetis\settings" and in the corresponding settings directory to other IAR projects. The naming convention is simple and just needs the amount of program flash and RAM to be known in the device being used. For example, for the FRDM-KL25Z with 128k program flash and 16k RAM the linker script KL_128_16.icf should be used, for the TWR-K60F120M with 1M program flash and 128k RAM K_1M_128.icf would be suitable. When building for operation with the boot loader the linker scripts KL_128_16_BM.icf and K_1M_128_BM.icf would be used respectively; for KE parts KE_64_4.icf and KE_64_4_BM.icf are suitable examples. It is to be noted that it is very important to use the linker script belonging to the appropriate family since the RAM layout is usually different between these types!

  • Once the previous settings have been made and checked to suit the device used, the target can be built by commanding "Project | Make".

Following the above instructions for configuring and building with IAR Embedded Workbench allows the µTasker project (boot loaders and application) to be simply opened and built for any of its supported targets. Users can easily extend the framework with further target configurations by adding their own board types to the files config.h and app_hw_kinetis.h.


KEIL µVision

The µTasker project framework contains µVision projects for the boot loaders and main application, which allow the project to be simply opened in µVision studio by double clicking the corresponding project file. For example, to open the main application project double click on the file \Applications\uTaskerV1.4\uVision_Kinetis\uTaskerV1.4.uvproj, which will then be opened in µVision. The workspace shows the files belonging to the project organised in groups similar to the directory orgainsation in the project directory.



There are typically targets for standalone execution in Flash (seen selected above) and for operation together with a boot loader. The target to be used can be selected by clicking on the active target so that a drop-down list appears and then selecting the one that is to be used:


The next section shows how to configure the target of choice for a particular processor/board and build the project.

  • Choose the board type in the project's "config.h" file (for the main application this is the file "\Applications\uTaskerV1.4\config.h"). For example, select #define FRDM_KL25Z for the FRDM-KL25Z or #define TWR_K60F120M for the TWR-K60F120M, but make sure that only one target is selected. There are many project options that can be set in this file, and more specific to the particular hardware in app_hw_kinetis.h, but all targets can usually be built with the default settings.

  • It is recommended to have installed packs relevant to your processor so that there are no issues when trying to select parts in the following section (this is controlled by the Pack Installer from µVision 5).
  • Now check the compiler setting to ensure that it is configured to match the type used (KL and KE parts are based on the the Cortex m0+ and so need this to be selected and K parts on Cortex M4). µVision is particularly easy to use because the processor type can directly be selected, which will automatically select the appropriate core settings. The setting is found in Project | Select Device for Target 'uTaskerV1.4'... which opens a dialogue to select the CPU. The device can be selected from the tree of processor types - eg. Freescale -> KLxx -> KL2x ->MKL25Z128xxx4:


  • The final thing to check is that the correct linker script is being used, which is found in Project | Options for Target 'uTaskerV1.4'... and then in the Linker tab:



    Note that there is a collection of linker scripts in the folder "\Applications\uTaskerV1.4\uVision_Kinetis\settings" and in the corresponding settings directory to other µVision projects. The naming convention is simple and just needs the amount of program flash and RAM to be known in the device being used. For example, for the FRDM-KL25Z with 128k program flash and 16k RAM the linker script KL_128_16.sct should be used, for the TWR-K60F120M with 1M program flash and 128k RAM K_1M_128.sct would be suitable. When building for operation with the boot loader the linker scripts KL_128_16_BM.sct and K_1M_128_BM.sct would be used respectively; for KE parts KE_64_4.sct and KE_64_4_BM.sct are suitable examples. It is to be noted that it is very important to use the linker script belonging to the appropriate family since the RAM layout is usually different between these types!
  • The µVision project includes an assembler file [\Hardware\Kinetis\kinetis_asm.s]. This has some code that is Cortex type specific and so the assembler need to know which core it is assemling for. Select Project | Options for Target 'uTaskerV1.4'... and then in the Asm tab set CORTEX_M0 in case a devie with this core is to be built for or else set CORTEX_M4



  • Once the previous settings have been made and checked to suit the device used, the target can be built by commanding "Project | Build target".

Following the above instructions for configuring and building with µVision allows the µTasker project (boot loaders and application) to be simply opened and built for any of its supported targets. Users can easily extend the framework with further target configurations by adding their own board types to the files config.h and app_hw_kinetis.h.


Green Hills

Green Hills support is included in the project and more details will appear here shortly.

S32 Design Studio

S32 Design Studio is an Eclipse based environment that is made available free of charge by Freescale for Kinetis developments. It specifically supports only KEA Kinetis parts but can still be used for building projects for any Kinetis device.

To import the µTasker project into S32 Design Studio the following simple steps can be followed:

  • To prepare the S32 Design Studio import (as opposed to KDS, MCUXpresso, CodeWarrior or Atollic) start by deleting the directory ".settings" in the root directory of the µTasker project (the root directory the folder where the project was extracted to including directories "uTasker", "Hardware", "Applications" etc.) as well as other files at this location which begin with a '.' (eg. ".cproject") since these may be for alternative Eclipse based environments.

  • Now copy the S32 Design Studio project settings from the folder \Applications\uTaskerV1.4\S32DesignStudio\Project_Settings to the root (these are the directory ".settings" and files ".cproject", ".cwGeneratedFileSetLog" and ".project").
    There is also a read.me file at that location explaining the procedure and why it is necessary. If you already know and are sure that the S32 Design Studio files are located in the root these steps are of course not necessary.

  • Start S32 Design Studio - it will ask for a workspace which can be anywhere, eg. enter "uTaskerKinetis".

  • The project import can be started by File | Import... which will open the Import dialog.

  • Expand "General" and select "Existing Projects into Workspace":


  • Click on "Next >" and then browse to the µTasker project root directory on the PC (the location of the root directory is explained in the first step), which will then show up under the Projects list.

  • Without changing any other settings simply click on "Finish" to start the import.
  • The project will now appear in the Project Explorer as shown below:

  • Note that the project framework contains the three µTasker projects (newer versions may have more application targets): two boot loaders plus the main application. The project to be built can be selected with "Project | Build Configurations | Set Active" which shows the following target and build options:

The next section shows how to configure the target of choice for a particular processor/board and build the project. The same is also shown in the video for CodeWarrior which is however also relevant for S32 Design Studio.

  • Choose the board type in the project's "config.h" file (for the main application this is the file "\Applications\uTaskerV1.4\config.h"). For example select #define FRDM_KEAZ128Q80 for the FRDM-KEAZ128Q80, but make sure that only one target is selected. There are many project options that can be set in this file, and more specific to the particular hardware in app_hw_kinetis.h, but all targets can usually be built with the default settings.

  • Now check the compiler setting to ensure that it is configured to match the type used (KL, KE and KEA parts are based on the the Cortex m0+ and so need this to be selected and K parts on Cortex M4). The setting is found in File | Properties | C/C++ Build | Settings | Tool Settings | Target Processor | ARM family whereby the following shows the two possible valid settings that must match the target in question:


  • When using Cortex-M0+ processors add the pre-processor define ARM_MATH_CM0PLUS to the Assembler pre-processor setting by adding "-DARM_MATH_CM0PLUS". When not using Cortex-M0+ types remove this pre-processor define (delete it). If this step doesn't match, assembler files in the project (if present) will generate corresponding errors.
  • The final thing to check is that the correct linker script is being used, which is found in File | Properties | C/C++ Build | Settings | Tool settings | Cross ARM C++ Linker | General:



    Note that there is a collection of linker scripts in the folder "\Applications\uTaskerV1.4\GNU_Kinetis" which are shared by all Eclipse based Kinetis projects. The naming convention is simple and just needs the amount of program flash and RAM to be known in the device being used. For example, for the FRDM-KEAZ128Q80 with 128k program flash and 16k RAM the linker script KEA_128_16.ld should be used, for the TWR-K60F120M with 1M program flash and 128k RAM K_1M_128.ld would be suitable. When building for operation with the boot loader the linker scripts KEA_128_16_BM.ld and K_1M_128_BM.ld would be used respectively; for KE parts KE_64_4.ld and KE_64_4_BM.ld are suitable examples. It is to be noted that it is very important to use the linker script belonging to the appropriate family since the RAM layout is often different between these types!

  • Once the previous settings have been made and checked to suit the device used, the target can be built by commanding "Project | Build All".
    There is a post build step executed after a successful build which generates several output formats and locates the result in a target directory situated in the S32 Design Studio project folder (eg. \Applications\uTaskerV1.4\S32DesignStudio\uTaskerV1.4_FLASH when building the flash target from the application project). This is controlled by a batch file "generate.bat" also located there, used to automate some things that can't be fully configured in S32 Design Studio. This results in images being available for loading to the target using various programming techniques.

Following the above instructions for S32 Design Studio import and project/target building allows the µTasker project (boot loaders and application) to be simply imported and built for any of its supported targets. Users can easily extend the framework with further target configurations by adding their own board types to the files config.h and app_hw_kinetis.h.

Atollic TrueSTUDIO for ARM

Atollic support is included in the project and more details will appear here shortly.

Standalone GCC from Makefile

Each project in the µTasker project framework contains a GCC makefile that allows it to be built from a bat file. For example, the uTaskerV1.4 application's makefile is located in \Applications\uTaskerV1.4\GNU_Kinetis - make_uTaskerV1.4_GNU_Kinetis and can be executed by double clicking on Build_Kinetis.bat.

The bat file can also be executed as a post-build step from the VisualStudio project, which makes the operation especially pratical during development work.

The following is typical content of the bat file:

SET PATH=%PATH%;C:\Freescale\KDS_2.0.0\toolchain\bin
SET PATH=%PATH%;../../../Tools
make -f make_uTaskerV1.4_GNU_Kinetis all
uTaskerCombine "../../uTaskerBoot/GNU_Kinetis/uTaskerBoot.bin" uTaskerV1.4_BM.bin 0x8080 uTaskerBM.bin uTaskerBM.hex
uTaskerConvert.exe uTaskerV1.4_BM.bin z_Upload.bin -0x1234 -a748b6531124
uTaskerConvert.exe uTaskerV1.4_BM.bin sd_card_enc.bin -0x1235 -b748b6531124 -ff25a788f2e681338777 -afe1 -c298

The path entry for the tool chain may not be required if this is already known on the local PC or may need to be modified to suit the location of the GCC compiler - in this example the same tool chain is used as is installed by KDS.

The commands executed after the make command are discussed further below.

The following details how to configure the project to be built for the target of choice:

  • Choose the board type in the project's "config.h" file (for the main application this is the file "\Applications\uTaskerV1.4\config.h"). For example, select #define FRDM_KL25Z for the FRDM-KL25Z or #define TWR_K60F120M for the TWR-K60F120M, but make sure that only one target is selected. There are many project options that can be set in this file, and more specific to the particular hardware in app_hw_kinetis.h, but all targets can usually be built with the default settings.

  • Now check the compiler setting to ensure that it is configured to match the type used (KL and KE parts are based on the the Cortex m0+ and so need this to be selected and K parts on Cortex M4). The setting is found in the make file, eg. make_uTaskerV1.4_GNU_Kinetis
                 
    # Compiler flags (thumb mode - little endian)
    #
    C_FLAGS = -mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb -Wall -Wstrict-prototypes -fmessage-length=0 -fsigned-char  -ffunction-sections -fdata-sections 
    #C_FLAGS = -mcpu=cortex-m0plus -mthumb -mlittle-endian -mthumb -Wall -Wstrict-prototypes -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections 
    

    Notice that there are two lines with either the Cortex-M4 or Cortex-M0+ being set. If this does not match the processor being used, comment out the inappropriate type by adding a # to the start of the line and remove the comment from the line that is to be valid.

  • The final thing to check is that the correct linker script is being used, which is found at the bottom of the make file:
               
    uTaskerV1.4.elf: $(OBJS) $(OBJS2) KL_64_8.ld K_1M_128.ld K_512_64.ld K_256_256.ld K_256_64.ld  K_256_32.ld KL_256_32.ld KL_128_16.ld KL_64_8.ld KL_32_4.ld KE_64_4.ld KE_128_16.ld KE_8_1.ld
    	$(CC) $(C_FLAGS) -Os -g -TK_128_16.ld -nostartfiles -Xlinker --gc-sections -Wl,-Map,"uTaskerV1.4.map" -o "uTaskerV1.4.elf" $(OBJS) $(OBJS2)
    	$(CC_OBJ) --only-section=.data --only-section=.init --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.f_config --output-target=srec uTaskerV1.4.elf uTaskerV1.4.srec
    	$(CC_OBJ) --only-section=.data --only-section=.init --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.f_config --output-target=ihex uTaskerV1.4.elf uTaskerV1.4.hex
    	$(CC_OBJ) --only-section=.data --only-section=.init --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.f_config --output-target=binary uTaskerV1.4.elf uTaskerV1.4.bin
    	$(CC_SIZE) uTaskerV1.4.elf
    
    uTaskerV1.4_BM.elf: $(OBJS) $(OBJS2_BM) K_1M_256_BM.ld K_1M_128_BM.ld K_512_64_BM.ld K_256_256_BM.ld K_256_64_BM.ld K_128_16_BM.ld KL_256_32_BM.ld KL_128_16_BM.ld KL_64_8_BM.ld KL_32_4_BM.ld KE_128_16_BM.ld KE_64_4_BM.ld
    	$(CC) $(C_FLAGS) -Os -g -TK_128_16_BM.ld -nostartfiles -Xlinker --gc-sections -Wl,-Map=uTaskerV1.4_BM.map -o uTaskerV1.4_BM.elf $(OBJS) $(OBJS2_BM)
    	$(CC_OBJ) --only-section=.data --only-section=.init --only-section=.text --only-section=.rodata --only-section=.vectors --output-target=srec uTaskerV1.4_BM.elf uTaskerV1.4_BM.srec
    	$(CC_OBJ) --only-section=.data --only-section=.init --only-section=.text --only-section=.rodata --only-section=.vectors --output-target=binary uTaskerV1.4_BM.elf uTaskerV1.4_BM.bin
    	$(CC_SIZE) uTaskerV1.4_BM.elf
    	$(CC) -v
        

    Notice that there are two linking operations in most projects; the first to build a standalone image and the second to build an image suitable for loading with a boot loader, linked at an offset address. The linker scripts being used are defined by the settings -TK_128_16.ld (standalone) and -TK_128_16_BM.ld (for boot loader version). These two can be edited to suit the processor in question. (Be careful that the -T still precedes the linker script file name).

    Note that there is a collection of linker scripts in the same folder as where the makefile is located. The naming convention is simple and just needs the amount of program flash and RAM to be known in the device being used. For example, for the FRDM-KL25Z with 128k program flash and 16k RAM the linker script KL_128_16.ld should be used, for the TWR-K60F120M with 1M program flash and 128k RAM K_1M_128.ld would be suitable. When building for operation with the boot loader the linker scripts KL_128_16_BM.ld and K_1M_128_BM.ld would be used respectively; for KE parts KE_64_4.ld and KE_64_4_BM.ld are suitable examples. It is to be noted that it is very important to use the linker script belonging to the appropriate family since the RAM layout is usually different between these types!


  • Once the previous settings have been made and checked to suit the device used, the target can be built by executing the bat file.

    After the project is build by processing the make file there are additional calls to µTasker utilities that automatically generate additional image variations suitable for loading with various loaders, or combining the image with a loader so that a single file is available for production loading. More details of the utilities and the commands can be found at µTasker Utilities.

    Following the above instructions for project/target building allows the µTasker project (boot loaders and application) to be simply built for any of its supported targets. Users can easily extend the framework with further target configurations by adding their own board types to the files config.h and app_hw_kinetis.h.



    VisualStudio for Kinetis simulation

    VisualStudio is used as basis of all project simulation and includes a target that automatically builds the project for the cross-compiled target using a GCC make file. The previous discussion for setting the GCC configuration is valid for VisualStudio use when the target with GCC post build step is used.

    The Kinetis Tutorial - Ethernet and the Simulator contains instructions as to how to use VisualStudio to build and simulate the project with the Kinetis simulator. Therefore this section concentrats on a step by step guide for new users to open the project and ensure that the targets are configured suitably. Visual Studio 2010 is assumed, whereby all versions are similar in usage; VisualStudio 2010 Express edition is free of charge and can be used for work with the µTasker project.

    The µTasker project framework contains Visual Studio projects for the boot loaders and main application, which allow the project to be simply opened in VisualStudio studio by double clicking the corresponding project file. For example, to open the main application projcet double click on the file \Applications\uTaskerV1.4\Simulator\uTaskerV1-4.vcxproj, which will then be opened in VisualStudio. The solution explorer shows the files belonging to the project organised in groups similar to the directory orgainsation in the project directory.



    There are two targets; one for simulation and debug exclusively in the VisualStudio environment (only simulation) and one for simulation plus GCC cross compilation post build - in the second case the build takes longer due to it being compiled for two platforms but there is always an image available for loading to the hardware target. The target to be used can be selected from the Solution Configurations drop-down list:


    The next section shows how to configure the target of choice for a particular processor/board and build the project.

    • Choose the board type in the project's "config.h" file (for the main application this is the file "\Applications\uTaskerV1.4\config.h"). For example, select #define FRDM_KL25Z for the FRDM-KL25Z or #define TWR_K60F120M for the TWR-K60F120M, but make sure that only one target is selected. There are many project options that can be set in this file, and more specific to the particular hardware in app_hw_kinetis.h, but all targets can usually be built with the default settings.

    • If working with the simulation target without post build cross-compile step there are no further configurations required.

    • If a post build step is required (for subsequent loading to the hardware target) the same GCC setting need to be checked as detailed in the GCC configuration section. The make file "make_uTaskerV1.4_GNU_Kinetis" is included as a VisualStudio project file so that it can be opened and edited conveniently from the Solution Explorer.

    • Once the previous settings have been made and checked to suit the device used, the target can be built by commanding "Debug | Build Solution" or hitting the [F7] key.

    When the target with post-build cross compilation step is used the same images are generated as in the case of the GCC standalone make file build, which means that typically binary, SREC and HEX files for standalone and boot loading will be created each time a successful build is performed.

    Following the above instructions for configuring and building with VisualStudio allows the µTasker project (boot loaders and application) to be simply opened and built for any of its supported targets. Users can easily extend the framework with further target configurations by adding their own board types to the files config.h and app_hw_kinetis.h.

    VisualStudio 6.0 projects are also included in the same directory as the VisualStudio V2010 projects in case an older VisualStudio version is in use.

Return to the Kinetis landing page



µTasker Kinetis Compiler Information. Copyright (c) 2004..2019 M.J.Butcher Consulting