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 ?