Software Migration Guide from MKW36Z512VHT4 to MKW36A512VFT4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Software Migration Guide from MKW36Z512VHT4 to MKW36A512VFT4

Software Migration Guide from MKW36Z512VHT4 to MKW36A512VFT4

Introduction

This post guides you on migrating from MKW36Z512VHT4 to MKW36A512VFT4 MCUs. This example will make use of the "beacon" SDK example.

SDK Download and Install

1- Go to MCUXpresso web page: MCUXpresso Web Page

2- Log in with your registered account.

3- Search for the "KW36A" device. Then click on the suggested processor and click on "Build MCUXpresso SDK"

 

pastedImage_6.png

 

 

4- The next page will be displayed. Select “All toolchains” in the “Toolchain / IDE” box and provide a name to identify the package. Then click on "Download SDK".

 

pastedImage_8.png

 

5- Accept the license agreement. Wait a few minutes until the system gets the package into your profile. Download the SDK clicking on "Download SDK Archive" as depicted in the following figure.

 

pastedImage_10.png

 

6- If MCUXpresso IDE is used, drag and drop the KW36A SDK zip folder in “Installed SDK’s” perspective to install the package.

 

pastedImage_12.png

 

At this point, you have downloaded and installed the SDK package for the KW36A device.

 

Software Migration in MCUXpresso IDE

1- Import the "beacon" example on the MCUXpresso workspace. Click on “Import SDK examples(s)…” option, a new window will appear. Then select "MKW36Z512xxx4" and click on the FRDM-KW36 image. Click on the "Next >" button.

 

pastedImage_15.png

 

2- Search beacon and select your project version (bm or freertos).

 

pastedImage_17.png

 

3- Go to Project/Properties. Expand C/C++ Build/MCU settings and select MKW36A512xxx4 MCU. Click Apply and Close button to save the configuration.

 

pastedImage_19.png

 

4- Rename MKW36Z folders as MKW36A, clicking the right mouse button and selecting "Rename". These are the following:

 

framework/DCDC/Interface -> MKW36Z

framework/DCDC/Source -> MKW36Z

framework/LowPower/Interface -> MKW36Z

framework/LowPower/Source -> MKW36Z

framework/XCVR -> MKW36Z4

 

pastedImage_28.png

 

5- Open the Project/Properties window in MCUXpresso IDE. Go to C/C++ Build/Settings and select MCU C Compiler/Includes folder in the Tool Settings window. Edit all paths related to MKW36 MCU, in according to MKW35 folders before created. The results must look similar as shown below:

 

../framework/LowPower/Interface/MKW36A

../framework/LowPower/Source/MKW36A

../framework/DCDC/Interface/MKW36A

../framework/XCVR/MKW36A4

 

pastedImage_41.png

 

6- Select MCU Assembler/General folder in Tool Settings. Edit the paths related to MKW36 MCU. The results must look similar as shown below:

 

../framework/LowPower/Interface/MKW36A

../framework/LowPower/Source/MKW36A

../framework/DCDC/Interface/MKW36A

../framework/XCVR/MKW36A4

 

pastedImage_43.png

 

7- Go to Project/Properties. Expand MCU C Compiler/Preprocessor window. Edit "CPU_MKW36Z512VHT4" and "CPU_MKW36Z512VHT4_cm0plus" symbols, rename it as "CPU_MKW36A512VFT4" and "CPU_MKW36A512VFT4_cm0plus" respectively. Save the changes.

 

pastedImage_21.png

 

8- Go to the workspace. Delete “fsl_device_registers, MKW36Z4, MKW36Z4_features, system_MKW36Z4.h and system_MKW36Z4.c” files located at CMSIS folder. Then, unzip the MKW35Z SDK package and search for “fsl_device_registers, MKW36A4, MKW36A4_features, system_MKW36A4.h and system_MKW36A4.c” files into this folder at the following paths:

 

<SDK_folder_root>/devices/MKW36A4/fsl_device_registers.h

<SDK_folder_root>/devices/MKW36A4/MKW36A4.h

<SDK_folder_root>/devices/MKW36A4/MKW36A4_features.h

<SDK_folder_root>/devices/MKW36A4/system_MKW36A4.h

<SDK_folder_root>/devices/MKW36A4/system_MKW36A4.c

 

pastedImage_26.png

 

9- Overwirte the “startup_mkw36z4.c” (located inthe startup folder) by the "startup_mkw36a4.c" located in the following path <SDK_folder_root>/devices/MKW36A4/mcuxpresso/startup_mkw36a4.c. You can simply drag and drop on the startup folder, and remove the older one.

 

pastedImage_1.png

 

10- Open "fsl_device_registers.h" file in CMSIS folder. Add"defined(CPU_MKW36A512VFT4)" in the following code (line 18 of the file):

 

/*
 * Include the cpu specific register header files.
 *
 * The CPU macro should be declared in the project or makefile.
 */
#if (defined(CPU_MKW36A512VFP4) || defined(CPU_MKW36A512VFT4) || defined(CPU_MKW36A512VHT4) || defined(CPU_MKW36A512VFT4))‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

11- Open "ble_config.h" file in bluetooth->host->config folder. Add "defined(CPU_MKW36A512VFT4)" in the following code (line 146 of the file):

 

/* The maximum number of BLE connection supported by platform */
#if defined(CPU_QN9080C)
 #define MAX_PLATFORM_SUPPORTED_CONNECTIONS 16
#elif (defined(CPU_MKW36Z512VFP4) || defined(CPU_MKW36Z512VHT4) || defined(CPU_MKW36A512VFP4) || defined(CPU_MKW36A512VHT4) || defined(CPU_MKW36A512VFT4) || \
 defined(CPU_MKW35Z512VHT4) || defined(CPU_MKW35A512VFP4) || \
 defined(CPU_K32W032S1M2CAx_cm0plus) || defined(CPU_K32W032S1M2VPJ_cm0plus) || \
 defined(CPU_K32W032S1M2CAx_cm4) || defined(CPU_K32W032S1M2VPJ_cm4) || \
 defined(CPU_MKW38A512VFT4) || defined (CPU_MKW38Z512VFT4) || defined(CPU_MKW39A512VFT4) || \
 defined(CPU_MKW37A512VFT4) || defined(CPU_MKW37Z512VFT4))‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

12- Open "ble_controller_task.c" file in source->common folder. Add "defined(CPU_MKW36A512VFT4)" in the following code (line 272 of the file): 

 

#elif (defined(CPU_MKW35A512VFP4) || defined(CPU_MKW35Z512VHT4) || defined(CPU_MKW36A512VFP4) || defined(CPU_MKW36A512VFT4) ||\
 defined(CPU_MKW36A512VHT4) || defined(CPU_MKW36Z512VFP4) || defined(CPU_MKW36Z512VHT4))
/* Select BLE protocol on RADIO0_IRQ */
 XCVR_MISC->XCVR_CTRL = (uint32_t)((XCVR_MISC->XCVR_CTRL & (uint32_t)~(uint32_t)(
 XCVR_CTRL_XCVR_CTRL_RADIO0_IRQ_SEL_MASK
 )) | (uint32_t)(
 (0UL << XCVR_CTRL_XCVR_CTRL_RADIO0_IRQ_SEL_SHIFT)
 ));‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

13-Build the project.

 

At this point, the project is already migrated.

 

Software Migration in IAR Embedded Workbench IDE

1- Open the beacon project located in the following path:

2- Select the project in the workspace and press Alt + F7 to open project options.

pastedImage_13.png

 

3- In the General Options/Target window click the icon next to the device name and select the appropriate device NXP/KinetisKW/KW3x/NXP MKW36A512xxx4, then click the OK button.

pastedImage_15.png

 

4- Create a new folder with the name MKW36A at following paths:

<SDK_root>/middleware/wireless/framework_5.4.6/DCDC/Interface

<SDK_root>/middleware/wireless/framework_5.4.6/DCDC/Source

<SDK_root>/middleware/wireless/framework_5.4.6/LowPower/Interface

<SDK_root>/middleware/wireless/framework_5.4.6/LowPower/Source

<SDK_root>/middleware/wireless/framework_5.4.6/XCVR

 

pastedImage_17.png

 

5- Copy all files inside MKW36Z folders located at the above paths and paste in MKW36A folders.

 

pastedImage_19.png

 

6- Select the beacon project in the workspace and press Alt+F7 to open project options window. In C/C++ Compiler/Preprocessor window, rename the paths related to MKW36Z folders to MKW36A folders. Rename the CPU_MKW36Z512VHT4 macro as CPU_MKW36A512VFT4 in the defined symbols text box. The results must look similar as shown below: Click the OK button.

$PROJ_DIR$/middleware/wireless/framework_5.4.2/LowPower/Interface/MKW36A

$PROJ_DIR$/../../../../../../../devices/MKW36A4/drivers

$PROJ_DIR$/../../../../../../../middleware/wireless/framework_5.4.2/DCDC/Interface/MKW36A

$PROJ_DIR$/../../../../../../../middleware/wireless/framework_5.4.2/XCVR/MKW36A4

$PROJ_DIR$/../../../../../../../devices/MKW36A4

$PROJ_DIR$/../../../../../../../devices/MKW36A4/utilities

 

pastedImage_21.png

 

7- Expand the startup folder, select all files, click the right mouse button and select the “Remove” option. Click the right mouse button on the folder and select “Add/Add files”. Add the startup_MKW36A4.s located at this path:

<SDK_root>/devices/MKW36A4/iar/startup_MKW36A4.s

Also, add system_MKW36A4.c and system_MKW36A4.h into the startup folder. Both files are located at the next path:

<SDK_root>/devices/MKW36A4

pastedImage_24.png

 

8- Open "ble_config.h" file in bluetooth->host->config folder. Add "defined(CPU_MKW36A512VFT4)" in the following code:

/* The maximum number of BLE connection supported by platform */
#if defined(CPU_QN9080C)
 #define MAX_PLATFORM_SUPPORTED_CONNECTIONS 16
#elif (defined(CPU_MKW36Z512VFP4) || defined(CPU_MKW36Z512VHT4) || defined(CPU_MKW36A512VFP4) || defined(CPU_MKW36A512VHT4) || defined(CPU_MKW36A512VFT4) || \
 defined(CPU_MKW35Z512VHT4) || defined(CPU_MKW35A512VFP4) || \
 defined(CPU_K32W032S1M2CAx_cm0plus) || defined(CPU_K32W032S1M2VPJ_cm0plus) || \
 defined(CPU_K32W032S1M2CAx_cm4) || defined(CPU_K32W032S1M2VPJ_cm4) || \
 defined(CPU_MKW38A512VFT4) || defined (CPU_MKW38Z512VFT4) || defined(CPU_MKW39A512VFT4) || \
 defined(CPU_MKW37A512VFT4) || defined(CPU_MKW37Z512VFT4))‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

9- Open "ble_controller_task.c" file in source->common folder. Add "defined(CPU_MKW36A512VFT4)" in the following code:

#elif (defined(CPU_MKW35A512VFP4) || defined(CPU_MKW35Z512VHT4) || defined(CPU_MKW36A512VFP4) || defined(CPU_MKW36A512VFT4) ||\
 defined(CPU_MKW36A512VHT4) || defined(CPU_MKW36Z512VFP4) || defined(CPU_MKW36Z512VHT4))
/* Select BLE protocol on RADIO0_IRQ */
 XCVR_MISC->XCVR_CTRL = (uint32_t)((XCVR_MISC->XCVR_CTRL & (uint32_t)~(uint32_t)(
 XCVR_CTRL_XCVR_CTRL_RADIO0_IRQ_SEL_MASK
 )) | (uint32_t)(
 (0UL << XCVR_CTRL_XCVR_CTRL_RADIO0_IRQ_SEL_SHIFT)
 ));‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

10-Build the project.

 

At this point, the project is already migrated.

Labels (3)
Tags (2)
No ratings
Version history
Last update:
‎09-14-2020 11:37 AM
Updated by: