Bus Fault happen when reading LPSPI receive data register(RDR)

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

Bus Fault happen when reading LPSPI receive data register(RDR)

1,145件の閲覧回数
Jason_yuchengjie
Contributor I

Hi guys

I was trying to read SBC's status register(UGA1169TK) via LPSPI1 with S32K146 EVB. Actually it's a example code in S32K1xx Series Cookbook. But when reading the data from Receive Data Register(RDR), an error happened and program jumped to DefaultISR. The code and error information as below.

Code:

uint16_t LPSPI1_receive_16bits (void)
{
uint16_t recieve = 0;

while((LPSPI1->SR & LPSPI_SR_RDF_MASK) >>LPSPI_SR_RDF_SHIFT==0);
/* Wait at least one RxFIFO entry */
recieve = LPSPI1->RDR; /* Read received data */ /* Error happens here */
LPSPI1->SR |= LPSPI_SR_RDF_MASK; /* Clear RDF flag */
return recieve; /* Return received data */
}

When error happens program jumps to below.

DefaultISR:
b DefaultISR
.size DefaultISR, . - DefaultISR

 

Debugger console information:

Target has been RESET and is active.
BusFault: A precise (synchronous) data access error has occurred.
Possible BusFault location: 0x4002C074.
HardFault: A fault has been escalated to a hard fault.

 

Please help to confirm what reason caused this error? Thank you.

0 件の賞賛
返信
2 返答(返信)

1,080件の閲覧回数
byreddy1245367
Contributor I

I strongly suggest following these steps tellpopeyess 

 

if that doesn't work try this greatpeopleme 

0 件の賞賛
返信

1,112件の閲覧回数
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello

 

I suggest you refer to the SDK v4 examples in the S32DS https://www.nxp.com/design/software/development-software/s32-design-studio-ide/s32-design-studio-for...

You can replicate the test with this example to see if the problem still persists.

 

Let me know if this is helpful, if you have more questions do not hesitate to ask me.

Best regards,

Omar

0 件の賞賛
返信