Creating MQX 4.0 BSP for K10

Document created by Martin Latal Employee on Mar 14, 2013Last modified by Monica Arvizu on Mar 14, 2013
Version 1Show Document
  • View in full screen mode

Sharing notes taken during creation of MQX 4.0 K10 BSP.


These particular notes are for 72 MHz version of K10 (part number K10DX128VLL7), so the baseline BSP for this is twrk20d72m, tested with CodeWarrior IDE. (I believe analogous steps could be taken for other K10 versions as well, just need to select appropriate baseline BSP.)


For the K10 BSP, we need to remove USB related code (as there is no USB module on K10) and add #elif into some *mk20.c files such as adc_mk20.c and spi_mk20.c.


     1. Add a new unique CPU ID into c:\Freescale\Freescale_MQX_4_0\mqx\source\psp\cortex_m\psp_cpudef.h. For example:




     2. Copy processor header file MK10D7.h from c:\Freescale\CW MCU v10.3\MCU\ProcessorExpert\lib\Kinetis\iofiles\MK10D7.h to c:\Freescale\Freescale_MQX_4_0\mqx\source\psp\cortex_m\cpu\mk10d7.h


     3. In the header file: c:\Freescale\Freescale_MQX_4_0\mqx\source\psp\cortex_m\kinetis.h add #include "MK10D7.h" for your processor. For example:


#elif   (MQX_CPU == PSP_CPU_MK10DX128)
   #include "MK10D7.h"


     4. Use BSP clone tool to clone baseline BSP (twrk20d72m) into a new BSP with a new name such as "board_k10d72m".


     5. In user_config.h of the new BSP, c:\Freescale\Freescale_MQX_4_0\config\board_k10d72m\user_config.h change MQX_CPU as it follows:


#define MQX_CPU                 PSP_CPU_MK10DX128


     6. PSP builds OK. From BSP, we need to remove USB related code in init_gpio.c comment lines 609 and 612 c:\Freescale\Freescale_MQX_4_0\mqx\source\bsp\board_k10d72m\init_gpio.c:




     7. In CW IDE, remove USB source code from "bsp_board_k10d72m" build project under "Peripheral IO Drivers".

Remove complete "usb" virtual folder from the BSP build project. Remove "init_usb.c" from "board_k10d72m BSP Files"


     8. In BSP source file "spi_mk20.c" c:\Freescale\Freescale_MQX_4_0\mqx\source\io\spi\spi_mk20.c add #elif for k10:


#elif (MQX_CPU == PSP_CPU_MK10DX128)
static const pointer dspi_address[] =


static const uint_32 /*PSP_INTERRUPT_TABLE_INDEX*/ dspi_vectors[][1] =
   { INT_SPI0 },
   { INT_SPI1 },


     9. Similar change need to adc_mk20.c c:\Freescale\Freescale_MQX_4_0\mqx\source\io\adc\kadc\adc_mk20.c:


#elif (MQX_CPU == PSP_CPU_MK10DX128)
static const pointer adc_address[] = {


     10. BSP project builds OK.


     11. MFS, RTCS, SHELL projects build OK.


     12. If you wish to build an MQX application with this new BSP, don't forget to change the paths to MQX libs and include files in your application project:


C compiler "-i" option:

  (for Debug build configuration)









Linker additional libraries:

  psp.a, bsp.a, mfs.a, rtcs.a, shell.a


Linker Library search paths:







Path to linker command file: