Porting from MQX 4.1.0 to MQX for KSDK/KDS (MQX 5.0.1)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Porting from MQX 4.1.0 to MQX for KSDK/KDS (MQX 5.0.1)

1,711 次查看
nickerb
Contributor I

We're looking to port our MQX 4.1.0 currently compiling with IAR to the new KDS/KSDK package for ease of development.  I notice, however, the architecture of the new MQX project is quite different than the architecture of 4.1.0.  As an example, I've attached an image detailing one area in which MQX for KSDK appears quite different than 4.1.0.  Is there an established method by which to port a 4.1.0 project to the new MQX architecture?  It seems that the majority of project creation in the KSDK is done automatically for Freescale boards, and while we are using a Freescale MK60DX256ZVLL10, we are not using the TWR-K60D100.  We are using our own PCB, thus it would be super if we could retain our current header files and not have to break them down or re-pin everything in the code.

Thanks!

Nick

Images are attached:

0 项奖励
回复
3 回复数

770 次查看
Carlos_Musich
NXP Employee
NXP Employee

Hi Nick,

We are now working in a document explaining general steps required, unfortunately is not ready yet. There is not a general step by step guide but in general this is the information you need.

1) The project compiler settings need to be updated for the application to work with Kinetis SDK.  These changes consist of the include paths to find the header files, and some preprocessor definitions.

Before any change, all necessary libraries must be built and the corresponding library files (*.a) are created. The paths containing the libraries source code and the output (*.a) files are next.

MQX RTOS for KSDK Platform Lib

${KSDK_PATH}/lib/ksdk_mqx_lib/kds/K64F12

${KSDK_PATH}/lib/ksdk_mqx_lib/kds/K64F12/Debug/libksdk_platform_mqx.a

MQX Lib

${KSDK_PATH}/rtos/mqx/mqx/build/kds/mqx_frdmk64f

${KSDK_PATH}/rtos/mqx/lib/frdmk64f.kds/debug/mqx/lib_mqx.a

MQX stdlib

${KSDK_PATH}/rtos/mqx/mqx_stdlib/build/kds/mqx_stdlib_frdmk64f

${KSDK_PATH}/rtos/mqx/lib/frdmk64f.kds/debug/mqx_stdlib/lib_mqx_stdlib.a

MQX nShell Lib

${KSDK_PATH}/rtos/mqx/nshell/build/kds/nshell_frdmk64f

${KSDK_PATH}/rtos/mqx/lib/frdmk64f.kds/debug/nshell/lib_nshell.a

MFS File System

${KSDK_PATH}/filesystem/mfs/build/kds/mfs_frdmk64f

${KSDK_PATH}/filesystem/mfs/lib/frdmk64f.kds/debug/mfs/lib_mfs.a

RTCS

${KSDK_PATH}/tcpip/rtcs/build/kds/rtcs_frdmk64f

${KSDK_PATH}/tcpip/rtcs/lib/frdmk64f.kds/debug/rtcs/lib_rtcs.a

USB Host Lib

${KSDK_PATH}/usb/usb_core/host/build/kds/usbh_sdk_frdmk64f_mqx

${KSDK_PATH}/usb/usb_core/host/build/kds/usbh_sdk_frdmk64f_mqx/Debug/libusbh_mqx.a

The existing MQX RTOS header file directories have moved due to the new KDSK folder structure, also the board naming convention in the library paths have changed.  For example classic MQX RTOS used \lib\frdmk64f.kds, while MQX RTOS for Kinetis SDK uses \lib\frdmk64f120m.kds.

Go to menu Project > Properties C/C++ Build > Settings > Cross ARM C Compiler > Includes > Include paths (-I) and change the compiler include paths of the classic MQX RTOS directories and add the Include paths of the libraries with the Kinetis SDK directory structure.

Library

Classic MQX RTOS

MQX RTOS for Kinetis SDK

BSP

\lib\<board>.<tool>\debug\bsp

\lib\<board>.<tool>\debug\bsp\Generated_Code

\lib\<board>.<tool>\debug\bsp\Sources

“${KSDK_PATH}/rtos/mqx/mqx/source/bsp”

PSP

\lib\<board>.<tool>\debug\psp

“${KSDK_PATH}/rtos/mqx/lib/<board>.<tool>/debug/mqx”

“${KSDK_PATH}/rtos/mqx/mqx/source/include”

Shell

\lib\<board>.<tool>\debug\shell

“${KSDK_PATH}/rtos/mqx/lib/<board>.<tool>/debug/nshell

MFS

\lib\<board>.<tool>\debug\mfs

“${KSDK_PATH}/filesystem/mfs/lib/<board>.<tool>/debug/mfs

RTCS

\lib\<board>.<tool>\debug\rtcs

“${KSDK_PATH}/tcpip/rtcs/lib/<board>.<tool>/debug/rtcs

"${KSDK_PATH}/platform/drivers/src/enet"

USB

\lib\<board>.<tool>\debug\usb\

“${KSDK_PATH}/usb/usb_core/include”

“${KSDK_PATH}/usb/usb_core/host/include”

“${KSDK_PATH}/usb/usb_core/host/include/<board>”

“${KSDK_PATH}/usb/usb_core/host/sources/classes/<class>”

“${KSDK_PATH}/usb/adapter/sources”

"${KSDK_PATH}/usb/adapter/sources/sdk"

"${KSDK_PATH}/usb/usb_core/host/sources/classes/hub"

Config

\config\<board>

“${KSDK_PATH}/rtos/mqx/lib/<board>.<tool>/debug/config”

Other

\lib\<board>.<tool>\debug

“${KSDK_PATH}/platform/osa/inc”

“${KSDK_PATH}/platform/drivers/inc”

“${KSDK_PATH}/platform/system/inc”

“${KSDK_PATH}/platform/hal/inc”                     

"${KSDK_PATH}/platform/CMSIS/Include"

"${KSDK_PATH}/platform/CMSIS/Include/device"

"${KSDK_PATH}/platform/CMSIS/Include/device/MK64F12"

"${KSDK_PATH}/platform/startup"

"${KSDK_PATH}/platform/startup/MK64F12"

"${KSDK_PATH}/platform/startup/MK64F12/gcc"

2) The existing MQX RTOS libraries have moved to new directories and been renamed.  In the table below are the new locations to add and their equivalent in MQX classic. Go to menu Project > Properties C/C++ Build > Settings > Cross ARM C++ Linker > Libraries and add the libraries names (without lib prefix and without .a extension) in Libraries (-l) and then in Miscellaneous add the library name with the whole path. Refer to Figure 6 and Figure 7.

Library

Classic MQX RTOS

MQX RTOS for Kinetis SDK

Platform (BSP)

/lib/<board>.<tool>/debug/bsp/bsp.a

“${KSDK_PATH}/lib/ksdk_mqx_lib/kds/<derivative>/Debug/libksdk_platform_mqx.a

STDIO

N/A

“${KSDK_PATH}/rtos/mqx/lib/<board>.<tool>/debug/mqx_stdlib/lib_mqx_stdlib.a

PSP

/lib/<board>.<tool>/debug/psp/psp.a

“${KSDK_PATH}/rtos/mqx/lib/<board>.<tool>/debug/mqx/lib_mqx.a”

Shell

/lib/<board>.<tool>/debug/shell/shell.a

“${KSDK_PATH}/rtos/mqx/lib/<board>.<tool>/debug/nshell/lib_nshell.a

MFS

/lib/<board>.<tool>/debug/mfs/mfs.a

“${KSDK_PATH}/filesystem/mfs/lib/<board>.<tool>/debug/mfs/lib_mfs.a

RTCS

/lib/<board>.<tool>/debug/rtcs/rtcs.a

“${KSDK_PATH}/tcpip/rtcs/lib/<board>.<tool>/debug/rtcs/lib_rtcs.a

USB

/lib/<board>.<tool>/debug/usb/usbh.a

“${KSDK_PATH}/usb/usb_core/host/build/kds/usbh_sdk_<board>_mqx/Debug/libusbh_mqx.a”

3) It is necessary to switch to the KSDK drivers instead the classic MQX drivers.

4) Finally compare the project settings of an example project with your project.

I will let you know when the porting guide is available. Meanwhile you can also take a look to the following document How To: Create a New MQX RTOS for KSDK Project in KDS

Best regards,

Carlos Musich

Technical Support Engineer

0 项奖励
回复

770 次查看
nickerb
Contributor I

Thanks for this!  I'll go through and see how it all comes together in the next few days.

Thanks,

Nick

0 项奖励
回复

770 次查看
Carlos_Musich
NXP Employee
NXP Employee
0 项奖励
回复