TJA1145 Cannot Enter Sleep mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TJA1145 Cannot Enter Sleep mode

Jump to solution
1,779 Views
Jason88619
Contributor II

I am using the Example_SW_TJA1145 program.When I use the ChangeToSleepOperation function of the example program to enter Sleep mode, I debug and find that a PO event occurs.Whenever I try to enter Sleep mode I get blocked by the PO event。

Why does this happen and how can I solve it?

image.png

0 Kudos
Reply
1 Solution
1,734 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

Perhaps the Sleep mode entering is protected due to wake-up event is not enabled and/or pending events are not cleared. For more information, please see chapters 3.2.4 and 5.3.2 of the AH1903 (Secure file under NDA).

Screenshot 2025-04-24 093415.png

Screenshot 2025-04-24 093624.png

BRs, Tomas

View solution in original post

0 Kudos
Reply
2 Replies
1,735 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

Perhaps the Sleep mode entering is protected due to wake-up event is not enabled and/or pending events are not cleared. For more information, please see chapters 3.2.4 and 5.3.2 of the AH1903 (Secure file under NDA).

Screenshot 2025-04-24 093415.png

Screenshot 2025-04-24 093624.png

BRs, Tomas

0 Kudos
Reply
1,756 Views
Jason88619
Contributor II

Below is my SPI_Send program. Is there something wrong with this program?

NXP_UJA11XX_Error_Code_t SPI_Send(Byte* data, NXP_UJA11XX_SPI_Msg_Length_t length, Byte mask, NXP_UJA11XX_Access_t type) {

	Byte Txdata[2] = {0};
	Byte Rxdata[2] = {0};

	Byte ConfirmTxdata[2] = {0};
	Byte ConfirmRxdata[2] = {0};

	uint16_t sendlen = 0;
	uint32_t timeout = 1000000;

	Txdata[0] = data[0];//发送或读取的地址
	ConfirmTxdata[0] = data[0] | NXP_UJA11XX_READ;

	if(NXP_UJA11XX_SPI_MSG_LENGTH_16 == length)
	{
		sendlen = 2;//要发送的Byte的数量
		switch(type)
		{
			case NXP_UJA11XX_WRITE:
			{
				Txdata[1] = data[1];//发送的数据
				SPI3_Send(Txdata, Rxdata, sendlen, timeout);//发送地址和数据
			}
			break;
			case NXP_UJA11XX_READ:
			{
				SPI3_Send(Txdata, Rxdata, sendlen, timeout);//发送地址读取数据
			}
			break;
			case NXP_UJA11XX_INTERRUPT:
			{
				SPI3_Send(Txdata, Rxdata, sendlen, timeout);//发送地址读取数据
			}
			break;
			default:
				return NXP_UJA11XX_ERROR_SPI_HW_FAIL;

		}
		//对读取或写入的数据进行验证
		switch(type)
		{
			case NXP_UJA11XX_WRITE:
			{
				SPI3_Send(ConfirmTxdata, ConfirmRxdata, sendlen, timeout);//读取写入的数据
				if(ConfirmRxdata[1] == data[1])//读取和写入数据一致
				{
					return NXP_UJA11XX_SUCCESS;
				}
				else if( (ConfirmRxdata[0] == 0x00 && ConfirmRxdata[1] == 0x00)||
						 (ConfirmRxdata[0] == 0xFF && ConfirmRxdata[1] == 0xff) )
				{
					return NXP_UJA11XX_ERROR_SPI_HW_FAIL;
				}
				else
				{
					return NXP_UJA11XX_ERROR_WRITE_FAIL;
				}
			}
			break;
			case NXP_UJA11XX_READ:
			{
				SPI3_Send(ConfirmTxdata, ConfirmRxdata, sendlen, timeout);//再次读取数据
				if(ConfirmRxdata[1] == Rxdata[1])//两次读取的数据相同
				{
					data[1] = Rxdata[1];//传回读取到的数据
					return NXP_UJA11XX_SUCCESS;
				}
				else
				{
					return NXP_UJA11XX_ERROR_READ_FAIL;
				}
			}
			break;
			case NXP_UJA11XX_INTERRUPT:
			{
				SPI3_Send(ConfirmTxdata, ConfirmRxdata, sendlen, timeout);//再次读取数据
				if( (Rxdata[1] & mask) != 0 )
				{
					return NXP_UJA11XX_ERROR_WRITE_FAIL;
				}
			}
			break;
			default:
				return NXP_UJA11XX_ERROR_SPI_HW_FAIL;

		}
	}
	else//消息长度不为16bit
	{

	}
	return NXP_UJA11XX_SUCCESS;
}
0 Kudos
Reply