Creating a New MQX RTOS 4.2 project in KDS

Document created by soledad Employee on Jul 8, 2015
Version 1Show Document
  • View in full screen mode

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.

 

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

 

 

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

 

 

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

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

 

 

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.

 

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

 

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.

 

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

 

 

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

2 people found this helpful

Attachments

    Outcomes