Tool/software:
Hello Team,
During the testing of CanAssist test cases which involve assigning multiple PDUs to single HOH, we encountered an issue when assigning multiple PDUs to a single HOH. Some messages were getting lost. However, when we assigned a single PDU to a single HOH, all messages were received correctly.
I have added the generated files for the CAN. Please review them and let me know if there is anything specific we need to take care of when assigning multiple PDUs to a single HOH.
Regards,
Prashant Singh Tomar
/*
*
* Copyright (c) 2023 Texas Instruments Incorporated
*
* All rights reserved not granted herein.
*
* Limited License.
*
* Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
* license under copyrights and patents it now or hereafter owns or controls to make,
* have made, use, import, offer to sell and sell ("Utilize") this software subject to the
* terms herein. With respect to the foregoing patent license, such license is granted
* solely to the extent that any such patent is necessary to Utilize the software alone.
* The patent license shall not apply to any combinations which include this software,
* other than combinations with devices manufactured by or for TI ("TI Devices").
* No hardware patent is licensed hereunder.
*
* Redistributions must preserve existing copyright notices and reproduce this license
* (including the above copyright notice and the disclaimer and (if applicable) source
* code license limitations below) in the documentation and/or other materials provided
* with the distribution
*
* Redistribution and use in binary form, without modification, are permitted provided
* that the following conditions are met:
*
* * No reverse engineering, decompilation, or disassembly of this software is
* permitted with respect to any software provided in binary form.
*
* * any redistribution and use are licensed by TI for use only with TI Devices.
*
* * Nothing shall obligate TI to provide you with source code for the software
* licensed and provided to you in object code.
*
* If software source code is provided to you, modification and redistribution of the
* source code are permitted provided that the following conditions are met:
*
* * any redistribution and use of the source code, including any resulting derivative
* works, are licensed by TI for use only with TI Devices.
*
* * any redistribution and use of any object code compiled from the source code
* and any resulting derivative works, are licensed by TI for use only with TI Devices.
*
* Neither the name of Texas Instruments Incorporated nor the names of its suppliers
*
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* DISCLAIMER.
*
* THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
Note: Elektrobit Automotive GmbH modified the original code provided
by the third party supplier. The modification is provided for
convenience.
Please use the modification on your discretion and account, or
use the unmodified files provided with this distribution.
Please see for the reasons in the file ImportantNotes.txt for tag
ASCTI-353 Code Compilation error for CAN driver
*/
/***************************************************************************
Project: ToolInt_ConTest_CanAs_CanIf_Can_Red_1
Date : 2024-06-24 07:54:50
This file is generated by EB Tresos
Do not modify this file, otherwise the software may behave in unexpected way.
*****************************************************************************/
/*******************************************************************************
* INCLUDES
******************************************************************************/
#include "Can.h"
#include "Can_Cfg.h"
/*
* Design: MCAL-6077,MCAL-6079,MCAL-5907
*/
/* Version checking */
#if ((CAN_SW_MAJOR_VERSION != (9U))||(CAN_SW_MINOR_VERSION != (0U)))
#error "Version numbers of Can_Cfg.c and Can.h are inconsistent!"
#endif
/*******************************************************************************
* GLOBAL DATA
******************************************************************************/
#define CAN_START_SEC_CONFIG_DATA
#include "Can_MemMap.h"
/* Controller structure defined here for all config sets */
const struct Can_ControllerStruct_PC
CanConfigSet_PC_NodeUnderTest =
{
CanConf_CanController_NodeUnderTest, /* Id as provided by GUI */
(boolean)TRUE, /* Contoller is used=1 or not_used=0*/
0x40500000U, /* Can Controller Base Address */
CAN_TX_RX_PROCESSING_INTERRUPT, /* Can Rx Processing Type */
CAN_TX_RX_PROCESSING_INTERRUPT, /* Can Tx Processing Type */
(boolean)TRUE,/* BusOff TRUE = Interrupt FALSE = Polling */
CAN_CONTROLLER_INSTANCE_MCU_MCAN0, /* Controller Instance */
(boolean)FALSE, /* CAN FD Mode Enable */
};
const struct Can_ControllerStruct_PC
*CanConfigSet_CanController_List_PC[CAN_NUM_CONTROLLER]=
{
&CanConfigSet_PC_NodeUnderTest,
};
/* All the Mailbox objects(MB's) will be defined here for all config sets */
static const struct Can_MailboxStruct_PC
CanConfigSet_PC_HOH_0_NodeUnderTest =
{
CanConf_CanHardwareObject_HOH_0_NodeUnderTest, /* CanObjectId - Holds handle Id */
};
static const struct Can_MailboxStruct_PC
CanConfigSet_PC_HOH_1_NodeUnderTest =
{
CanConf_CanHardwareObject_HOH_1_NodeUnderTest, /* CanObjectId - Holds handle Id */
};
static const struct Can_MailboxStruct_PC
CanConfigSet_PC_HOH_2_NodeUnderTest =
{
CanConf_CanHardwareObject_HOH_2_NodeUnderTest, /* CanObjectId - Holds handle Id */
};
/* List of the Mailboxes */
const struct Can_MailboxStruct_PC
*CanConfigSet_CanHardwareObject_List_PC[CAN_NUM_MAILBOXES] =
{
&CanConfigSet_PC_HOH_0_NodeUnderTest,
&CanConfigSet_PC_HOH_1_NodeUnderTest,
&CanConfigSet_PC_HOH_2_NodeUnderTest,
};
extern CONST(uint32, CAN_CONST)
Can_MCANSSBaseAddr[CAN_MAX_CONTROLLER] =
{
0x40520000U, /* MCU_MCAN0_SS */
0x40560000U, /* MCU_MCAN1_SS*/
0x2700000U, /* MCAN0_SS */
0x2710000U, /* MCAN1_SS*/
0x2720000U, /* MCAN2_SS */
0x2730000U, /* MCAN3_SS */
0x2740000U, /* MCAN4_SS */
0x2750000U, /* MCAN5_SS */
0x2760000U, /* MCAN6_SS */
0x2770000U, /* MCAN7_SS */
0x2780000U, /* MCAN8_SS*/
0x2790000U, /* MCAN9_SS*/
0x27a0000U, /* MCAN10_SS */
0x27b0000U, /* MCAN11_SS */
0x27c0000U, /* MCAN12_SS*/
0x27d0000U, /* MCAN13_SS */
};
extern CONST(uint32, CAN_CONST)
Can_MCANCoreRegBaseAddr[CAN_MAX_CONTROLLER] =
{
0x40528000U, /* MCU_MCAN0_CFG */
0x40568000U, /* MCU_MCAN1_CFG*/
0x2701000U, /* MCAN0_CFG */
0x2711000U, /* MCAN1_CFG*/
0x2721000U, /* MCAN2_CFG */
0x2731000U, /* MCAN3_CFG */
0x2741000U, /* MCAN4_CFG */
0x2751000U, /* MCAN5_CFG */
0x2761000U, /* MCAN6_CFG */
0x2771000U, /* MCAN7_CFG */
0x2781000U, /* MCAN8_CFG*/
0x2791000U, /* MCAN9_CFG*/
0x27a1000U, /* MCAN10_CFG */
0x27b1000U, /* MCAN11_CFG */
0x27c1000U, /* MCAN12_CFG*/
0x27d1000U, /* MCAN13_CFG */
};
extern CONST(uint32, CAN_CONST)
Can_MCANECCAggrRegBaseAddr[CAN_MAX_CONTROLLER] =
{
0x40700000U, /* MCU_MCAN0_ECC_AGGR */
0x40701000U, /* MCU_MCAN1_ECC_AGGR*/
0x2A78000U, /* MCAN0_ECC_AGGR */
0x2A79000U, /* MCAN1_ECC_AGGR */
0x2A7A000U, /* MCAN2_ECC_AGGR*/
0x2A7B000U, /* MCAN3_ECC_AGGR */
0x2A7C000U, /* MCAN4_ECC_AGGR */
0x2A7D000U, /* MCAN5_ECC_AGGR */
0x2A7E000U, /* MCAN6_ECC_AGGR */
0x2A7F000U, /* MCAN7_ECC_AGGR */
0x2A40000U, /* MCAN8_ECC_AGGR */
0x2A41000U, /* MCAN9_ECC_AGGR*/
0x2A42000U, /* MCAN10_ECC_AGGR*/
0x2A43000U, /* MCAN11_ECC_AGGR */
0x2A44000U, /* MCAN12_ECC_AGGR */
0x2A45000U, /* MCAN13_ECC_AGGR*/
};
#define CAN_STOP_SEC_CONFIG_DATA
#include "Can_MemMap.h"
/* ========================================================================== */
/* Function Definitions */
/* ========================================================================== */
/*******************************************************************************
* End of File: Can_Cfg.c
******************************************************************************/
/*
*
* Copyright (c) 2023 Texas Instruments Incorporated
*
* All rights reserved not granted herein.
*
* Limited License.
*
* Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
* license under copyrights and patents it now or hereafter owns or controls to make,
* have made, use, import, offer to sell and sell ("Utilize") this software subject to the
* terms herein. With respect to the foregoing patent license, such license is granted
* solely to the extent that any such patent is necessary to Utilize the software alone.
* The patent license shall not apply to any combinations which include this software,
* other than combinations with devices manufactured by or for TI ("TI Devices").
* No hardware patent is licensed hereunder.
*
* Redistributions must preserve existing copyright notices and reproduce this license
* (including the above copyright notice and the disclaimer and (if applicable) source
* code license limitations below) in the documentation and/or other materials provided
* with the distribution
*
* Redistribution and use in binary form, without modification, are permitted provided
* that the following conditions are met:
*
* * No reverse engineering, decompilation, or disassembly of this software is
* permitted with respect to any software provided in binary form.
*
* * any redistribution and use are licensed by TI for use only with TI Devices.
*
* * Nothing shall obligate TI to provide you with source code for the software
* licensed and provided to you in object code.
*
* If software source code is provided to you, modification and redistribution of the
* source code are permitted provided that the following conditions are met:
*
* * any redistribution and use of the source code, including any resulting derivative
* works, are licensed by TI for use only with TI Devices.
*
* * any redistribution and use of any object code compiled from the source code
* and any resulting derivative works, are licensed by TI for use only with TI Devices.
*
* Neither the name of Texas Instruments Incorporated nor the names of its suppliers
*
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* DISCLAIMER.
*
* THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
Note: Elektrobit Automotive GmbH modified the original code provided
by the third party supplier. The modification is provided for
convenience.
Please use the modification on your discretion and account, or
use the unmodified files provided with this distribution.
Please see for the reasons in the file ImportantNotes.txt for tag
ASCTI-353 Code Compilation error for CAN driver
*/
/*
* Design: MCAL-5949
*/
/***************************************************************************
Project: ToolInt_ConTest_CanAs_CanIf_Can_Red_1
Date : 2024-06-24 07:54:50
This file is generated by EB Tresos
Do not modify this file, otherwise the software may behave in unexpected way.
*****************************************************************************/
/*******************************************************************************
* INCLUDES
******************************************************************************/
#include "Can.h"
#include "Can_Cfg.h"
/* Version checking */
#if ((CAN_SW_MAJOR_VERSION != (9U))||(CAN_SW_MINOR_VERSION != (0U)))
#error "Version numbers of Can_PBcfg.c and Can.h are inconsistent!"
#endif
/*******************************************************************************
* GLOBAL DATA
******************************************************************************/
#define CAN_START_SEC_CONFIG_DATA
#include "Can_MemMap.h"
/* Baud Rate Structure for all configsets */
static Can_BaudConfigType
CanConfigSet_NodeUnderTest_CanControllerBaudrateConfig =
{
500U, /* in Kbps */
1U, /* Prop Segement value */
7U, /* Phase Segment 1 */
7U, /* Phase Segment 2 */
4U, /* Sync jump width */
19U, /* Sum of all timing parameters */
10U, /* Controller BRP value for Baud */
};
/*List of the Baudrate structures */
static Can_BaudConfigType
*CanConfigSet_NodeUnderTest_BaudRateConfigList[]=
{
&CanConfigSet_NodeUnderTest_CanControllerBaudrateConfig,
};
/* Controller structure defined here for all config sets */
static Can_ControllerType
CanConfigSet_NodeUnderTest =
{
&CanConfigSet_NodeUnderTest_CanControllerBaudrateConfig, /* pointer to default Baud structure */
CanConfigSet_NodeUnderTest_BaudRateConfigList, /* List of available Baudrate structs */
};
/*List of the Controller structures */
static Can_ControllerType
*CanConfigSet_CanController_List[]=
{
&CanConfigSet_NodeUnderTest,
};
/* HW Filter structure for all configsets */
static Can_HwFilterType
CanConfigSet_HOH_0_NodeUnderTest_CanHwFilter =
{
251723520U, /*CanHwFilterCode*/
536805375U, /*Filter Mask*/
};
static Can_HwFilterType
CanConfigSet_HOH_1_NodeUnderTest_CanHwFilter =
{
787U, /*CanHwFilterCode*/
2015U, /*Filter Mask*/
};
/*List of the HW Filter structures */
static Can_HwFilterType
*CanConfigSet_HOH_0_NodeUnderTest_HwFilterConfigList[]=
{
&CanConfigSet_HOH_0_NodeUnderTest_CanHwFilter,
};
static Can_HwFilterType
*CanConfigSet_HOH_1_NodeUnderTest_HwFilterConfigList[]=
{
&CanConfigSet_HOH_1_NodeUnderTest_CanHwFilter,
};
/* All the Mailbox objects(MB's) will be defined here for all config sets */
static Can_MailboxType
CanConfigSet_HOH_0_NodeUnderTest =
{
1U, /* CanHandleType 0=Full, 1=Basic */
1U, /* CanIdType 0=standard 1=Extended 2=Mixed*/
0U, /* HwHandle i.e Mailbox - Hw object in the controller */
2U, /* Length of the Mailbox */
CAN_MAILBOX_DIRECTION_RX, /* CanObjectType - Direction of Mailbox*/
&CanConfigSet_PC_NodeUnderTest, /* Controller */
CanConfigSet_HOH_0_NodeUnderTest_HwFilterConfigList, /* List of HW Filter structs */
1U, /* Hw Filter Count */
0U, /* Padding value for CAN FD message */
(boolean)FALSE, /* CanHardwareObjectUsesPolling */
};
static Can_MailboxType
CanConfigSet_HOH_1_NodeUnderTest =
{
1U, /* CanHandleType 0=Full, 1=Basic */
0U, /* CanIdType 0=standard 1=Extended 2=Mixed*/
0U, /* HwHandle i.e Mailbox - Hw object in the controller */
2U, /* Length of the Mailbox */
CAN_MAILBOX_DIRECTION_RX, /* CanObjectType - Direction of Mailbox*/
&CanConfigSet_PC_NodeUnderTest, /* Controller */
CanConfigSet_HOH_1_NodeUnderTest_HwFilterConfigList, /* List of HW Filter structs */
1U, /* Hw Filter Count */
0U, /* Padding value for CAN FD message */
(boolean)FALSE, /* CanHardwareObjectUsesPolling */
};
static Can_MailboxType
CanConfigSet_HOH_2_NodeUnderTest =
{
0U, /* CanHandleType 0=Full, 1=Basic */
0U, /* CanIdType 0=standard 1=Extended 2=Mixed*/
0U, /* HwHandle i.e Mailbox - Hw object in the controller */
1U, /* Length of the Mailbox */
CAN_MAILBOX_DIRECTION_TX, /* CanObjectType - Direction of Mailbox*/
&CanConfigSet_PC_NodeUnderTest, /* Controller */
NULL_PTR, /* List of HW Filter structs */
0U, /* Hw Filter Count */
0U, /* Padding value for CAN FD message */
(boolean)FALSE, /* CanHardwareObjectUsesPolling */
};
/* List of the Mailboxes */
static Can_MailboxType
*CanConfigSet_CanHardwareObject_List[] =
{
&CanConfigSet_HOH_0_NodeUnderTest,
&CanConfigSet_HOH_1_NodeUnderTest,
&CanConfigSet_HOH_2_NodeUnderTest,
};
extern CONST(uint32, CAN_CONST)
Can_MsgmemRAMBaseAddr[CAN_MAX_CONTROLLER] =
{
0x40500000U, /* MCU MCAN0 */
0x40540000U, /* MCU MCAN1 */
0x2708000U, /* Main MCAN0 */
0x2718000U, /* Main MCAN1 */
0x2728000U, /* Main MCAN2 */
0x2738000U, /* Main MCAN3 */
0x2748000U, /* Main MCAN4 */
0x2758000U, /* Main MCAN5 */
0x2768000U, /* Main MCAN6 */
0x2778000U, /* Main MCAN7 */
0x2788000U, /* Main MCAN8 */
0x2798000U, /* Main MCAN9 */
0x27a8000U, /* Main MCAN10 */
0x27b8000U, /* Main MCAN11 */
0x27c8000U, /* Main MCAN12 */
0x27d8000U, /* Main MCAN13 */
};
#define CAN_STOP_SEC_CONFIG_DATA
#include "Can_MemMap.h"
/* ========================================================================== */
/* Function Definitions */
/* ========================================================================== */
#define CAN_START_SEC_ISR_CODE
#include "Can_MemMap.h"
ISR(Can_0_Int0ISR)
{
Can_IntISR_Function(CAN_CONTROLLER_INSTANCE_MCU_MCAN0, 0x40500000U);
}
#define CAN_STOP_SEC_ISR_CODE
#include "Can_MemMap.h"
#define CAN_START_SEC_CONFIG_DATA
#include "Can_MemMap.h"
/*Can Config struct */
const struct Can_ConfigType_s CanConfigSet =
{
CanConfigSet_CanController_List, /* Controller List Pointer */
(1U), /* max Controllers */
CanConfigSet_CanHardwareObject_List, /* Mailbox List Pointer */
(3U),/* total number of mail boxes in this configset */
.MaxBaudConfigID =
{
[0] = 0U
}, /* Baud rate structure id */
NULL_PTR, /* Reserved Param used for future use */
};
#define CAN_STOP_SEC_CONFIG_DATA
#include "Can_MemMap.h"
/*******************************************************************************
* End of File: Can_PBcfg.c
******************************************************************************/