FRDM-K64F crashes trying to set SPI ports

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

FRDM-K64F crashes trying to set SPI ports

551 Views
roel0
Contributor II
int main()  {      volatile uint32_t i;       // Init clocks      hardware_init();      dbg_uart_init();      OSA_Init();      GPIO_DRV_Init(switchPins, ledPins);                LED1_EN;       LED1_TOGGLE;      configure_spi_pins(SPI1_IDX);

 

The code above crashes on line 14

 

GDB output:

configure_spi_pins (instance=1) at /home/roel/Downloads/KSDK_1.3.0/examples/frdmk64f/pin_mux.c:251

PORT_HAL_SetMuxMode (base=0x4004c000, pin=4, mux=kPortMuxAlt7)

    at /home/roel/Downloads/KSDK_1.3.0/examples/frdmk64f/demo_apps/test/armgcc/../../../../../platform/hal/inc/fsl_port_hal.h:255

WDOG_EWM_IRQHandler () at /home/roel/Downloads/KSDK_1.3.0/platform/devices/MK64F12/startup/gcc/startup_MK64F12.S:349

(gdb)

 

 

 

This is my first project on this board an I've absolute no idea what the cause is of this error. Has anyone had familiar errors?
Thanks in advance!

Labels (1)
0 Kudos
2 Replies

409 Views
roel0
Contributor II

The problem was I was using an old example which was missing the following line in hardware_init.c

CLOCK_SYS_EnablePortClock(PORTD_IDX);

0 Kudos

409 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Thank you for your solution sharing.

If you still have question, please let us know.

Best Regards,

Jingjing

0 Kudos