Hi
I am using the IAR IDE using KSDK V2.0 and FRDM-KL27Z board, just modify below code could generate using PTD1 pin to control the LED(PTB18):
<board.h>
#define BOARD_SW3_GPIO GPIOD
#define BOARD_SW3_PORT PORTD
#define BOARD_SW3_GPIO_PIN 1U
#define BOARD_SW3_IRQ PORTB_PORTC_PORTD_PORTE_IRQn
#define BOARD_SW3_IRQ_HANDLER PORTBCDE_IRQHandler
#define BOARD_SW3_NAME "SW3"
<pin_mux.c>
/* Enable gpio port clock */
//CLOCK_EnableClock(kCLOCK_PortC);
CLOCK_EnableClock(kCLOCK_PortD);
/* Affects PORTC_PCR1 register */
port_pin_config_t config = {0};
config.pullSelect = kPORT_PullUp;
config.mux = kPORT_MuxAsGpio;
//PORT_SetPinConfig(PORTC, 1U, &config);
PORT_SetPinConfig(PORTD, 1U, &config);
With above modification, I could using PTD1 pin control the LED.
I checked your code related place is same, while, I am not sure if you have modify the other places.
Could you using the KSDK V2.0 gpio demo [input_interrupt] re-generate related code and check if it works or not.
Wish it helps.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------