Setting up CAN driver for s32k322 using code configuration tool

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

Setting up CAN driver for s32k322 using code configuration tool

跳至解决方案
4,702 次查看
pratik_a
Contributor III

Hi,

I'm trying to configure CAN1 which is PTC8 and PTC9 of S32k322 as a CAN transceiver.  As can be seen in image 1.png I have included the necessary components. After updating the code I'm getting the following 5 errors,

Error 1:

workspaceS32DS.3.5\trial21_02_24\trial21_02_24_M7_1\Debug_FLASH/../RTD/src/Can_43_FLEXCAN.c:1135: undefined reference to `CanIf_ControllerModeIndication'

Error 2: 

s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: workspaceS32DS.3.5\trial21_02_24\trial21_02_24_M7_1\Debug_FLASH/../RTD/src/Can_43_FLEXCAN.c:1184: undefined reference to `CanIf_ControllerModeIndication'

Error 3:

workspaceS32DS.3.5\trial21_02_24\trial21_02_24_M7_1\Debug_FLASH/../RTD/src/Can_43_FLEXCAN.c:2997: undefined reference to `CanIf_ControllerBusOff'

Error 4:

workspaceS32DS.3.5\trial21_02_24\trial21_02_24_M7_1\Debug_FLASH/../RTD/src/Can_43_FLEXCAN_Ipw.c:2613: undefined reference to `CanIf_ControllerModeIndication'

Error 5:

make: *** [makefile:39: trial21_02_24_M7_1.elf] Error 1

 

Any help is appreciated.

Thanks, in advance.

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

Hi @pratik_a,

Please try declaring the functions in your main code for your application, just like in the example:

void CanIf_ControllerBusOff(uint8 ControllerId)
{
    (void)ControllerId;
}

void CanIf_ControllerModeIndication(uint8 ControllerId, Can_ControllerStateType ControllerMode )
{
    (void)ControllerId;
    (void)ControllerMode;
}

Best regards,
Julián

在原帖中查看解决方案

4 回复数
4,566 次查看
pratik_a
Contributor III

Hi @Julián_AragónM 

It worked. Thanks

4,686 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @pratik_a,

Firstly, could you share the version of the RTD package you are using? 

Could you also share how did you create the project? Is this from scratch or are you basing this application off of the Can_Example from the RTD? 

Please confirm you are including the necessary file for the driver, as shown in the example (this is not made automatically with the "UpdateCode" button):

 

#include "Can_43_FLEXCAN.h"

 

Best regards,
Julián

0 项奖励
回复
4,668 次查看
pratik_a
Contributor III

Hi @Julián_AragónM 

Thank you for the response.

I'm creating the project from scratch. I selected the controller NXP S32k322 along with SDK named PlatformSDK_S32K3_S32K322_M7_0 version 3.0.0 refer image 1.png and included the modules directly from the components section as can be seen in image 2.png

I also tried including the header file in main.c

#include "Can_43_FLEXCAN.h"

The error still persists.

Best regards,

Pratik 

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

Hi @pratik_a,

Please try declaring the functions in your main code for your application, just like in the example:

void CanIf_ControllerBusOff(uint8 ControllerId)
{
    (void)ControllerId;
}

void CanIf_ControllerModeIndication(uint8 ControllerId, Can_ControllerStateType ControllerMode )
{
    (void)ControllerId;
    (void)ControllerMode;
}

Best regards,
Julián