CAN Transmit Issue

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

CAN Transmit Issue

327 Views
Vamshi_
Contributor II

Hii,

  Here I am trying to transmit some dummy data from S32K148 to USBCAN_FD Tool using standard CAN, but I am not able to receive any data at the tool and when I am debugging the code I am getting CAN clock not sync, so can you tell me where did i made the mistake and also here I am using TJA1042B CAN transducer. and I have configured it to active mode by setting the pin low.

And also I will share my code and Pics of the config what I did.Screenshot 2025-11-13 054731.pngScreenshot 2025-11-13 054924.pngScreenshot 2025-11-13 054936.pngScreenshot 2025-11-13 054954.pngScreenshot 2025-11-13 055009.pngScreenshot 2025-11-13 055021.pngScreenshot 2025-11-13 055107.pngScreenshot 2025-11-13 055119.pngScreenshot 2025-11-13 055139.pngScreenshot 2025-11-13 055154.pngScreenshot 2025-11-13 055232.pngScreenshot 2025-11-13 055251.pngScreenshot 2025-11-13 055313.pngScreenshot 2025-11-13 055743.png

/*
* (c) Copyright 2020 NXP
*
* NXP Confidential. This software is owned or controlled by NXP and may only be used strictly
* in accordance with the applicable license terms. By expressly accepting
* such terms or by downloading, installing, activating and/or otherwise using
* the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms. If you do not agree to
* be bound by the applicable license terms, then you may not retain,
* install, activate or otherwise use the software.
*
* This file contains sample code only. It is not part of the production code deliverables.
*/

#ifdef __cplusplus
extern "C" {
#endif

/*==================================================================================================
* INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/
#include "Mcu.h"
#include "Platform.h"
#include "Can_43_FLEXCAN.h"
#include "SchM_Can_43_FLEXCAN.h"
#include "check_example.h"
#include "stdio.h"
#include "Dio.h"

/*==================================================================================================
* LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/

/*==================================================================================================
* LOCAL MACROS
==================================================================================================*/

/*==================================================================================================
* LOCAL CONSTANTS
==================================================================================================*/

/*==================================================================================================
* LOCAL VARIABLES
==================================================================================================*/

/*==================================================================================================
* GLOBAL CONSTANTS
==================================================================================================*/

uint8 Can_au8Sdu8bytes[8U] = {0x01U, 0x02U, 0x03U, 0x04U, 0x05U, 0x06U, 0x07U, 0x08};

/*==================================================================================================
* GLOBAL VARIABLES
==================================================================================================*/

uint8 CanIf_u8TxConfirmCnt = 0U;
boolean CanIf_bTxFlag = FALSE;
uint8 CanIf_u8RxIndicationCnt = 0U;
boolean CanIf_bRxFlag = FALSE;
Std_ReturnType status ;
uint8 dummyData1[8] = {0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11};
Can_PduType txPdu1;
uint8 rxData[8] = {0}; // Buffer for received data
Can_PduType rxPdu1; // Received PDU object

/*==================================================================================================
* LOCAL FUNCTION PROTOTYPES
==================================================================================================*/
void CAN_Transmit(uint8* data, uint8 length);
void CAN_Receive(void);
void CAN_WaitForClockSync(void);

/*==================================================================================================
* LOCAL FUNCTIONS
==================================================================================================*/

/**
* @brief Wait for CAN controller to synchronize with CAN bus clock.
* This should be called after CAN controller is set to STARTED mode.
* The function will timeout if clock synchronization is not achieved.
*/

/*==================================================================================================
* GLOBAL FUNCTIONS
==================================================================================================*/

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

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

void CanIf_TxConfirmation(PduIdType CanTxPduId)
{
CanIf_u8TxConfirmCnt++;
CanIf_bTxFlag = TRUE;
(void)CanTxPduId;
}

void CanIf_RxIndication(const Can_HwType* Mailbox, const PduInfoType* PduInfoPtr )
{
CanIf_u8RxIndicationCnt++;
CanIf_bRxFlag = TRUE;

// Copy received data to local buffer for CAN_Receive()
if ((PduInfoPtr != NULL_PTR) && (PduInfoPtr->SduLength <= 8)) {
for (uint8 i = 0; i < PduInfoPtr->SduLength; i++)
{
rxData[i] = PduInfoPtr->SduDataPtr[i];
}
rxPdu1.id = Mailbox->CanId;
rxPdu1.length = PduInfoPtr->SduLength;
rxPdu1.sdu = rxData;
}

(void)Mailbox;
(void)PduInfoPtr;
}

void Can_DummyDelay(uint32 loops)
{
VAR( volatile uint32, CAN_VAR) data = 0xAA55AA55;
VAR( volatile uint32, CAN_VAR) contor1 = 0;
VAR( volatile uint32, CAN_VAR) contor2 = loops;
do
{
for (contor1 = 0; contor1 < 0x2FF; contor1++)
{
data ^= (1 << contor1) | (0xAAAAAA | contor2);
}
contor2--;
} while( contor2 > 0);
}

Can_PduType Can_CreatePduInfo(Can_IdType id, PduIdType swPduHandle, uint8 length, uint8* sdu)
{
Can_PduType PduInfo;

PduInfo.id = id;
PduInfo.swPduHandle = swPduHandle;
PduInfo.length = length;
PduInfo.sdu = sdu;

return PduInfo;
}

uint32_t counter1=0;
uint32_t counter2=0;
uint32_t counter3=0;
uint8_t step=0;

// Function for CAN transmit
void CAN_Transmit(uint8* data, uint8 length)
{
Can_PduType txPdu;
txPdu.id = 0x111; // Example CAN ID
txPdu.length = length;
txPdu.swPduHandle = 0;
txPdu.sdu = data;

status = Can_43_FLEXCAN_Write(CanHardwareObject_TX, &txPdu);
if(status==E_OK)
{
printf("CAN_Transmit: Transfer successful\n");
}
else
{
printf("CAN_Transmit: Transfer not successful!!\n");
}
}


int main(void)
{
CanIf_bTxFlag = FALSE;
CanIf_bRxFlag = FALSE;
#if (MCU_PRECOMPILE_SUPPORT == STD_ON)
Mcu_Init(NULL_PTR);
#elif (MCU_PRECOMPILE_SUPPORT == STD_OFF)
Mcu_Init(&Mcu_Config_VS_0);
#endif /* (MCU_PRECOMPILE_SUPPORT == STD_ON) */
/* Initialize the clock tree and apply PLL as system clock */
Mcu_InitClock(McuClockSettingConfig_0);
#if (MCU_NO_PLL == STD_OFF)
while ( MCU_PLL_LOCKED != Mcu_GetPllStatus() )
{
/* Busy wait until the System PLL is locked */
}
Mcu_DistributePllClock();
#endif
Mcu_SetMode(McuModeSettingConf_0);
/* Initialize Platform driver */
Platform_Init(NULL_PTR);
Can_43_FLEXCAN_Init(NULL_PTR);

Dio_WriteChannel(DioConf_DioChannel_DioChannel_CANSTDBY,STD_LOW);

Can_43_FLEXCAN_SetControllerMode(CanController_0, CAN_CS_STARTED);

/* ------- */

txPdu1.id = 0x111;
txPdu1.length = 8;
txPdu1.swPduHandle = 0;
txPdu1.sdu = dummyData1;

while(1)
{
// Example: transmit and attempt to receive
CAN_Transmit(dummyData1, 8);
Can_DummyDelay(0xFFFFF);

}

return (0U);

}

#ifdef __cplusplus
}
#endif

/** @} */

 

0 Kudos
Reply
3 Replies

246 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Vamshi_

Your "Port" configuration is wrong, please refer to below configurations.

Senlent_0-1763102788099.pngSenlent_1-1763102794984.pngSenlent_2-1763102810362.png

Senlent_3-1763102942518.png

 

0 Kudos
Reply

280 Views
Vamshi_
Contributor II

This is my project file.

0 Kudos
Reply

288 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Vamshi_

Please share your project , and I will take the time to check it for you.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2203985%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ECAN%20Transmit%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2203985%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHii%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20Here%20I%20am%20trying%20to%20transmit%20some%20dummy%20data%20from%20S32K148%20to%20USBCAN_FD%20Tool%20using%20standard%20CAN%2C%20but%20I%20am%20not%20able%20to%20receive%20any%20data%20at%20the%20tool%20and%20when%20I%20am%20debugging%20the%20code%20I%20am%20getting%20CAN%20clock%20not%20sync%2C%20so%20can%20you%20tell%20me%20where%20did%20i%20made%20the%20mistake%20and%20also%20here%20I%20am%20using%26nbsp%3BTJA1042B%20CAN%20transducer.%20and%20I%20have%20configured%20it%20to%20active%20mode%20by%20setting%20the%20pin%20low.%3C%2FP%3E%3CP%3EAnd%20also%20I%20will%20share%20my%20code%20and%20Pics%20of%20the%20config%20what%20I%20did.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20054731.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20054731.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365366i870CFF75BD44D58B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20054731.png%22%20alt%3D%22Screenshot%202025-11-13%20054731.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20054924.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20054924.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365367i0E5A3809344F3AE9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20054924.png%22%20alt%3D%22Screenshot%202025-11-13%20054924.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20054936.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20054936.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365368i11AE89AC686B3E8B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20054936.png%22%20alt%3D%22Screenshot%202025-11-13%20054936.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20054954.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20054954.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365369i1B87C2A694169A92%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20054954.png%22%20alt%3D%22Screenshot%202025-11-13%20054954.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20055009.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20055009.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365370i2E2579C351904430%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20055009.png%22%20alt%3D%22Screenshot%202025-11-13%20055009.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20055021.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20055021.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365371i7C4AA82E6C9E6C9E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20055021.png%22%20alt%3D%22Screenshot%202025-11-13%20055021.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20055107.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20055107.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365372i3B613397E7AAFFC7%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20055107.png%22%20alt%3D%22Screenshot%202025-11-13%20055107.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20055119.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20055119.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365373i24FBB6CE74349ED1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20055119.png%22%20alt%3D%22Screenshot%202025-11-13%20055119.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20055139.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20055139.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365374iC226829323C7FA30%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20055139.png%22%20alt%3D%22Screenshot%202025-11-13%20055139.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20055154.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20055154.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365375iFDB355DE841D1C09%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20055154.png%22%20alt%3D%22Screenshot%202025-11-13%20055154.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20055232.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20055232.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365376iAE61F60F04D2F64D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20055232.png%22%20alt%3D%22Screenshot%202025-11-13%20055232.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20055251.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20055251.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365377iDD7732ED92ABBB1F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20055251.png%22%20alt%3D%22Screenshot%202025-11-13%20055251.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20055313.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20055313.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365378iFF89FE6AC95A5A22%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20055313.png%22%20alt%3D%22Screenshot%202025-11-13%20055313.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202025-11-13%20055743.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202025-11-13%20055743.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365379i93110DB122BA014E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202025-11-13%20055743.png%22%20alt%3D%22Screenshot%202025-11-13%20055743.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%2F*%3CBR%20%2F%3E*%20(c)%20Copyright%202020%20NXP%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20NXP%20Confidential.%20This%20software%20is%20owned%20or%20controlled%20by%20NXP%20and%20may%20only%20be%20used%20strictly%3CBR%20%2F%3E*%20in%20accordance%20with%20the%20applicable%20license%20terms.%20By%20expressly%20accepting%3CBR%20%2F%3E*%20such%20terms%20or%20by%20downloading%2C%20installing%2C%20activating%20and%2For%20otherwise%20using%3CBR%20%2F%3E*%20the%20software%2C%20you%20are%20agreeing%20that%20you%20have%20read%2C%20and%20that%20you%20agree%20to%3CBR%20%2F%3E*%20comply%20with%20and%20are%20bound%20by%2C%20such%20license%20terms.%20If%20you%20do%20not%20agree%20to%3CBR%20%2F%3E*%20be%20bound%20by%20the%20applicable%20license%20terms%2C%20then%20you%20may%20not%20retain%2C%3CBR%20%2F%3E*%20install%2C%20activate%20or%20otherwise%20use%20the%20software.%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20This%20file%20contains%20sample%20code%20only.%20It%20is%20not%20part%20of%20the%20production%20code%20deliverables.%3CBR%20%2F%3E*%2F%3C%2FP%3E%3CP%3E%23ifdef%20__cplusplus%3CBR%20%2F%3Eextern%20%22C%22%20%7B%3CBR%20%2F%3E%23endif%3C%2FP%3E%3CP%3E%2F*%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3CBR%20%2F%3E*%20INCLUDE%20FILES%3CBR%20%2F%3E*%201)%20system%20and%20project%20includes%3CBR%20%2F%3E*%202)%20needed%20interfaces%20from%20external%20units%3CBR%20%2F%3E*%203)%20internal%20and%20external%20interfaces%20from%20this%20unit%3CBR%20%2F%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D*%2F%3CBR%20%2F%3E%23include%20%22Mcu.h%22%3C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3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D*%2F%3C%2FP%3E%3CP%3Euint8%20CanIf_u8TxConfirmCnt%20%3D%200U%3B%3CBR%20%2F%3Eboolean%20CanIf_bTxFlag%20%3D%20FALSE%3B%3CBR%20%2F%3Euint8%20CanIf_u8RxIndicationCnt%20%3D%200U%3B%3CBR%20%2F%3Eboolean%20CanIf_bRxFlag%20%3D%20FALSE%3B%3CBR%20%2F%3EStd_ReturnType%20status%20%3B%3CBR%20%2F%3Euint8%20dummyData1%5B8%5D%20%3D%20%7B0x11%2C0x11%2C0x11%2C0x11%2C0x11%2C0x11%2C0x11%2C0x11%7D%3B%3CBR%20%2F%3ECan_PduType%20txPdu1%3B%3CBR%20%2F%3Euint8%20rxData%5B8%5D%20%3D%20%7B0%7D%3B%20%2F%2F%20Buffer%20for%20received%20data%3CBR%20%2F%3ECan_PduType%20rxPdu1%3B%20%2F%2F%20Received%20PDU%20object%3C%2FP%3E%3CP%3E%2F*%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3CBR%20%2F%3E*%20LOCAL%20FUNCTION%20PROTOTYPES%3CBR%20%2F%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%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%3D*%2F%3C%2FP%3E%3CP%3E%2F**%3CBR%20%2F%3E*%20%40brief%20Wait%20for%20CAN%20controller%20to%20synchronize%20with%20CAN%20bus%20clock.%3CBR%20%2F%3E*%20This%20should%20be%20called%20after%20CAN%20controller%20is%20set%20to%20STARTED%20mode.%3CBR%20%2F%3E*%20The%20function%20will%20timeout%20if%20clock%20synchronization%20is%20not%20achieved.%3CBR%20%2F%3E*%2F%3C%2FP%3E%3CP%3E%2F*%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3CBR%20%2F%3E*%20GLOBAL%20FUNCTIONS%3CBR%20%2F%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D*%2F%3C%2FP%3E%3CP%3Evoid%20CanIf_ControllerBusOff(uint8%20ControllerId)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E(void)ControllerId%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3Evoid%20CanIf_ControllerModeIndication(uint8%20ControllerId%2C%20Can_ControllerStateType%20ControllerMode%20)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E(void)ControllerId%3B%3CBR%20%2F%3E(void)ControllerMode%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3Evoid%20CanIf_TxConfirmation(PduIdType%20CanTxPduId)%3CBR%20%2F%3E%7B%3CBR%20%2F%3ECanIf_u8TxConfirmCnt%2B%2B%3B%3CBR%20%2F%3ECanIf_bTxFlag%20%3D%20TRUE%3B%3CBR%20%2F%3E(void)CanTxPduId%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3Evoid%20CanIf_RxIndication(const%20Can_HwType*%20Mailbox%2C%20const%20PduInfoType*%20PduInfoPtr%20)%3CBR%20%2F%3E%7B%3CBR%20%2F%3ECanIf_u8RxIndicationCnt%2B%2B%3B%3CBR%20%2F%3ECanIf_bRxFlag%20%3D%20TRUE%3B%3C%2FP%3E%3CP%3E%2F%2F%20Copy%20received%20data%20to%20local%20buffer%20for%20CAN_Receive()%3CBR%20%2F%3Eif%20((PduInfoPtr%20!%3D%20NULL_PTR)%20%26amp%3B%26amp%3B%20(PduInfoPtr-%26gt%3BSduLength%20%26lt%3B%3D%208))%20%7B%3CBR%20%2F%3Efor%20(uint8%20i%20%3D%200%3B%20i%20%26lt%3B%20PduInfoPtr-%26gt%3BSduLength%3B%20i%2B%2B)%3CBR%20%2F%3E%7B%3CBR%20%2F%3ErxData%5Bi%5D%20%3D%20PduInfoPtr-%26gt%3BSduDataPtr%5Bi%5D%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3ErxPdu1.id%20%3D%20Mailbox-%26gt%3BCanId%3B%3CBR%20%2F%3ErxPdu1.length%20%3D%20PduInfoPtr-%26gt%3BSduLength%3B%3CBR%20%2F%3ErxPdu1.sdu%20%3D%20rxData%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E(void)Mailbox%3B%3CBR%20%2F%3E(void)PduInfoPtr%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3Evoid%20Can_DummyDelay(uint32%20loops)%3CBR%20%2F%3E%7B%3CBR%20%2F%3EVAR(%20volatile%20uint32%2C%20CAN_VAR)%20data%20%3D%200xAA55AA55%3B%3CBR%20%2F%3EVAR(%20volatile%20uint32%2C%20CAN_VAR)%20contor1%20%3D%200%3B%3CBR%20%2F%3EVAR(%20volatile%20uint32%2C%20CAN_VAR)%20contor2%20%3D%20loops%3B%3CBR%20%2F%3Edo%3CBR%20%2F%3E%7B%3CBR%20%2F%3Efor%20(contor1%20%3D%200%3B%20contor1%20%26lt%3B%200x2FF%3B%20contor1%2B%2B)%3CBR%20%2F%3E%7B%3CBR%20%2F%3Edata%20%5E%3D%20(1%20%26lt%3B%26lt%3B%20contor1)%20%7C%20(0xAAAAAA%20%7C%20contor2)%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3Econtor2--%3B%3CBR%20%2F%3E%7D%20while(%20contor2%20%26gt%3B%200)%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3ECan_PduType%20Can_CreatePduInfo(Can_IdType%20id%2C%20PduIdType%20swPduHandle%2C%20uint8%20length%2C%20uint8*%20sdu)%3CBR%20%2F%3E%7B%3CBR%20%2F%3ECan_PduType%20PduInfo%3B%3C%2FP%3E%3CP%3EPduInfo.id%20%3D%20id%3B%3CBR%20%2F%3EPduInfo.swPduHandle%20%3D%20swPduHandle%3B%3CBR%20%2F%3EPduInfo.length%20%3D%20length%3B%3CBR%20%2F%3EPduInfo.sdu%20%3D%20sdu%3B%3C%2FP%3E%3CP%3Ereturn%20PduInfo%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3Euint32_t%20counter1%3D0%3B%3CBR%20%2F%3Euint32_t%20counter2%3D0%3B%3CBR%20%2F%3Euint32_t%20counter3%3D0%3B%3CBR%20%2F%3Euint8_t%20step%3D0%3B%3C%2FP%3E%3CP%3E%2F%2F%20Function%20for%20CAN%20transmit%3CBR%20%2F%3Evoid%20CAN_Transmit(uint8*%20data%2C%20uint8%20length)%3CBR%20%2F%3E%7B%3CBR%20%2F%3ECan_PduType%20txPdu%3B%3CBR%20%2F%3EtxPdu.id%20%3D%200x111%3B%20%2F%2F%20Example%20CAN%20ID%3CBR%20%2F%3EtxPdu.length%20%3D%20length%3B%3CBR%20%2F%3EtxPdu.swPduHandle%20%3D%200%3B%3CBR%20%2F%3EtxPdu.sdu%20%3D%20data%3B%3C%2FP%3E%3CP%3Estatus%20%3D%20Can_43_FLEXCAN_Write(CanHardwareObject_TX%2C%20%26amp%3BtxPdu)%3B%3CBR%20%2F%3Eif(status%3D%3DE_OK)%3CBR%20%2F%3E%7B%3CBR%20%2F%3Eprintf(%22CAN_Transmit%3A%20Transfer%20successful%5Cn%22)%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3Eelse%3CBR%20%2F%3E%7B%3CBR%20%2F%3Eprintf(%22CAN_Transmit%3A%20Transfer%20not%20successful!!%5Cn%22)%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%3CBR%20%2F%3Eint%20main(void)%3CBR%20%2F%3E%7B%3CBR%20%2F%3ECanIf_bTxFlag%20%3D%20FALSE%3B%3CBR%20%2F%3ECanIf_bRxFlag%20%3D%20FALSE%3B%3CBR%20%2F%3E%23if%20(MCU_PRECOMPILE_SUPPORT%20%3D%3D%20STD_ON)%3CBR%20%2F%3EMcu_Init(NULL_PTR)%3B%3CBR%20%2F%3E%23elif%20(MCU_PRECOMPILE_SUPPORT%20%3D%3D%20STD_OFF)%3CBR%20%2F%3EMcu_Init(%26amp%3BMcu_Config_VS_0)%3B%3CBR%20%2F%3E%23endif%20%2F*%20(MCU_PRECOMPILE_SUPPORT%20%3D%3D%20STD_ON)%20*%2F%3CBR%20%2F%3E%2F*%20Initialize%20the%20clock%20tree%20and%20apply%20PLL%20as%20system%20clock%20*%2F%3CBR%20%2F%3EMcu_InitClock(McuClockSettingConfig_0)%3B%3CBR%20%2F%3E%23if%20(MCU_NO_PLL%20%3D%3D%20STD_OFF)%3CBR%20%2F%3Ewhile%20(%20MCU_PLL_LOCKED%20!%3D%20Mcu_GetPllStatus()%20)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%2F*%20Busy%20wait%20until%20the%20System%20PLL%20is%20locked%20*%2F%3CBR%20%2F%3E%7D%3CBR%20%2F%3EMcu_DistributePllClock()%3B%3CBR%20%2F%3E%23endif%3CBR%20%2F%3EMcu_SetMode(McuModeSettingConf_0)%3B%3CBR%20%2F%3E%2F*%20Initialize%20Platform%20driver%20*%2F%3CBR%20%2F%3EPlatform_Init(NULL_PTR)%3B%3CBR%20%2F%3ECan_43_FLEXCAN_Init(NULL_PTR)%3B%3C%2FP%3E%3CP%3EDio_WriteChannel(DioConf_DioChannel_DioChannel_CANSTDBY%2CSTD_LOW)%3B%3C%2FP%3E%3CP%3ECan_43_FLEXCAN_SetControllerMode(CanController_0%2C%20CAN_CS_STARTED)%3B%3C%2FP%3E%3CP%3E%2F*%20-------%20*%2F%3C%2FP%3E%3CP%3EtxPdu1.id%20%3D%200x111%3B%3CBR%20%2F%3EtxPdu1.length%20%3D%208%3B%3CBR%20%2F%3EtxPdu1.swPduHandle%20%3D%200%3B%3CBR%20%2F%3EtxPdu1.sdu%20%3D%20dummyData1%3B%3C%2FP%3E%3CP%3Ewhile(1)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%2F%2F%20Example%3A%20transmit%20and%20attempt%20to%20receive%3CBR%20%2F%3ECAN_Transmit(dummyData1%2C%208)%3B%3CBR%20%2F%3ECan_DummyDelay(0xFFFFF)%3B%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3CP%3Ereturn%20(0U)%3B%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3CP%3E%23ifdef%20__cplusplus%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%23endif%3C%2FP%3E%3CP%3E%2F**%20%40%7D%20*%2F%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2204939%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN%20Transmit%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204939%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22mailto%3AHi%40Vamshi_%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EHi%40Vamshi_%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EYour%20%22Port%22%20configuration%20is%20wrong%2C%20please%20refer%20to%20below%20configurations.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_0-1763102788099.png%22%20style%3D%22width%3A%20560px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_0-1763102788099.png%22%20style%3D%22width%3A%20560px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365639i34A65A513BD03AC6%2Fimage-dimensions%2F560x311%3Fv%3Dv2%22%20width%3D%22560%22%20height%3D%22311%22%20role%3D%22button%22%20title%3D%22Senlent_0-1763102788099.png%22%20alt%3D%22Senlent_0-1763102788099.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_1-1763102794984.png%22%20style%3D%22width%3A%20556px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_1-1763102794984.png%22%20style%3D%22width%3A%20556px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365640i9F323B34A226309A%2Fimage-dimensions%2F556x335%3Fv%3Dv2%22%20width%3D%22556%22%20height%3D%22335%22%20role%3D%22button%22%20title%3D%22Senlent_1-1763102794984.png%22%20alt%3D%22Senlent_1-1763102794984.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_2-1763102810362.png%22%20style%3D%22width%3A%20556px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_2-1763102810362.png%22%20style%3D%22width%3A%20556px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365641i04371D8C1FC76D31%2Fimage-dimensions%2F556x335%3Fv%3Dv2%22%20width%3D%22556%22%20height%3D%22335%22%20role%3D%22button%22%20title%3D%22Senlent_2-1763102810362.png%22%20alt%3D%22Senlent_2-1763102810362.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Senlent_3-1763102942518.png%22%20style%3D%22width%3A%20558px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Senlent_3-1763102942518.png%22%20style%3D%22width%3A%20558px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F365642i721C5E59609F9708%2Fimage-dimensions%2F558x267%3Fv%3Dv2%22%20width%3D%22558%22%20height%3D%22267%22%20role%3D%22button%22%20title%3D%22Senlent_3-1763102942518.png%22%20alt%3D%22Senlent_3-1763102942518.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2204493%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN%20Transmit%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204493%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThis%20is%20my%20project%20file.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2204300%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20CAN%20Transmit%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2204300%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EVamshi_%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EPlease%20share%20your%20project%20%2C%20and%20I%20will%20take%20the%20time%20to%20check%20it%20for%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E