AnsweredAssumed Answered

PORT_SetPinConfig for green LED on FRDM-K64F crashes

Question asked by Robert Baruch on Feb 11, 2016
Latest reply on Feb 13, 2016 by Robert Baruch

Installed KDS 3.1, and SDK 2.0 for the FRDM-K64F board. I wanted to light the red, green, and blue LEDs just to start. I added this code to BOARD_InitPins:

 

    // Initialize LED pins

    port_pin_config_t ledConfig = {

      .pullSelect = kPORT_PullDisable,

      .slewRate = kPORT_SlowSlewRate,

      .passiveFilterEnable = kPORT_PassiveFilterDisable,

      .openDrainEnable = kPORT_OpenDrainDisable,

      .driveStrength = kPORT_LowDriveStrength,

      .mux = kPORT_MuxAsGpio,

      .lockRegister = kPORT_UnlockRegister,

    };

 

    PORT_SetPinConfig(BOARD_LED_RED_GPIO_PORT, BOARD_LED_RED_GPIO_PIN, &ledConfig);

    PORT_SetPinConfig(BOARD_LED_GREEN_GPIO_PORT, BOARD_LED_GREEN_GPIO_PIN, &ledConfig);

    PORT_SetPinConfig(BOARD_LED_BLUE_GPIO_PORT, BOARD_LED_BLUE_GPIO_PIN, &ledConfig);

 

Then in main.c, I added:

 

  LED_RED_INIT(LOGIC_LED_ON);

  LED_GREEN_INIT(LOGIC_LED_ON);

  LED_BLUE_INIT(LOGIC_LED_ON);

 

I ran it in debug mode, and found that the PORT_SetPinConfig for the green LED crashed the board. Commenting out that line worked, although of course only the red and blue LEDs lit.

 

What's going on?

Outcomes