FRDM-K64F crashes trying to set SPI ports

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FRDM-K64F crashes trying to set SPI ports

1,445件の閲覧回数
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!

ラベル(1)
タグ(2)
0 件の賞賛
返信
2 返答(返信)

1,303件の閲覧回数
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 件の賞賛
返信

1,303件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Thank you for your solution sharing.

If you still have question, please let us know.

Best Regards,

Jingjing

0 件の賞賛
返信