What/Where is the possible replacement in code statements for Kinetis controllers which are not supported in PORT_PDD.h which

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

What/Where is the possible replacement in code statements for Kinetis controllers which are not supported in PORT_PDD.h which

ソリューションへジャンプ
2,173件の閲覧回数
ganeshramachand
Contributor IV

Let me explain my doubt specifically and clearly.

I am using MKE02Z64VLD2 controller

My IDE is : Kinetis Design Studio 2.0

static bool BL_CheckBootloaderMode(void) {   /* let's check if the user presses the BTLD switch. Need to configure the pin first */   /* PTB1 as input */   /* clock all port pins */   SIM_SCGC5   |= SIM_SCGC5_PORTA_MASK |              SIM_SCGC5_PORTB_MASK |              SIM_SCGC5_PORTC_MASK |              SIM_SCGC5_PORTD_MASK |              SIM_SCGC5_PORTE_MASK;   /* Configure pin as input */ #if 0   /* GPIOB_PDDR: PDD&=~0x0100 */   GPIOB_PDDR = (uint32_t)((GPIOB_PDDR & (uint32_t)~0x0100UL) | (uint32_t)0x00UL);   /* Initialization of Port Control register */   /* PORTB_PCR1: ISF=0,MUX=1 */   PORTB_PCR1 = (uint32_t)((PORTB_PCR1 & (uint32_t)~0x01000600UL) | (uint32_t)0x0100UL); #else   (void)BitIoLdd3_Init(NULL); /* initialize the port pin PTB1 */   /* enable internal pull-up on PTB1 */   PORT_PDD_SetPinPullSelect(PORTB_BASE_PTR, 1, PORT_PDD_PULL_UP);   PORT_PDD_SetPinPullEnable(PORTB_BASE_PTR, 1, PORT_PDD_PULL_ENABLE);   WAIT1_Waitms(5); /* wait get pull-up a chance to pull-up */ #endif   if (!BL_SW_GetVal()) { /* button pressed (has pull-up!) */     WAIT1_Waitms(50); /* wait to debounce */     if (!BL_SW_GetVal()) { /* still pressed */       return TRUE; /* go into bootloader mode */     }   }   /* BTLD switch not pressed, and we have a valid user application vector */   return FALSE; /* do not enter bootloader mode */ }

 

When I build the code.. I got errors saying

FOR LINES 5 TO 9:

Quote:

Multiple markers at this line
- 'SIM_SCGC5' undeclared (first use in this function)
- 'SIM_SCGC5_PORTA_MASK' undeclared (first use in this
function)
- 'SIM_SCGC5_PORTB_MASK' undeclared (first use in this
function)
- 'SIM_SCGC5_PORTC_MASK' undeclared (first use in this
function)
- 'SIM_SCGC5_PORTD_MASK' undeclared (first use in this
function)
- 'SIM_SCGC5_PORTE_MASK' undeclared (first use in this
function)

FOR LINE 20:

Quote:

Multiple markers at this line
- 'PORTB_BASE_PTR' undeclared (first use in this
function)

FOR LINE 21:

Quote:

Multiple markers at this line
- in expansion of macro 'PORT_PDD_SetPinPullEnable'
- implicit declaration of function 'PORT_PCR_REG' [-Wimplicit-function-
declaration]

WHEN I CHECKED In KDS, Project Explorer -> Static_Code -> PDD -> PORT_PDD.h

I found that, the PORT_PDD.h supports only following KE series controllers.

 

!defined(MCU_MKE02Z2) /* PORT */ && \

!defined(MCU_MKE02Z4) /* PORT */ && \

!defined(MCU_SKEAZN642) /* PORT */ && \

!defined(MCU_MKE04Z1284) /* PORT */ && \

!defined(MCU_MKE04Z4) /* PORT */ && \

It says,

#error encountered with text: PORT PDD library: No derivative is active. Place proper #include with PDD memory map before including PDD library.

To felicitate the above said operation (Clock all the port pins, Configure Port B pin 1 (PTB1) as input, initialize the port pin PTB1, enable internal pull-up on PTB1, rest are common Wait statements) in MKE02Z64VLD2 what should I do ?

ラベル(1)
0 件の賞賛
返信
1 解決策
1,590件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Ganesh,

The FRDM-KE02Z development board product page has much content (good news).

Freedom Development Platform for Kinetis KE02|NXP 

The bad news is the example FRDM-KEXX Driver Library Package does not support KDS.

The good news is a NXP FAE ported it to KDS and here that is.

Here’s the link to the updated driver package with KDS support for all the example projects

  https://community.freescale.com/docs/DOC-329476

Regards,

David

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
1,590件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Ganesh,

The code base will help you but if you can get a Freedom board to that makes support much easier meaning if you have an issue on your product and can port and verify with Freedom, we can help more fully.

Plus having Freedom lets you run all the example code to learn it well before trying in your product.

Regards,

David

1,591件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Ganesh,

The FRDM-KE02Z development board product page has much content (good news).

Freedom Development Platform for Kinetis KE02|NXP 

The bad news is the example FRDM-KEXX Driver Library Package does not support KDS.

The good news is a NXP FAE ported it to KDS and here that is.

Here’s the link to the updated driver package with KDS support for all the example projects

  https://community.freescale.com/docs/DOC-329476

Regards,

David

0 件の賞賛
返信
1,590件の閲覧回数
ganeshramachand
Contributor IV

Hi David,

Thanks for both good news and bad news. And I am not using a freedom board, its a custom designed board. Anyways I hope your answer helps.

Thanks

0 件の賞賛
返信
1,590件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Ganesh,

The Kinetis KE family does not have clock gating for the GPIO module.  It uses the System Clock.

If you look at the KE02 Reference Manual SIM->SCGC register you will see no clock enable bit for GPIO.

The Kinetis K&L families have clock gating to GPIO as FYI.

Did you generate the code or copy it from some other example? 

Regards,

David

0 件の賞賛
返信
1,590件の閲覧回数
ganeshramachand
Contributor IV

Hi David,

I just copied the code written for KL-25Z and tried to modify it to my KE-02Z. But couldnt succeed. Do you have any possible suggestion ?

Thanks

0 件の賞賛
返信