SDK2.0(MK60DX256VLQ10): configuring PORTA pins as ethernet pins causing Hard Fault

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SDK2.0(MK60DX256VLQ10): configuring PORTA pins as ethernet pins causing Hard Fault

703 Views
alexpimenov
Contributor I

I'm trying to configure ethernet pins  and gpio pin on PORTA. Any of the PORT_SetPinMux(PORTA, ..) calls will generate Hard Fault ( see code below). Any idea why it's happening?

 

PORT_SetPinMux(PORTA, PIN6_IDX, kPORT_MuxAsGpio);          /* PORTA6 (pin 58) is configured as PTA6 */

PORT_SetPinMux(PORTA, PIN5_IDX, kPORT_MuxAlt4);            /* PORTA5 (pin 55) is configured as MII0_RXER */

PORT_SetPinMux(PORTA, PIN9_IDX, kPORT_MuxAlt4);            /* PORTA9 (pin 61) is configured as MII0_RXD3 */

  PORT_SetPinMux(PORTA, PIN10_IDX, kPORT_MuxAlt4);           /* PORTA10 (pin 62) is configured as MII0_RXD2 */

PORT_SetPinMux(PORTA, PIN11_IDX, kPORT_MuxAlt4);           /* PORTA11 (pin 63) is configured as MII0_RXCLK */

  PORT_SetPinMux(PORTA, PIN12_IDX, kPORT_MuxAlt4);           /* PORTA12 (pin 64) is configured as MII0_RXD1 */

  PORT_SetPinMux(PORTA, PIN13_IDX, kPORT_MuxAlt4);           /* PORTA13 (pin 65) is configured as MII0_RXD0 */

  PORT_SetPinMux(PORTA, PIN14_IDX, kPORT_MuxAlt4);           /* PORTA14 (pin 66) is configured as MII0_RXDV */

  PORT_SetPinMux(PORTA, PIN15_IDX, kPORT_MuxAlt4);           /* PORTA15 (pin 67) is configured as MII0_TXEN */

  PORT_SetPinMux(PORTA, PIN16_IDX, kPORT_MuxAlt4);           /* PORTA16 (pin 68) is configured as MII0_TXD0 */

  PORT_SetPinMux(PORTA, PIN17_IDX, kPORT_MuxAlt4);           /* PORTA17 (pin 69) is configured as MII0_TXD1 */

  PORT_SetPinMux(PORTA, PIN24_IDX, kPORT_MuxAlt4);           /* PORTA24 (pin 75) is configured as MII0_TXD2 */

  PORT_SetPinMux(PORTA, PIN25_IDX, kPORT_MuxAlt4);           /* PORTA25 (pin 76) is configured as MII0_TXCLK */

  PORT_SetPinMux(PORTA, PIN26_IDX, kPORT_MuxAlt4);           /* PORTA26 (pin 77) is configured as MII0_TXD3 */

  PORT_SetPinMux(PORTA, PIN27_IDX, kPORT_MuxAlt4);           /* PORTA27 (pin 78) is configured as MII0_CRS */

  PORT_SetPinMux(PORTA, PIN29_IDX, kPORT_MuxAlt4);           /* PORTA29 (pin 80) is configured as MII0_COL */

Labels (1)
0 Kudos
2 Replies

333 Views
alexpimenov
Contributor I

Thanks. It solved the problem.

For some reason I enabled clock for all other ports except for PORTA.

0 Kudos

333 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

hHi, Alex,

I guess that you do not enable the GPIO port clock, pls enable the GPIOA gated clock by setting the bit9 in SIM_SCGC5 register.

You can set the bit by the code if you use SDK2.0:

CLOCK_EnableClock(kCLOCK_PortA);

Before you set the PORTx_PCRy register, you have to enable the PORTx clock.

BR

XiangJun Rong

0 Kudos