Creating a New MQX RTOS 4.2 project in KDS

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a New MQX RTOS 4.2 project in KDS

No ratings

Creating a New MQX RTOS 4.2 project in KDS

Hi everybody,

As there is not a New MQX 4.2 Project Wizard, it is necessary to create a project from scratch.

Here, we will create a new project making a copy from an example Project, for this example we are using FRDM-K64F120M but the process is similar for all the Freescale boards.

1. Import hello_frdmk64f example and just copy-paste it using Ctrl + C and Ctrl + V keys.

pastedImage_0.png

2. Delete the virtual folder to avoid editing the original file.

pastedImage_36.png

3. Create a New physical folder and named it Sources.

pastedImage_45.png

4. In Sources folder create a New Source file and name it main.c

pastedImage_0.png

5. Go to menu Project > Properties > C/C++ Build > Settings > Cross ARM GNU Assembler > Includes and delete all the paths.

pastedImage_71.png

6. Go to menu Project > Properties > C/C++ Build > Settings > Cross ARM C Compiler > Includes, delete all the paths and replace them with the following:

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\bsp\Generated_Code

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\bsp

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\psp

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\mfs

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\rtcs

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\shell

C:\Freescale\Freescale_MQX_4_2\usb_v2\<used_board>.kds\debug\usbh\mqx

${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/include

${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/include-fixed

${eclipse_home}../toolchain/arm-none-eabi/include

For the FRDM-K64F120M

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\bsp\Generated_Code

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\bsp

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\psp

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\mfs

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\rtcs

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\shell

C:\Freescale\Freescale_MQX_4_2\usb_v2\output\frdmk64f.kds\debug\usbh\mqx

${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/include

${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/include-fixed

${eclipse_home}../toolchain/arm-none-eabi/include

Note: You can use  Ctrl + C and Ctrl + V keys.

pastedImage_85.png

7. Go to menu Project > Properties > C/C++ Build > Settings > Cross ARM C Linker > General and replace the linker file path with the following

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\bsp\intflash.ld

For the FRDM-K64F120M

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\bsp\intflash.ld

  pastedImage_106.png

8. Go to menu Project > Properties > C/C++ Build > Settings > Cross ARM C Linker > Miscellaneous and replace all Other objects with the following:

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\bsp\bsp.a

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\psp\psp.a

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\mfs\mfs.a

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\rtcs\rtcs.a

C:\Freescale\Freescale_MQX_4_2\lib\<used_board>.kds\debug\shell\shell.a

C:\Freescale\Freescale_MQX_4_2\usb_v2\output\<used_board>.kds\debug\usbh\mqx\libusbh_mqx.a

${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/armv7e-m/fpu/libgcc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libsupc++.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libm.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libnosys.a

For the FRDM-K64F120M

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\psp\psp.a

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\mfs\mfs.a

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\rtcs\rtcs.a

C:\Freescale\Freescale_MQX_4_2\lib\frdmk64f.kds\debug\shell\shell.a

C:\Freescale\Freescale_MQX_4_2\usb_v2\output\frdmk64f.kds\debug\usbh\mqx\libusbh_mqx.a

${eclipse_home}../toolchain/lib/gcc/arm-none-eabi/4.8.4/armv7e-m/fpu/libgcc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libc.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libsupc++.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libm.a

${eclipse_home}../toolchain/arm-none-eabi/lib/armv7e-m/fpu/libnosys.a

9. Click to Apply and Ok buttons.

pastedImage_119.png

10. Go to C:\Freescale\Freescale_MQX_4_2\mqx\examples\hello and copy all the content in hello.c to main.c in your project

pastedImage_145.png

11. At this point you can be able to build and debug your New project. Enjoy...

Comments

There is no C:\Freescale\Freescale_MQX_4_2\lib\. What can i do? Also, i cant make TWR-K70* project in KDS because it is not supported, so which project do i have to copy?

Hello Martin,

First, you need to build the MQX libraries using KDS. Please find more information about Building MQX RTOS library and application project files in the

Getting Started with Kinetis Design Studio IDE and Freescale MQX™ RTOS document, this is located at the path: C:\Freescale\Freescale_MQX_4_2\doc\tools\kds

KDS supports k70 devices. Please import some mqx example located at the path: C:\Freescale\Freescale_MQX_4_2\mqx\examples

For example: C:\Freescale\Freescale_MQX_4_2\mqx\examples\hello\build\kds\hello_twrk70f120m

regards

Sol

Hello. After doing this and then building my project, I was not able to debug my application. When I selected 'Debug Configurations', my new copied project did not show up in the list. I am using the PEMicro debugging tools and am looking for my project's debug configuration under the 'GDB PEMicro Interface Debugging' section. Do you have any suggestions to fix this?

Thanks!

Could you please add a screenshot?

Regards

Sol

I am confused about something. I am a long time developer using Codewarrior 10.7 and MQX4.2 on MCF52259, however, new to the KDSIDE and Kinetis KL27.

Should I be using KDSIDE? or 10.7? Should I be using MQX from C:\Freescale\KSDK_1.3.0\rtos\mqx or direct from C:\Freescale\Freescale_MQX_4_2? There is no KL27 in MQX4.2...?

With the KDSIDE installation it appears there is its own version of mqx (in full or in part) C:\Freescale\KSDK_1.3.0\rtos\mqx\mqx\source as usually MQX source (at least with CW10.7 is C:\Freescale\Freescale_MQX_4_2\mqx\source? Can you explain the relationship here? Why is my board missing? are these lib's linked in some way?

I was trying to create a new "Hello Lite" project, I had built MQX in KDSIDE, but the above example reference MQX4.2 itself, not the KDS mqx... Looking at the link above the lite example is not part of MQX4.2 directory, only KDS rtos... There is also no KL27 example at all in MQX examples, again, only in KDS... 

Hello Carl,

Unfortunately MQX 4.2 doesn't support KLxx devices and CodeWarrior doesn't support KSDK. If you want to use KL27 devices I suggest you to use MQX for KSDK or FreeRTOS and KDS IDE.

Have a nice day!

Regards

Soledad

Thanks... But how do I now go about making projects myself? there is no option? What are the differences between the two MQX versions? (what will i lose, what version is it?)

MQX Software Solutions are available in three variants to meet your embedded design needs: traditional MQX RTOS; MQX Lite; and MQX RTOS for Kinetis SDK (MQX for KSDK).

MQX RTOS for Kinetis SDK

MQX RTOS for Kinetis SDK is the latest evolution of the proven and professionally developed  MQX™ Software Solutions for Kinetis MCUs. It is built on top of the software development kit (SDK) for Kinetis MCUs, leveraging the flexible and extendable peripheral drivers found within the SDK. MQX Lite configuration option is now available for enhanced scalability, allowing developers the option to use the same light weight kernel API found within MQX Lite RTOS.

MQX RTOS            

MQX™ RTOS a full-featured complimentary real-time operating system including the MQX™ Kernel, TCP/IP stack (RTCS), embedded MS-DOS file system (MFS), USB host/device stack, and more. The MQX™ multitasking kernel provides pre-emptive scheduling, fast interrupt response, extensive inter-process communication and synchronization facilities. MQX RTOS includes its own peripheral drivers.

MQX Lite RTOS

 MQX™ Lite RTOS is a very light MQX™ kernel for resource-limited MCUs. Initially developed for the Kinetis L series family, it allows applications to run with less than 4 KB RAM. It is a true subset of the proven and professionally developed  MQX™ Software Solutions, allowing for easy upward code migration. It is easily configurable within Processor Expert Software to be used with the tool chain of your choice.

Please check the following document, this describes what is different in MQX for KSDK.

http://cache.freescale.com/files/soft_dev_tools/doc/support_info/MQXKSDKPUG.pdf 

In addition please check the below document, this is a guide that explains 2 different ways in order to create a New MQX for KSDK project in KDS

https://community.nxp.com/docs/DOC-103405 

I hope this helps  :smileywink:

Thank you, that does clear up the differences.

However, the link you provided is confusing and jumps around a lot with looping references.

Can you point me to the exact documentation required to create my own hello world MQX lite and hello world MQX (standard) C project? The link you provided only has a C++ base board MQX project as far as I can find(and im not using C++).

For MQX-Lite: http://cache.freescale.com/files/32bit/doc/app_note/AN4610.pdf 

Remember that MQX doesn't support  KL27 devices so you need to use MQX for KSDK.

Please check the attachment in How To: Create a New MQX RTOS for KSDK Project in KDS 

Regards

HI Solead,

Sorry, I must be confusing the issue here.

I want to use the KSDK IDE and create my own C application using the KSDK MQX RTOS version (not codewarrior, not FSLMQX 4.2.2)

What you have provided (again) is normal MQX and Codewarrior (which I am using neither of), and the KSDK C++ project, which I am not using C++.

How do I create my own C code MQX RTOS for KSDK (NOT C++)

How do I create my own C code MQX Lite for KSDK (Not CW, Not MQX full version, not C++).

There are examples for the two above requests, but,t here is no way to create your OWN project.

Thanks.

G'day. I imported the files and changed the main but when I recompile the ELF file stays the same.
Am I missing something here?s

Edit : Disregard comment!

Version history
Revision #:
1 of 1
Last update:
‎07-08-2015 12:16 PM
Updated by: