s32k-HOW TO HARDFAULT

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

s32k-HOW TO HARDFAULT

2,833件の閲覧回数
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,808件の閲覧回数
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,796件の閲覧回数
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,770件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @jack-joker 

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

0 件の賞賛
返信

2,745件の閲覧回数
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,728件の閲覧回数
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,706件の閲覧回数
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,683件の閲覧回数
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,660件の閲覧回数
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 件の賞賛
返信