How to find Kinetis Processor ID information

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to find Kinetis Processor ID information

ソリューションへジャンプ
2,590件の閲覧回数
myke_predko
Senior Contributor III

Gentlebeings,

I would have thought this is a simple question to find the answer to, but I can't in the datasheet/RM or the MQX documentation. 

I'm looking for a way to determine within my software what is the processor executing.  Ideally, I would like to get down to processor family (ie K20, K22) and Flash size. 

Is there a register in the Kinetis and (ideally) an MQX API that provides this information? 

I'm asking because I'm looking at a follow on products to the Jade Robot https://www.mimetics.ca and I would like some sure fire way of ensuring that different products (which will use different processors) can be identified. 

This question is also being asked in the MQX forum. 

Thanx,

myke

ラベル(1)
タグ(4)
0 件の賞賛
1 解決策
1,894件の閲覧回数
yasuhikokoumoto
Senior Contributor I

Hi myke,

according to the MK20DN512ZCAB10R, MK20DN512ZAB10R Reference Manual (which is the latest in K20 Sub-Family), the encoding of SIM_FCFG1 is changed. SIM_FCFG1[PFSIZE]=1111B means 'For devices without FlexNVM (SIM_FCFG2[PFLSH]=1): 512 KB of program flash memory, 16 KB protection region'. Therefore I guess SIM_FCFG1[NVMSIZE] and SIM_FCFG1[EESIZE] are no longer valid if SIM_FCFG1[PFSIZE]=1111B.  I'm sorry but I cannot see further more.

Best regards,
Yasuhiko Koumoto.

元の投稿で解決策を見る

0 件の賞賛
6 返答(返信)
1,894件の閲覧回数
larryc
Contributor II

Try this - from an example project I use...

void cpu_identify (void)

{

   /* Determine the Kinetis family ID */

   switch((SIM_SDID & 0x70)>>4)

  { 

case 0x0:

printf("\nK10-");

break;

case 0x1:

printf("\nK20-");

break;

case 0x2:

printf("\nK61-");

break;

case 0x4:

printf("\nK60-");

break;

case 0x5:

printf("\nK70-");

break;

default:

printf("\nUnrecognized Kinetis family device.\n"); 

break;

  }

   /* Determine the package size */

   switch((SIM_SDID & SIM_SDID_BOID(0xF))>>SIM_SDID_BOID_SHIFT)

  { 

  case 0x2:

  printf("32pin ");

  break;

  case 0x4:

  printf("48pin ");

  break;

  case 0x5:

  printf("64pin ");

  break;

  case 0x6:

  printf("80pin ");

  break;

  case 0x7:

  printf("81pin ");

  break;

  case 0x8:

  printf("100pin ");

  break;

  case 0x9:

  printf("104pin ");

  break;

  case 0xA:

  printf("144pin ");

  break;

  case 0xC:

  printf("196pin ");

  break;

  case 0xE:

  printf("256pin ");

  break;

default:

printf("\nUnrecognized Kinetis package code. "); 

break;

  } 

   /* Determine the revision ID */

   switch((SIM_SDID & SIM_SDID_REVID(0xF))>>SIM_SDID_REVID_SHIFT)

  {

  

   case 0x0:

  printf("Silicon rev 1.0 \n ");

  break;

   default:

printf("\nThis version of software doesn't recognize the revision code."); 

break

  }

  

   /* Determine the flash revision */

  flash_identify(); 

  

*/  

  

*/  

1,894件の閲覧回数
yasuhikokoumoto
Senior Contributor I

Hi Myke,

Is System Device Identification Register (SIM_SDID:4004_8024h) your wanted register? You will be able to distinguish the family by it. Regarding the flash size, you will find it in Flash Configuration Register 1 (SIM_FCFG1: 4004_804Ch). Can these help you?

Best regards,
Yasuhiko Koumoto.

1,894件の閲覧回数
myke_predko
Senior Contributor III

Hi Yasuhiko,

The Flash Size in SIM_FCFG1 doesn't make sense and doesn't match the datasheet. 

For my device, I'm using a MK20DN512VLL10 (K20, 512k Flash, 100MHz, 100pin LQFP).  The device and pin count comes back as expected, but the SIM_FCFG1 register returns: 0xFF020F00 when I would expect something like: 0x0D0F0F00. 

Any ideas for the discrepancy? 

Larry,

Thanx for the example code - the only thing that I wanted to ask was, why do you just check for a revision of 0 and say everything else is undefined?  When I look at SIM_SDID, I a revision code of 0b1100 (12d).  Any comments?

myke

0 件の賞賛
1,894件の閲覧回数
larryc
Contributor II

Myke:

I've used that code as part of a project but I'm not sure on why it was done that way - I just sort of trusted it worked.

It does appear to ID my chip correctly, but I use it more or less as a sign that the board has started ok, and not much else.

Larry

0 件の賞賛
1,895件の閲覧回数
yasuhikokoumoto
Senior Contributor I

Hi myke,

according to the MK20DN512ZCAB10R, MK20DN512ZAB10R Reference Manual (which is the latest in K20 Sub-Family), the encoding of SIM_FCFG1 is changed. SIM_FCFG1[PFSIZE]=1111B means 'For devices without FlexNVM (SIM_FCFG2[PFLSH]=1): 512 KB of program flash memory, 16 KB protection region'. Therefore I guess SIM_FCFG1[NVMSIZE] and SIM_FCFG1[EESIZE] are no longer valid if SIM_FCFG1[PFSIZE]=1111B.  I'm sorry but I cannot see further more.

Best regards,
Yasuhiko Koumoto.

0 件の賞賛
1,894件の閲覧回数
myke_predko
Senior Contributor III

Okay - thanx.  I'm going to ignore the Flash size information for now - the other information should be adequate for identifying the processor/product it's in.

Muchly appreciated,

myke

0 件の賞賛