Hi team,
we ran our application using TI-RTOS (sdk 7.03) which ran successfully, but when we migrated and using Freetos (8.02 sdk) our application is running too slow, but we are using same DDR memory, could you help us with this. I am adding our main.c file for your reference to compare with 7.03 and 8.02 sdk.
#our tirtos main file-
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*============================== INCLUSIONS =============================*/
/* XDCtools Header files*/
#include "Data_Types.h"
#include <xdc/std.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/csl/arch/csl_arch.h>
#include <ti/csl/soc.h>
#include <ti/csl/cslr.h>
#include <ti/osal/osal.h>
#include <ti/osal/TaskP.h>
#include <ti/osal/TimerP.h>
#include "Main_Startup.h"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
/*============================== INCLUSIONS =============================*/ /* XDCtools Header files*/ #include "Data_Types.h" #include <xdc/std.h> #include <xdc/runtime/Error.h> #include <xdc/runtime/System.h> /* BIOS Header files */ #include <ti/sysbios/BIOS.h> #include <ti/sysbios/knl/Task.h> #include <ti/sysbios/knl/Clock.h> #include <ti/csl/arch/csl_arch.h> #include <ti/csl/soc.h> #include <ti/csl/cslr.h> #include <ti/osal/osal.h> #include <ti/osal/TaskP.h> #include <ti/osal/TimerP.h> #include "Main_Startup.h" #include "swc_SystemSignalAdapter_main.h" #include "Can.h" #include "Com.h" #include "PduR.h" #include "CanIf.h" #include "IpduM.h" #include "AP_Function_Component.h" #include "AP_JI2019_StradVision.h" #include "AP_Generic_Perception_Interface_100ms.h" #include "AP_ADAS_Generic_Interface_10ms.h" #include "AP_Generic_Perception_Interface_5ms.h" //#include "AP_VizAD_Interface_100ms.h" #include "VizAD_AP_Interface_100ms.h" #include "SensorFusion.h" #include "ParkingSpaceFiltering.h" #include "AP_ADAS_Generic_Interface_Types.h" #include "mcu_timer_multicore.h" #include "rte_abs_SystemSignalAdapter.h" #if (defined (BUILD_MCU1_0) && (defined (SOC_J721E) || defined (SOC_J7200))) #include <ti/drv/sciclient/sciserver_tirtos.h> #endif /* ========================================================================== */ /* Macros & Typedefs */ /* ========================================================================== */ /* Test application stack size */ #define APP_TASK_STACK (512U * 1024U) //#define APP_TASK_STACK (24U * 1024U) /**< Stack required for the stack */ #define ONE_MS_TASK_NAME_SAP ("ApplicationTask1ms_TaskFunction_SAP") #define ONE_MS_TASK_NAME_CAN ("ApplicationTask1ms_TaskFunction_CAN") #define FIVE_MS_TASK_NAME ("ApplicationTask5ms_TaskFunction") #define TEN_MS_TASK_NAME ("ApplicationTask10ms_TaskFunction") #define FIFTY_MS_TASK_NAME ("ApplicationTask50ms_TaskFunction") #define SIXTY_MS_TASK_NAME ("ApplicationTask60ms_TaskFunction") #define HUNDRED_MS_TASK_NAME ("ApplicationTask100ms_TaskFunction") #define TWOHUNDRED_MS_TASK_NAME ("ApplicationTask200ms_TaskFunction") /* Clock_tickPeriod is in units of usecs */ #define ONE_MS_TIMEOUT (uint32)1000 #define FOUR_MS_TIMEOUT (uint32)4000 #define FIVE_MS_TIMEOUT (uint32)5000 #define TEN_MS_TIMEOUT (uint32)10000 #define FIFTY_MS_TIMEOUT (uint32)50000 #define SIXTY_MS_TIMEOUT (uint32)60000 #define HUNDRED_MS_TIMEOUT (uint32)100000 #define TWOHUNDRED_MS_TIMEOUT (uint32)200000 #define INFINITE (1U) /* ========================================================================== */ /* Structure Declarations */ /* ========================================================================== */ /* None */ /* ========================================================================== */ /* Function Declarations */ /* ========================================================================== */ static Void ApplicationTask1ms_TaskFunction_SAP(UArg a0, UArg a1); static Void ApplicationTask1ms_TaskFunction_CAN(UArg a0, UArg a1); static Void ApplicationTask5ms_TaskFunction(UArg a0, UArg a1); static Void ApplicationTask10ms_TaskFunction(UArg a0, UArg a1); static Void ApplicationTask50ms_TaskFunction(UArg a0, UArg a1); static Void ApplicationTask60ms_TaskFunction(UArg a0, UArg a1); static Void ApplicationTask100ms_TaskFunction(UArg a0, UArg a1); static Void ApplicationTask200ms_TaskFunction(UArg a0, UArg a1); static void Task_Periodicity(uint32 usec); sint32 SetupSciServer(void); static void Initialise_Bsw(void); /* ========================================================================== */ /* Global Variables */ /* ========================================================================== */ /* application stack */ static uint8_t ApplicationTask1ms_TaskStack_SAP[APP_TASK_STACK] __attribute__((aligned(32))); static uint8_t ApplicationTask1ms_TaskStack_CAN[APP_TASK_STACK] __attribute__((aligned(32))); static uint8_t ApplicationTask5ms_TaskStack[APP_TASK_STACK] __attribute__((aligned(32))); static uint8_t ApplicationTask10ms_TaskStack[APP_TASK_STACK] __attribute__((aligned(32))); static uint8_t ApplicationTask50ms_TaskStack[APP_TASK_STACK] __attribute__((aligned(32))); static uint8_t ApplicationTask60ms_TaskStack[APP_TASK_STACK] __attribute__((aligned(32))); static uint8_t ApplicationTask100ms_TaskStack[APP_TASK_STACK] __attribute__((aligned(32))); static uint8_t ApplicationTask200ms_TaskStack[APP_TASK_STACK] __attribute__((aligned(32))); /* ========================================================================== */ /* External Variables */ /* ========================================================================== */ /* ========================================================================== */ /* Function Definitions */ /* ========================================================================== */ int main(void) { Task_Handle task; Error_Block eb; Task_Params taskParams_1ms_SAP; Task_Params taskParams_1ms_CAN; Task_Params taskParams_5ms; Task_Params taskParams_10ms; Task_Params taskParams_50ms; Task_Params taskParams_60ms; Task_Params taskParams_100ms; Task_Params taskParams_200ms; sint32 ret = CSL_PASS; AppUtils_Init(); /* Initialize SCI Client Server */ ret = SetupSciServer(); if(ret != CSL_PASS) { BIOS_exit(0); } Main_Startup(); Main_PowerAndClkSrc(); Main_PlatformInit(); mcu_timer_init(); Initialise_Bsw(); Error_init(&eb); #if 0 /* Initialize the 5ms application and BSW task parameters*/ Task_Params_init(&taskParams_1ms_SAP); taskParams_1ms_SAP.instance->name = ONE_MS_TASK_NAME_SAP; /* Set the task priority higher than the default priority (1) */ /*Set priority*/ taskParams_1ms_SAP.priority = 7;//2; taskParams_1ms_SAP.stack = ApplicationTask1ms_TaskStack_SAP; taskParams_1ms_SAP.stackSize = sizeof (ApplicationTask1ms_TaskStack_SAP); task = Task_create(ApplicationTask1ms_TaskFunction_SAP, &taskParams_1ms_SAP, &eb); if(NULL == task) { BIOS_exit(0); } #endif /* Initialize the 5ms application and BSW task parameters*/ Task_Params_init(&taskParams_1ms_CAN); taskParams_1ms_CAN.instance->name = ONE_MS_TASK_NAME_CAN; /* Set the task priority higher than the default priority (1) */ /*Set priority*/ taskParams_1ms_CAN.priority = 6;//2; taskParams_1ms_CAN.stack = ApplicationTask1ms_TaskStack_CAN; taskParams_1ms_CAN.stackSize = sizeof (ApplicationTask1ms_TaskStack_CAN); task = Task_create(ApplicationTask1ms_TaskFunction_CAN, &taskParams_1ms_CAN, &eb); if(NULL == task) { BIOS_exit(0); } #if 0 /* Initialize the 5ms application and BSW task parameters*/ Task_Params_init(&taskParams_5ms); taskParams_5ms.instance->name = FIVE_MS_TASK_NAME; /* Set the task priority higher than the default priority (1) */ /*Set priority*/ taskParams_5ms.priority = 7;//2; taskParams_5ms.stack = ApplicationTask5ms_TaskStack; taskParams_5ms.stackSize = sizeof (ApplicationTask5ms_TaskStack); task = Task_create(ApplicationTask5ms_TaskFunction, &taskParams_5ms, &eb); if(NULL == task) { BIOS_exit(0); } /* Initialize the 10ms application and BSW task parameters*/ Task_Params_init(&taskParams_10ms); taskParams_10ms.instance->name = TEN_MS_TASK_NAME; /* Set the task priority higher than the default priority (1) */ /*Set priority*/ taskParams_10ms.priority = 8;//3; taskParams_10ms.stack = ApplicationTask10ms_TaskStack; taskParams_10ms.stackSize = sizeof (ApplicationTask10ms_TaskStack); task = Task_create(ApplicationTask10ms_TaskFunction, &taskParams_10ms, &eb); if(NULL == task) { BIOS_exit(0); } /* Initialize the 50ms application and BSW task parameters*/ Task_Params_init(&taskParams_50ms); taskParams_50ms.instance->name = FIFTY_MS_TASK_NAME; /* Set the task priority higher than the default priority (1) */ /*Set priority*/ taskParams_50ms.priority = 9;//4; taskParams_50ms.stack = ApplicationTask50ms_TaskStack; taskParams_50ms.stackSize = sizeof (ApplicationTask50ms_TaskStack); task = Task_create(ApplicationTask50ms_TaskFunction, &taskParams_50ms, &eb); if(NULL == task) { BIOS_exit(0); } /* Initialize the 100ms application and BSW task parameters*/ Task_Params_init(&taskParams_100ms); taskParams_100ms.instance->name = HUNDRED_MS_TASK_NAME; /* Set the task priority higher than the default priority (1) */ /*Set priority*/ taskParams_100ms.priority = 10;//5; taskParams_100ms.stack = ApplicationTask100ms_TaskStack; taskParams_100ms.stackSize = sizeof (ApplicationTask100ms_TaskStack); task = Task_create(ApplicationTask100ms_TaskFunction, &taskParams_100ms, &eb); if(NULL == task) { BIOS_exit(0); } /* Initialize the 100ms application and BSW task parameters*/ Task_Params_init(&taskParams_60ms); taskParams_60ms.instance->name = SIXTY_MS_TASK_NAME; /* Set the task priority higher than the default priority (1) */ /*Set priority*/ taskParams_60ms.priority = 10;//5; taskParams_60ms.stack = ApplicationTask60ms_TaskStack; taskParams_60ms.stackSize = sizeof (ApplicationTask60ms_TaskStack); task = Task_create(ApplicationTask60ms_TaskFunction, &taskParams_60ms, &eb); if(NULL == task) { BIOS_exit(0); } /* Initialize the 200ms application and BSW task parameters*/ Task_Params_init(&taskParams_200ms); taskParams_200ms.instance->name = TWOHUNDRED_MS_TASK_NAME; /* Set the task priority higher than the default priority (1) */ /*Set priority*/ taskParams_200ms.priority = 10;//5; taskParams_200ms.stack = ApplicationTask200ms_TaskStack; taskParams_200ms.stackSize = sizeof (ApplicationTask200ms_TaskStack); task = Task_create(ApplicationTask200ms_TaskFunction, &taskParams_200ms, &eb); if(NULL == task) { BIOS_exit(0); } #endif BIOS_start(); /* does not return */ return(0); } static Void ApplicationTask5ms_TaskFunction(UArg a0, UArg a1) { while(INFINITE) { Task_Periodicity(FIVE_MS_TIMEOUT); } } static Void ApplicationTask1ms_TaskFunction_CAN(UArg a0, UArg a1) { float start,end,t_ms=0; static float t1_min=1000; static float t1_max=0; static uint16 printcnt=0; AppUtils_Printf(MSG_NORMAL, "test multislot_2 \r\n"); while(INFINITE) { /*CAN Driver periodic Tx function*/ Can_MainFunction_Write(); /*CAN Driver periodic Rx function*/ Can_MainFunction_Read(); /*CAN Driver periodic mode change function*/ Can_MainFunction_Mode(); /*IPDU Multiplexer periodic Rx function*/ IpduM_MainFunctionRx(); /*COM periodic Rx function*/ Com_MainFunctionRx(); /*COM periodic Tx function*/ Com_MainFunctionTx(); //start=TimerP_getTimeInUsecs(); /* end=TimerP_getTimeInUsecs(); t_ms = (end - start)/1000; if(t_ms> t1_max) { t1_max = t_ms; } if(t_ms < t1_min) { t1_min = t_ms; } */ SAPJI2019SV1(); /*SystemSignalAdapter swc CAN signal read function. Reads perception and vehicle CAN signal with 5ms periodicity*/ swc_SystemSignalAdapter_readtask_5ms(); /*SystemSignalAdapter swc CAN signal write function. Sends perception and vehicle CAN signal with 5ms periodicity*/ swc_SystemSignalAdapter_writetask_5ms(); // Task_Periodicity(ONE_MS_TIMEOUT); } } static Void ApplicationTask1ms_TaskFunction_SAP(UArg a0, UArg a1) { { Task_Periodicity(ONE_MS_TIMEOUT); } } static Void ApplicationTask60ms_TaskFunction(UArg a0, UArg a1) { while(INFINITE) { Task_Periodicity(SIXTY_MS_TIMEOUT); } } static Void ApplicationTask10ms_TaskFunction(UArg a0, UArg a1) { while(INFINITE) { Task_Periodicity(TEN_MS_TIMEOUT); } } static Void ApplicationTask50ms_TaskFunction(UArg a0, UArg a1) { while(INFINITE) { Task_Periodicity(FIFTY_MS_TIMEOUT); } } static Void ApplicationTask100ms_TaskFunction(UArg a0, UArg a1) { while(INFINITE) { Task_Periodicity(HUNDRED_MS_TIMEOUT); } } static Void ApplicationTask200ms_TaskFunction(UArg a0, UArg a1) { while(INFINITE) { Task_Periodicity(TWOHUNDRED_MS_TIMEOUT); } } sint32 SetupSciServer(void) { sint32 ret = CSL_PASS; #if (defined (BUILD_MCU1_0) && (defined (SOC_J721E) || defined (SOC_J7200))) Sciserver_TirtosCfgPrms_t appPrms; Sciclient_ConfigPrms_t clientPrms; appPrms.taskPriority[SCISERVER_TASK_USER_LO] = 1; appPrms.taskPriority[SCISERVER_TASK_USER_HI] = 4; /* Sciclient needs to be initialized before Sciserver. Sciserver depends on * Sciclient API to execute message forwarding */ ret = Sciclient_configPrmsInit(&clientPrms); if (ret == CSL_PASS) { ret = Sciclient_init(&clientPrms); } if (ret == CSL_PASS) { ret = Sciserver_tirtosInit(&appPrms); } if (ret == CSL_PASS) { AppUtils_Printf(MSG_NORMAL, "Starting Sciserver..... PASSED\n"); } else { AppUtils_Printf(MSG_NORMAL, "Starting Sciserver..... FAILED\n"); } #endif return ret; } static void Initialise_Bsw(void) { Std_ReturnType ret; uint8 IpduGroup_Vector[1]; IpduGroup_Vector[0] = 0xFF; CanIf_Init(); ret = CanIf_SetControllerMode(0U, CAN_CS_STARTED); if(E_OK != ret) { AppUtils_Printf(MSG_NORMAL, "Failed to start the CAN0 Driver\n"); } ret = CanIf_SetControllerMode(1U, CAN_CS_STARTED); if(E_OK != ret) { AppUtils_Printf(MSG_NORMAL, "Failed to start the CAN1 Driver\n"); } ret = CanIf_SetPduMode(0U, CANIF_ONLINE); if(E_OK != ret) { AppUtils_Printf(MSG_NORMAL, "Failed to set the PDU mode Controller 0\n"); } ret = CanIf_SetPduMode(1U, CANIF_ONLINE); if(E_OK != ret) { AppUtils_Printf(MSG_NORMAL, "Failed to set the PDU mode Controller 1\n"); } PduR_Init(); IpduM_Init(); Com_Init(); //COM_PDUGRPVECTOR_ARRAYSIZE Com_IpduGroupControl(IpduGroup_Vector,TRUE); // AP_Function_Component_Frame(); } static void Task_Periodicity(uint32 usec) { uint32 timeout; /* usec must be less than 1000000 if (usec >= 1000000) { errno = EINVAL; return (-1); }*/ /* Implementations may place limitations on the granularity of timer * values. For each interval timer, if the requested timer value requires * a finer granularity than the implementation supports, the actual timer * value shall be rounded up to the next supported value. */ AppUtils_Printf("Clock_tickPeriod = %d \n",Clock_tickPeriod); /* Clock_tickPeriod is the Clock period in microseconds */ timeout = (uint32)((usec + Clock_tickPeriod - 1) / Clock_tickPeriod); AppUtils_Printf("timout = %d \n",timeout); /* must add one tick to ensure a full duration of timeout ticks */ Task_sleep(timeout); }
#our Freetos main file-
:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
*
* Copyright (c) 2019-2020 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
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
/* * * Copyright (c) 2019-2020 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. * */ /** * \file can_profile.h.c * * \brief Main file for TI-RTOS build */ /* ========================================================================== */ /* Include Files */ /* ========================================================================== */ #include <ti/csl/arch/csl_arch.h> #include <ti/csl/soc.h> #include <ti/csl/cslr.h> #include <ti/csl/tistdtypes.h> #include <ti/osal/osal.h> #include <ti/osal/TaskP.h> #include "CanApp_Startup.h" #include "can_profile.h" #include "CanIf.h" #include "Can.h" #include "Com.h" #include "PduR.h" #include "CanIf.h" #include "IpduM.h" #include "AP_Function_Component.h" #include "AP_JI2019_StradVision.h" #include "AP_Generic_Perception_Interface_100ms.h" #include "AP_ADAS_Generic_Interface_10ms.h" #include "AP_Generic_Perception_Interface_5ms.h" #include "VizAD_AP_Interface_100ms.h" #include "SensorFusion.h" #include "ParkingSpaceFiltering.h" #include "AP_ADAS_Generic_Interface_Types.h" #include "swc_SystemSignalAdapter_main.h" #if (defined (BUILD_MCU1_0) && (defined (SOC_J721E) || defined (SOC_J7200))) #include <ti/drv/sciclient/sciserver_tirtos.h> #endif /* ========================================================================== */ /* Macros & Typedefs */ /* ========================================================================== */ /* Test application stack size */ #define APP_TASK_STACK (512U * 1024U) //#define APP_TASK_STACK (10U * 1024U) /**< Stack required for the stack */ #define CAN_PROFILE_DEMO_TASK_NAME ("CAN PROFILE") /**< Task name */ /* Clock_tickPeriod is in units of usecs */ #define ONE_MS_TIMEOUT (uint32)1000 #define INFINITE (1U) /* ========================================================================== */ /* Structure Declarations */ /* ========================================================================== */ /* None */ /* ==========================================================================*/ /* Function Declarations */ /* ========================================================================== */ static void CanApp_TaskFxn(void* a0, void* a1); //static void CanApp_Shutdown(void); sint32 SetupSciServer(void); /* ========================================================================== */ /* Global Variables */ /* ========================================================================== */ /* application stack */ static uint8_t CanApp_TaskStack[APP_TASK_STACK] __attribute__((aligned(32))); /**< Stack for the task */ static canAppTaskObj_t CanApp_TestPrms; /**< Test parameters */ static HwiP_Handle CanApp_IsrHndls[CAN_MAX_CONTROLLER]; /**< Stores the ISR handles */ extern SemaphoreP_Handle CanIf_TxConfirmationSemaphore; /**< TX Confirmation semaphore, would be posted when TX completes */ extern SemaphoreP_Handle CanIf_RxConfirmationSemaphore; /**< Rx Confirmation semaphore, would be posted when TX completes */ /* ========================================================================== */ /* External Variables */ /* ========================================================================== */ extern uint32 CanIf_DrvStatus; /**< CAN IF Driver Status, defined in CanIf.c */ /* ========================================================================== */ /* Function Definitions */ /* ========================================================================== */ int main(void) { TaskP_Handle task; TaskP_Params taskParams; sint32 ret = CSL_PASS; uint8 IpduGroup_Vector[1]; IpduGroup_Vector[0] = 0xFF; OS_init(); AppUtils_Init(); /* Initialize SCI Client Server */ ret = SetupSciServer(); if(ret != CSL_PASS) { OS_stop(); } CanApp_Startup(); CanApp_PowerAndClkSrc(); CanApp_PlatformInit(); /* Initialize dummy CAN IF */ CanIf_Init(); ret = CanIf_SetControllerMode(0U, CAN_CS_STARTED); if(E_OK != ret) { AppUtils_Printf(MSG_NORMAL, "Failed to start the CAN0 Driver\n"); } ret = CanIf_SetControllerMode(1U, CAN_CS_STARTED); if(E_OK != ret) { AppUtils_Printf(MSG_NORMAL, "Failed to start the CAN1 Driver\n"); } ret = CanIf_SetPduMode(0U, CANIF_ONLINE); if(E_OK != ret) { AppUtils_Printf(MSG_NORMAL, "Failed to set the PDU mode Controller 0\n"); } ret = CanIf_SetPduMode(1U, CANIF_ONLINE); if(E_OK != ret) { AppUtils_Printf(MSG_NORMAL, "Failed to set the PDU mode Controller 1\n"); } PduR_Init(); IpduM_Init(); Com_Init(); //COM_PDUGRPVECTOR_ARRAYSIZE Com_IpduGroupControl(IpduGroup_Vector,TRUE); /* Initialize the task params */ TaskP_Params_init(&taskParams); //taskParams.instance->name = CAN_PROFILE_DEMO_TASK_NAME; /* Set the task priority higher than the default priority (1) */ taskParams.priority = 2; taskParams.stack = CanApp_TaskStack; taskParams.stacksize = sizeof (CanApp_TaskStack); task = TaskP_create(CanApp_TaskFxn, &taskParams); if(NULL == task) { OS_stop(); } OS_start(); /* does not return */ return(0); } static void CanApp_TaskFxn(void* a0, void* a1) { AppUtils_Printf(MSG_NORMAL, "TEST SSA TX msgs\n"); while(INFINITE) { /*CAN Driver periodic Tx function*/ Can_MainFunction_Write(); /*CAN Driver periodic Rx function*/ Can_MainFunction_Read(); /*CAN Driver periodic mode change function*/ Can_MainFunction_Mode(); /*IPDU Multiplexer periodic Rx function*/ IpduM_MainFunctionRx(); /*COM periodic Rx function*/ Com_MainFunctionRx(); /*COM periodic Tx function*/ Com_MainFunctionTx(); SAPJI2019SV1(); /*SystemSignalAdapter swc CAN signal read function. Reads perception and vehicle CAN signal with 5ms periodicity*/ swc_SystemSignalAdapter_readtask_5ms(); /*SystemSignalAdapter swc CAN signal write function. Sends perception and vehicle CAN signal with 5ms periodicity*/ swc_SystemSignalAdapter_writetask_5ms(); } return; } /* // \brief Application tear down functions static void CanApp_Shutdown(void) { uint32 idx; for (idx = 0U; idx < CAN_MAX_CONTROLLER; idx++) { if (NULL != CanApp_IsrHndls[idx]) { if (HwiP_OK != HwiP_delete(CanApp_IsrHndls[idx])) { AppUtils_Printf(MSG_NORMAL, MSG_APP_NAME " Error!!! Could not De register" " the ISR for instance %d!!!\n", idx); break; } } } if (NULL != CanIf_TxConfirmationSemaphore) { SemaphoreP_delete(CanIf_TxConfirmationSemaphore); if (NULL != CanIf_RxConfirmationSemaphore) { SemaphoreP_delete(CanIf_RxConfirmationSemaphore); } } return; } */ sint32 SetupSciServer(void) { sint32 ret = CSL_PASS; #if (defined (BUILD_MCU1_0) && (defined (SOC_J721E) || defined (SOC_J7200))) Sciserver_TirtosCfgPrms_t appPrms; Sciclient_ConfigPrms_t clientPrms; appPrms.taskPriority[SCISERVER_TASK_USER_LO] = 1; appPrms.taskPriority[SCISERVER_TASK_USER_HI] = 4; /* Sciclient needs to be initialized before Sciserver. Sciserver depends on * Sciclient API to execute message forwarding */ ret = Sciclient_configPrmsInit(&clientPrms); if (ret == CSL_PASS) { ret = Sciclient_init(&clientPrms); } if (ret == CSL_PASS) { ret = Sciserver_tirtosInit(&appPrms); } if (ret == CSL_PASS) { AppUtils_Printf(MSG_NORMAL, "Starting Sciserver..... PASSED\n"); } else { AppUtils_Printf(MSG_NORMAL, "Starting Sciserver..... FAILED\n"); } #endif return ret; }