HOWTO: Change the CPU Derivative in an SDK-Based Application Project

Document created by Mike Doidge Employee on Jul 19, 2018Last modified by Mike Doidge Employee on Aug 1, 2018
Version 2Show Document
  • View in full screen mode

Suppose you created an application project for one MCU (S32K144, for example), but your requirements changed, or perhaps you are reusing a previous project to start a new project on a different MCU (derivative from same family). If you are working with the S32 SDK, there is a way to do it. We have detailed the steps in this document.

 

1) Open the project to be modified and select the C/C++ perspective, ensure that the Processor Expert views are shown

2) From the Components Library, Processors tab, select the new MCU derivative

 

 

3) Either double-click OR right-click and select 'Add to project', to add the new processor to your components list for your project. Be sure to select just one of the pin packages, whichever is appropriate for you application.

 

 

4) From the Component Inspector*, you will see a message in red text asking if you would like to switch into the configuration for the new processor. Click on the button 'Switch Configuration'.

*may have to select pin_mux:PinSettings in the Components view for the project to see the message

 

 

5) Open the Project Properties, either select from File menu or right-click on project name and select from the menu. Then go to C/C++ Build -> Settings -> Standard S32DS C Compiler -> Includes and delete all include paths starting with $(S32K1**_SDK_VER_PATH). Repeat this step for the Standard S32DS Assembler -> General include paths. Note: For all changes in C/C++ Build -> Settings, make sure to repeat for all build configurations (RAM, FLASH, Debug, Release, etc.).

 

 

6) The paths to the SDK should now be gone. The result should look similar to this:

 

 

7) In Standard S32DS C Compiler -> Preprocessor settings, change the defined symbol to the one which is appropriate for the new MCU and click OK. (e.g. CPU_S32K142 for S32K142, CPU_S32K148 for S32K148, etc.) If you are not sure what should be here, then create a new empty project for the new MCU and refer to the settings there.

 

 

8) The Preprocessor setting after the change

 

 

9) Click on the 'Generate Processor Expert Code' button in the Components view for your project

 

 

10) From Project Explorer, remove the startup and linker files from Project Settings folder

 

 

11) Copy startup and linker files for the new MCU from <SDK_PATH>/platform/devices/<CPU>/startup/<Compiler> and <SDK_PATH>/platform/devices/<CPU>/linker/<Compiler>

 

 

12) Open the Project Properties, then C/C++ Build -> Settings -> Standard S32DS C Linker -> General and update the linker file path to reflect the new filename and click OK. (in this case: S32K144_64_flash.id to S32K142_32_flash.id)

 

 

13) After the change

 

 

14) Perform a Clean and a Build operations of the project.

15) Update the device in the debug configurations

 

 

Now you can change your MCU derivatives!

1 person found this helpful

Attachments

    Outcomes