BSP/PSP for K10 MK10FX512VMD12

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

BSP/PSP for K10 MK10FX512VMD12

Jump to solution
2,385 Views
markmcmillen
Contributor II

I have a nice little prototype up and running on theTWR-K60N512 eval board but now our custom board is ready and they want code up and running on it yesterday (naturally).   I tried following AN4287 "MQX Board Support Package Porting Guide" and ended up with 1351 compiler errors most of which are variations on:


Description    Resource    Path    Location    Type

identifier 'ADC_MemMapPtr' redeclared was declared as: 'volatile struct ADC_MemMap *' now declared as: 'volatile struct  *' (included from:        C:\Program Files\Freescale\Freescale MQX 3.8\mqx\build\cw10\bsp_pk61FX512\Generated_Code\MQX1.h:40        C:\Program Files\Freescale\Freescale MQX 3.8\mqx\build\cw10\bsp_pk61FX512\Generated_Code\PE_LDD.h:2174        C:\Program Files\Freescale\Freescale MQX 3.8\mqx\source\bsp\pk61FX512\bsp.h:38        C:\Program Files\Freescale\Freescale MQX 3.8\mqx\source\bsp\pk61FX512\bsp_cm.c:38)    IO_Map.h    /bsp_pk61FX512/Generated_Code    line 285    C/C++ Problem

The porting guide seems to assume you are porting your code from the eval board to a custom board which uses the same micro.  We are switching micros from K60 to K10.  Is anybody working on a new app note for this situation?

I am using CW 10.2  (Build Id:120126 with CodeWarrior MQX 3.8 Plug-ins 1.1.6.201207171328 ;  CodeWarrior MQX Plug-ins  1.1.8.201207171328) and MQX 3.8.1

Is there a bsp for the K10 hiding somewhere on the freescale website I can download? Or has anyone already built a BSP/PSP package on their own for the K10 - any K10??  Any help would be appreciated.  Thanks!


Tags (4)
0 Kudos
1 Solution
1,105 Views
c0170
Senior Contributor III

Hello Mark,

your provided header seems to be correct for your MCU. As I remember somebody here on the forum created bsp for custom K10 board.

Regards,

MartinK

View solution in original post

0 Kudos
8 Replies
1,105 Views
DavidS
NXP Employee
NXP Employee

Hi Mark,

Let me try taking a stab at answering this question.

First MQX has many BSP's but too difficult to support each Kinetis device (i.e. too expensive to have a hardware platform for each device).  Of the many BSP's we try to support the "super set" devices and then have customer either port that super set device to their choosening or just use the super set device and realize that some of the peripherals are not present for their product.

For your specific case the K20 is a super set device.  The K10 is just lacking the USB interface and features.  If you port the TWR-K20D50M BSP using the document you pointed out (here it is for others: C:\Freescale\Freescale MQX 3.8\doc\FSL_MQX_porting_guide.pdf) this should provide a good start for changing the device.

From my research (so not tested as fyi) the device is specified in the user_config.h header.

Ex: #define MQX_CPU                 PSP_CPU_MK20D50M

The "PSP_CPU_MK20D50M" is used in the PSP "kinetis.h" header to find the correct device header that defines the peripherals and proper mapping to the pins ultimately.

Ex: #elif   (MQX_CPU == PSP_CPU_MK20D50M)

    #include "MK20D5.h"

The MK20D5.h header is in the same directory as the kinetis.h ( C:\Freescale\Freescale MQX 3.8\mqx\source\psp\cortex )

Now this folder/directory contains the headers of the supported MQX devices.  With MQX3.8.1 we have been using the header files generated from Processor Expert (PE) for the devices.

If you have CW10.2 or PExDrv v10.0 installed, then you can find the cache of all the supported devices.

Ex:  C:\Freescale\CW MCU v10.2\MCU\ProcessorExpert\lib\Kinetis\iofiles

Ex:  C:\Freescale\PExDrv v10.0\eclipse\ProcessorExpert\lib\Kinetis\iofiles

From either of these folders you can then select (copy it to the ~mqx\source\psp\cortex path)) the MK10D5.h and have it included in your updated BSP/PSP by updating your "kinetis.h" to have a #elif for your PSP_CPU_<custom_MK10D5>.

Hopefully this will help.  If not yell back and we'll amend this post.

Regards,

David

1,105 Views
markmcmillen
Contributor II

Hi David,

Thank you very much for answering.  Just a couple things I would like to ask about before I make another attempt at creating a custom BSP for the MK10FX512VMD12.

I do have CW 10.2 installed.  When I look in C:\Freescale\CW MCU v10.2\MCU\ProcessorExpert\lib\Kinetis\iofiles

I see 3 different "K10" header files:

MK10D5.h

MK10DZ10.h

MK10F12.h

If I am reading the shorthand correctly it would seem that the header file closest to the MK10FX512VMD12 would be the

MK10F12.h file.

Indeed the comments at the beginning of the MK10F12.h header file say:

** Reference manual:K10P144M120SF3RM, Rev. 1, Oct 2011

Which is the "K10 Sub-Family Reference Manual"  which

"Supports: MK10FX512VLQ12, MK10FN1M0VLQ12,

MK10FX512VMD12, MK10FN1M0VMD12"

So I reckon I should use this header, correct?

The only other little thing is the path you specified to the porting guide (here it is for others: C:\Freescale\Freescale MQX 3.8\doc\FSL_MQX_porting_guide.pdf)  is "Instructions how to port old MQX projects to Freescale MQX™ RTOS version 3.7.0 and later"  whereas the AN4287 is a different animal entirely.

Well I'm off to try the bsp port again.  I will post again to report on my progress and any problems I run into.  It would be great if AN4287 could be updated for MQX 3.8.1  (currently it assumes MQX 3.7).

Best Regards,


Mark

1,106 Views
c0170
Senior Contributor III

Hello Mark,

your provided header seems to be correct for your MCU. As I remember somebody here on the forum created bsp for custom K10 board.

Regards,

MartinK

0 Kudos
1,105 Views
markmcmillen
Contributor II

Thanks Martin.  But from what I have been able to find from searching the forums people have tried and spent weeks with no success in porting a BSP/PSP for custom K10 boards.  If someone has done this it would be fantastic if they could post it somewhere or point me to it!

Right now I am down to one error on the BSP.  Haven't tried the PSP yet.

The error I get is:

undefined identifier '__FLASHX_START_ADDR'

line 38 init_flashx.c

I find __FLASHX_START_ADDR #defined in twrk20d50m.h (which I renamed in my new BSP, of course) but it is

defined only for the "keil compiler":

#ifdef __CC_ARM

...

...

...

#define __FLASHX_START_ADDR0x00018000

...

#else

...

...

extern const uchar __FLASHX_START_ADDR[];

...

#endif

Apparently __CC_ARM is not defined so it is looking for some external definition of __FLASHX_START_ADDR and not finding it.  Should __CC_ARM be defined somewhere?  Where?

0 Kudos
1,105 Views
DavidS
NXP Employee
NXP Employee

Hi Mark,

Martin and I are ping ponging the replies!

For CW10.2 you will find the "__FLASHX_START_ADDR" defined in the linker file at bottom.

It will lok something like:

    _flashx_start = __COPY_OF_DATA + SIZEOF(.main_application_data) + SIZEOF(.romp);

    # flashx working area spans across the whole rest of Flash memory

    __FLASHX_START_ADDR = ((_flashx_start + __FLASHX_SECT_SIZE - 1) / __FLASHX_SECT_SIZE) * __FLASHX_SECT_SIZE;

    __FLASHX_END_ADDR = __INTERNAL_FLASH_BASE + __INTERNAL_FLASH_SIZE;

Regards,

David

0 Kudos
1,105 Views
markmcmillen
Contributor II

Hi David,

Yes I saw that and was able to get rid of that one.  I forgot to go into ProcessorExper.pe and change the CPU to MK10FX512VMD12.

Next problem I had was IO_Map.h failed the "Check if another memory map has not been also included" test.  Got rid of that by guessing that the "Mandatory CPU indentification" #define in user_config.h should be changed to

/* mandatory CPU identification */

#define MQX_CPU                 MCU_MK10F12

UPDATE:  this should actually be PSP_CPU_MK10F12

Now my only errors are:

"undefined identifier 'PSP_INTERRUPT_TABLE_INDEX'"

on rtc.h line 58

and some "undefined identifier 'SIM_SCGC4_I2C0_MASK'" etc. errors in init_gpio.c

I will give it some more work and see.  I guess at some point I need to port the psp project too?  So far I have just been trying to get my new BSP project to compile by itself.

Mark



0 Kudos
1,105 Views
StRob
Contributor III

Hi, I´m just curious to hear if you are making any progress?

We will soon face the same problem, K10 and a custom board.

0 Kudos
1,105 Views
Thad
Contributor III

Consider me on the list of people interested in any progress made on an actual K10 BSP.  Has anyone posted any reference code demonstrating their success?  I'm also currently working on a project porting from a K60 eval board to a K10 custom board, and I feel I am probably reinventing the wheel.

0 Kudos