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

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

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

1,630 次查看
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,565 次查看
byreddy1245367
Contributor I

I strongly suggest following these steps tellpopeyess 

 

if that doesn't work try this greatpeopleme 

0 项奖励
回复

1,597 次查看
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 项奖励
回复