diff --git a/.cproject b/.cproject
index 60a2aa8..9f39d50 100644
--- a/.cproject
+++ b/.cproject
@@ -380,8 +380,8 @@
-
-
+
+
@@ -400,8 +400,8 @@
diff --git a/Core/Source/ivec_mcal_mcan.c b/Core/Source/ivec_mcal_mcan.c
index 260bd96..0f19a44 100644
--- a/Core/Source/ivec_mcal_mcan.c
+++ b/Core/Source/ivec_mcal_mcan.c
@@ -532,7 +532,7 @@ IVEC_McalCommonErr_e xMCAL_MCANTx(IVEC_McalCanHandle_s* pxCanHandle, uint32_t u3
uint32_t u32Bytes)
{
/* Ensure that the MCAN instance is CANFD0 */
- if((pxCanHandle->pMCAN != CANFD0) && (pxCanHandle->u16Speed == IVEC_MCAL_CAN_BR_500 || pxCanHandle->u16Speed == IVEC_MCAL_CAN_BR_250))
+ if(pxCanHandle->pMCAN != CANFD0)
{
return IVEC_MCAL_STATUS_UNSUPPORTED;
}
@@ -676,8 +676,9 @@ IVEC_McalCommonErr_e xMCAL_MCANGetErrorStatus(IVEC_McalCanHandle_s* pxCanHandle,
DL_MCAN_getErrCounters(CANFD0, &l_xCounter);
/* Return the status based on various error conditions */
- return (
- (g_xHeaderStat.busOffStatus)) ? commonMCAL_FAIL : commonMCAL_SUCCESS;
+
+ return ( (g_xHeaderStat.lastErrCode == DL_MCAN_ERR_CODE_ACK_ERROR) || \
+ (g_xHeaderStat.busOffStatus) ) ? IVEC_MCAL_STATUS_ERROR : IVEC_MCAL_STATUS_SUCCESS;
}
diff --git a/Generated Codes/ti_msp_dl_config.c b/Generated Codes/ti_msp_dl_config.c
index fb4ce78..0370faf 100644
--- a/Generated Codes/ti_msp_dl_config.c
+++ b/Generated Codes/ti_msp_dl_config.c
@@ -110,9 +110,9 @@ SYSCONFIG_WEAK void SYSCFG_DL_initPower(void)
DL_MCAN_reset(MCAN0_INST);
+
DL_GPIO_enablePower(GPIOA);
DL_GPIO_enablePower(GPIOB);
-
// #if UART_PIN_SELECTION == 1
// DL_UART_Main_reset(UART2);
// DL_UART_Main_enablePower(UART2);
diff --git a/ivec_RTE/src/ivec_rte.c b/ivec_RTE/src/ivec_rte.c
index 7ea29ab..0028660 100644
--- a/ivec_RTE/src/ivec_rte.c
+++ b/ivec_RTE/src/ivec_rte.c
@@ -17,8 +17,8 @@
#include "ivec_rte.h"
// UART Handles
-IVEC_EcuUartHandle_s g_xUartHandle;
-IVEC_EcuCANHandle_s g_xCanHandle;
+IVEC_EcuUartHandle_s g_xUartHandle = {0};
+IVEC_EcuCANHandle_s g_xCanHandle = {0};
// Configuration Macros
#define rteCONFIG_BASIL_BATTERY_SMART_u8 1
@@ -26,7 +26,7 @@ IVEC_EcuCANHandle_s g_xCanHandle;
#define rteCONFIG_MOTHER_BOARD_u8 3
// UART Configuration
-#define rteUART_PIN_SELECTION_u8 rteCONFIG_MOTHER_BOARD_u8
+#define rteUART_PIN_SELECTION_u8 rteCONFIG_BASIL_u8
uint8_t g_pu8UartBuffer[ecuUART_MAX_PACKET_LENGTH_u8] = {0};
volatile uint32_t g_u32CanId = 0x1FFFFFFF;
@@ -50,6 +50,7 @@ static uint8_t __gprv_U8Index = 0;
extern ExtU_socTouchDisplay_T socTouchDisplay_U;
extern ExtY_socTouchDisplay_T socTouchDisplay_Y;
+
/**
* @brief Sets the state of the MCU temperature data pin (SDA) for TM1650.
*
@@ -221,6 +222,10 @@ void vRTE_AppInit(void)
#endif
vRTE_InitUartCanEcho();
+ // Uncomment for UART-to-CAN transmission, if required
+// iECU_UartInitiateTransmit(&g_xUartHandle, 0x6, NULL, 0);
+// xECU_WriteDataOverCAN(&g_xCanHandle, NULL , 0x6, 1, 0);
+
#if rteUART_PIN_SELECTION_u8 == 3
vRTE_NfcInit();
@@ -459,6 +464,8 @@ void vRTE_ProcessUartData(void)
l_eRetCode= xECU_UartReadCANDataOverUART(&g_xUartHandle,g_pu8UartBuffer,&l_u32Id);
l_u32Id &= 0x1fffffff;
+ uint16_t l_u16Len = 0;
+
if(l_eRetCode > -1)
{
if(l_eRetCode > 0 && l_u32Id == 0x00)
@@ -545,8 +552,11 @@ void vRTE_ProcessCanData(void)
volatile uint8_t l_u8TxBurstMessages = 0;
while( xECU_CANGetData(&g_xCanHandle, &l_xCanBuff) == commonECU_SUCCESS )
{
+
if( (l_xCanBuff.u32UlId == 0x16) && (l_xCanBuff.u8Data[0] = 'V') && \
- (l_xCanBuff.u8Data[1] == 'E') && (l_xCanBuff.u8Data[2] == 'C'))
+ (l_xCanBuff.u8Data[1] == 'E') && (l_xCanBuff.u8Data[2] == 'C') && \
+ (l_xCanBuff.u8Data[3] == 'I') && (l_xCanBuff.u8Data[4] == 'O') && \
+ (l_xCanBuff.u8Data[5] == 'T'))
{
vMCAL_softReset();
}
diff --git a/main.c b/main.c
index 09f9e73..9181c3f 100644
--- a/main.c
+++ b/main.c
@@ -17,7 +17,6 @@
#include "string.h"
#include "ivec_rte.h"
-//extern McalUartHandle_s g_xUartHandle;
static void vApp_TimerConfig(void)
{
@@ -39,8 +38,7 @@ int main(void)
vApp_TimerConfig();
vRTE_AppInit();
- // Uncomment for UART-to-CAN transmission, if required
- // vECU_InitiateUartToCanTransmit(&g_xUartHandle, 0x6, NULL, 0);
+
while(1)
{