s32k-HOW TO HARDFAULT

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

s32k-HOW TO HARDFAULT

2,841 次查看
jack-joker
Contributor II

Hello, after I configured the Mcal generated by EB to the compiler, a hardfauld error occurred during the run, and I found the SPI_INIT, but I couldn't solve it.
Thank you

0 项奖励
回复
8 回复数

2,816 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @jack-joker 

Could you please provide more information such as the settings you made and the implementation? Also, bedug further in Spi_Init() function to find out which line is stucked and causing this issue.

 

BR, VaneB

0 项奖励
回复

2,804 次查看
jack-joker
Contributor II

thank you for your report By search for that. It’s (Base>FCR=LPSPI_FCR_TXWATER((uint32)LPSPI_IP_FIFO_SIZE_U8-(uint32)2u);).it this line which casing to hard fault@VaneB

Thank you

Jack-joker

标记 (1)
0 项奖励
回复

2,778 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @jack-joker 

Could you please provide more information such as the configurations you made?

0 项奖励
回复

2,753 次查看
jack-joker
Contributor II

jackjoker_0-1729661120324.png

jackjoker_1-1729661144025.pngjackjoker_2-1729661164661.pngjackjoker_3-1729661182297.pngjackjoker_4-1729661207774.pngjackjoker_5-1729661226902.png

jackjoker_6-1729661245506.png

jackjoker_7-1729661267176.png

 

that is all about my configure about SPI1 

thank you!

 

0 项奖励
回复

2,736 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @jack-joker 

I have a question. Which S32K derivative are you using? Also, in the SpiPhyUnitClockRef the name of the SPI clock source configuration seems to be "SPI1", but you are configuring the LPSPI0, could you confirm if the clock configuration is the one corresponding to the SPI instance? The discrepancy in the name confused me.

0 项奖励
回复

2,714 次查看
jack-joker
Contributor II

jackjoker_0-1729848835424.png

I commented these three lines of code and it worked

This is the configuration to which one is associated

Thank you!

标记 (1)
0 项奖励
回复

2,691 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @jack-joker 

There is no relation between these 3 lines of code; the first one enables the SPI to work in debug mode, the second one configures some main fields of the SPI and the last one corresponds to the transmit FIFO watermark.

Previously, you said that the hard faul was caused at Base>FCR=LPSPI_FCR_TXWATER((uint32)LPSPI_IP_FIFO_SIZE_U8-(uint32)2u), but with the current information but could you please verify if the fault is not caused by the the configurations set in the second line of code?

0 项奖励
回复

2,668 次查看
jack-joker
Contributor II

@VaneBI'm able to determine which line is the result of one of these three lines of code, and I'll have to verify it tomorrow

Tank you!

标记 (1)
0 项奖励
回复