CAN PAL - Dev ASSERT Check

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

CAN PAL - Dev ASSERT Check

跳至解决方案
1,259 次查看
zubizeratta
Contributor II

Hello,

MCU: S32K118

SDK : S32SDK_S32K1XX_RTM_4.0.1

In the CAN Driver, can_pal.c , Can_AllocateState function there's a DEV_ASSERT check which fails: 

(NO_OF_FLEXCAN_INSTS_FOR_CAN =1)

for (i = 0; i < NO_OF_FLEXCAN_INSTS_FOR_CAN; i++)
{
if (isAllocated[i] == false)
{
instanceMapping[i] = instance;
isAllocated[i] = true;
break;
}
}

if (i >= NO_OF_FLEXCAN_INSTS_FOR_CAN)
{
/* Should Never Reach Here */
DEV_ASSERT(false);
i = (NO_OF_FLEXCAN_INSTS_FOR_CAN-1U);
}

 

Even though value of 1 is valid for NO_OF_FLEXCAN_INSTS_FOR_CAN I don't get it exactly why it's checked if it's equal or greated than one. Shouldn't it be just ">1) ? 

 

0 项奖励
回复
1 解答
1,234 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @zubizeratta,

I will be supporting your issue over at your other thread in order to prevent any misunderstandings or miscommunications: CAN PAL Dev Assert Issue - NXP Community.

Best regards,
Julián

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,235 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @zubizeratta,

I will be supporting your issue over at your other thread in order to prevent any misunderstandings or miscommunications: CAN PAL Dev Assert Issue - NXP Community.

Best regards,
Julián

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1968988%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3ECAN%20PAL%20-%20Dev%20ASSERT%20Check%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1968988%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EMCU%3A%20S32K118%3C%2FP%3E%3CP%3ESDK%20%3A%26nbsp%3BS32SDK_S32K1XX_RTM_4.0.1%3C%2FP%3E%3CP%3EIn%20the%20CAN%20Driver%2C%20can_pal.c%20%2C%20Can_AllocateState%20function%20there's%20a%20DEV_ASSERT%20check%20which%20fails%3A%26nbsp%3B%3C%2FP%3E%3CP%3E(NO_OF_FLEXCAN_INSTS_FOR_CAN%20%3D1)%3C%2FP%3E%3CP%3Efor%20(i%20%3D%200%3B%20i%20%26lt%3B%20NO_OF_FLEXCAN_INSTS_FOR_CAN%3B%20i%2B%2B)%3CBR%20%2F%3E%7B%3CBR%20%2F%3Eif%20(isAllocated%5Bi%5D%20%3D%3D%20false)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EinstanceMapping%5Bi%5D%20%3D%20instance%3B%3CBR%20%2F%3EisAllocated%5Bi%5D%20%3D%20true%3B%3CBR%20%2F%3Ebreak%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3Eif%20(i%20%26gt%3B%3D%20NO_OF_FLEXCAN_INSTS_FOR_CAN)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%2F*%20Should%20Never%20Reach%20Here%20*%2F%3CBR%20%2F%3EDEV_ASSERT(false)%3B%3CBR%20%2F%3Ei%20%3D%20(NO_OF_FLEXCAN_INSTS_FOR_CAN-1U)%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EEven%20though%20value%20of%201%20is%20valid%20for%26nbsp%3BNO_OF_FLEXCAN_INSTS_FOR_CAN%20I%20don't%20get%20it%20exactly%20why%20it's%20checked%20if%20it's%20equal%20or%20greated%20than%20one.%20Shouldn't%20it%20be%20just%20%22%26gt%3B1)%20%3F%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E