从MKW36Z512VHT4到MKW36A512VFT4的软件迁移指南

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

从MKW36Z512VHT4到MKW36A512VFT4的软件迁移指南

从MKW36Z512VHT4到MKW36A512VFT4的软件迁移指南

MKW36Z512VHT4MKW36A512VFT4的软件迁移指南

USL:https://community.nxp.com/docs/DOC-345487

Edgar Eduardo Lomeli Gonzalez 2020-09-14 创建的文档

 

引言

这篇文章将指导您如何从MKW36Z512VHT4迁移到MKW36A512VFT4 MCU。本示例将使用“信标(beacon)” SDK例程

SDK下载和安装

1- 前往MCUXpresso网页:MCUXpresso网页

2- 使用您的注册帐户登录。

3- 搜索“ KW36A”设备。点击推荐的处理器,然后单击“Build MCUXpresso SDK”。

shaozhongliangs_0-1636004064630.png

 

4- 点击后将显示另一页面。在“Toolchain / IDE”框中选择“All toolchains”,并提供名称以标识软件包。然后点击“Download SDK”。

shaozhongliangs_1-1636004064806.png

 

5- 接受许可协议。等待几分钟直到系统将软件包放入您的配置文件中。 单击“下载SDK存档”(Download SDK Archive),下载SDK,如下图所示。

shaozhongliangs_2-1636004064819.png

 

6- 如果使用MCUXpresso IDEKW36A SDK 压缩文件夹到“Installed SDKs”视图中以安装软件包。

shaozhongliangs_3-1636004064835.png

 

至此,您已经下载并安装KW36A设备的SDK软件包。

MCUXpresso IDE进行软件迁移

1- 在 MCUXpresso工作区导入“信标(beacon)”示例。单击“Import SDK examples(s)…”选项,将出现一个新窗口。然后选择“ MKW36Z512xxx4”,单击FRDM-KW36图像。点击“Next >”按钮。

shaozhongliangs_4-1636004064889.png

 

2- 查找“beacon(信标)例程并选择是否支持FreeRTOS

shaozhongliangs_5-1636004064893.png

 

3- 转到Project/Properties。展开C / C ++ Build / MCU设置,然后选择MKW36A512xxx4 MCU。单击“Apply and Close”按钮以保存配置。

shaozhongliangs_6-1636004065148.png

 

4- 通过单击鼠标右键并选择“重命名”以下MKW36Z文件夹重命名为MKW36A


           framework/DCDC/Interface -> MKW36Z

framework/DCDC/Source -> MKW36Z

framework/LowPower/Interface -> MKW36Z

framework/LowPower/Source -> MKW36Z

framework/XCVR -> MKW36Z4

 

shaozhongliangs_7-1636004065219.png

 

5- 在MCUXpresso IDE中打开“Project/Properties”窗口。 转到C / C ++ Build / Settings,然后在Tool Settings窗口中选择MCU C Compiler / Includes文件夹。在创建之前,根据MKW35文件夹编辑与MKW36 MCU相关的所有路径。结果类似如下所示:

 

../framework/LowPower/Interface/MKW36A

../framework/LowPower/Source/MKW36A

../framework/DCDC/Interface/MKW36A

../framework/XCVR/MKW36A4

 

 

shaozhongliangs_8-1636004065288.png

 

 

6- 在工具设置中选择MCU Assembler/General文件夹。 编辑与MKW36 MCU相关的路径。结果类似如下所示:

../framework/LowPower/Interface/MKW36A

../framework/LowPower/Source/MKW36A

../framework/DCDC/Interface/MKW36A

../framework/XCVR/MKW36A4

 

 

shaozhongliangs_9-1636004065365.png

 

 

7- 转到Project/Properties。展开MCU CCompiler/Preprocessor窗口。编辑“ CPU_MKW36Z512VHT4”和“ CPU_MKW36Z512VHT4_cm0plus”符号,分别将其重命名为“ CPU_MKW36A512VFT4”和“ CPU_MKW36A512VFT4_cm0plus”。保存更改。

shaozhongliangs_10-1636004065434.png

 

8- 转到工作区。删除位于CMSIS文件夹中的“ fsl_device_registersMKW36Z4MKW36Z4_featuressystem_MKW36Z4.hsystem_MKW36Z4.c”文件。然后解压缩MKW35Z SDK软件包并在以下路径中搜索“ fsl_device_registersMKW36A4MKW36A4_featuressystem_MKW36A4.hsystem_MKW36A4.c”文件并复制CMSIS文件夹中:

<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

 

shaozhongliangs_11-1636004065448.png

 

9-  位于路径<SDK_folder_root> /devices/MKW36A4/mcuxpresso/startup_mkw36a4.c中的“ startup_mkw36a4.c”覆盖” startup”文件夹中 startup_mkw36z4.c”。 您可以简单的将文件拖放到“startup”文件夹中,然后删除旧的文件

shaozhongliangs_12-1636004065465.png

 

10- 在CMSIS文件夹中打开“ fsl_device_registers.h”文件。在以下代码(文件的第18行)中添加“ definedCPU_MKW36A512VFT4)”:

/* * 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- 在bluetooth->host->config文件夹中打开“ ble_config.h”文件。在以下代码中添加“ definedCPU_MKW36A512VFT4)”(文件的第146行):

/* 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- 在source-> common文件夹中打开“ ble_controller_task.c”文件。在以下代码(文件的第272行)中添加“ definedCPU_MKW36A512VFT4)”:

#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-生成项目。

至此,该工程项目已经迁移完成

IAR Embedded Workbench IDE进行软件迁移

1- 打开位于以下路径的信标(Beacon)项目:

2- 在工作区中选择项目,然后按Alt + F7打开项目选项。

shaozhongliangs_13-1636004065498.png

 

3- 在General Options/Target 窗口中,单击设备名称旁边的图标,再选择适当的芯片NXP / KinetisKW / KW3x / NXP MKW36A512xxx4,然后单击“确定”按钮。

shaozhongliangs_14-1636004065531.png

 

4- 在以下路径中创建一个名为MKW36A的新文件夹:

<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

 

shaozhongliangs_15-1636004065541.png

 

5- 复制位于上述路径的MKW36Z文件夹内的所有文件,然后粘贴到MKW36A文件夹中。

shaozhongliangs_16-1636004065582.png

 

6- .在工作区中选择信标项目,然后按Alt + F7打开项目选项窗口。 在“ C/C++ Compiler/Preprocessor”窗口中,将所有路径里MKW36Z文件夹的重命名为MKW36A文件夹。在已定义的符号文本框中,将CPU_MKW36Z512VHT4宏重命名为CPU_MKW36A512VFT4。结果如下图所示:然后单击确定按钮。

$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

 

shaozhongliangs_17-1636004065617.png

 

7- 展开startup文件夹,选择所有文件,单击鼠标右键,然后选择“Remove”选项。在文件夹上单击鼠标右键,然后选择““Add/Add files”。添加位于以下路径的startup_MKW36A4.s

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

另外,将system_MKW36A4.csystem_MKW36A4.h添加到startup文件夹中。 这两个文件都位于以下路径:

<SDK_root>/devices/MKW36A4

shaozhongliangs_18-1636004065622.png

 

8- 在bluetooth->host->config文件夹中打开“ ble_config.h”文件。在以下代码中添加“ definedCPU_MKW36A512VFT4)”:

/* 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- 在source-> common文件夹中打开“ ble_controller_task.c”文件。在以下代码中添加“ definedCPU_MKW36A512VFT4)”:

#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-生成项目。

至此,该项目已经迁移完成

 

Attachments
No ratings
Version history
Last update:
‎11-03-2021 10:35 PM
Updated by: