Software Migration Guide from MKW36Z512VHT4 to MKW36A512VFT4

Document created by Edgar Eduardo Lomeli Gonzalez Employee on Jan 24, 2020Last modified by Edgar Eduardo Lomeli Gonzalez Employee on Apr 6, 2020
Version 5Show Document
  • View in full screen mode

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"

 

 

 

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".

 

 

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.

 

 

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

 

 

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.

 

 

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

 

 

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

 

 

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

 

 

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

 

 

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

 

 

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.

 

 

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

 

 

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.

 

 

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.

 

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.

 

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

 

 

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

 

 

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

 

 

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

 

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.

2 people found this helpful

Attachments

    Outcomes