arjun.a
range data
5aefcf4
raw
history blame
18.1 kB
Ticket Name: TDA2PXEVM: TDA2 use-case multithread synchronization between IPU cores
Query Text:
Part Number: TDA2PXEVM Other Parts Discussed in Thread: TDA2, PGA460 Hello. I' trying to do parallel execution of Vision SDK use-cases and CAN messages receiving/transmission on tda2. To do that I create use-case on TDA2 IPU1-0 core and TI RTOS task on IPU1-1 core. They suppose to work parallel, but eventually use-case end up blocked. I want to figure out how TI RTOS tasks on one core can interact with use-cases on another core. Let me walk it throught. On IPU1-1 I'm creating a simple task: int val;
Error_Block eb;
Task_Handle UserTask;
Task_Params UserTaskParams;
#pragma DATA_ALIGN(UserBuffer, 32);
uint8_t UserBuffer[2048];
void User_Task(UArg arg0, UArg arg1)
{
Task_sleep(200);
while (1)
{
val++; /*I also did that with CAN receive/transmit logic*/
}
}
void Ipu11Init(void) {
Error_init(&eb);
Task_Params_init(&UserTaskParams);
UserTaskParams.stackSize = 2048;
UserTaskParams.priority = 1U;
UserTaskParams.affinity = 0x1;
UserTaskParams.stack = &UserBuffer[0];
UserTask = Task_create(User_Task, &UserTaskParams, &eb);
}
Basicly this task do nothing, only incrementing some value. And this task have lowerst priority, so it should take control in the last turn. Also I have an use-case on IPU1-0 core. That use-case code is very big, so I dont really sure where does it blocks. But I have some ideas, I hope you will help me to find out what is happening. If user task on IPU1-1 is running, I cant even init my use-case on IPU1-0 to the end. But if I turn that task off, use-case works great. So inside use-case logic I'm calling some functions which is maybe somehow interact with IPU1-1 core where my user task is running (and I suppose it takes control from that place even it's priority is low?). My first clue is some functions where System link control is calling. For example, usually I stuck after this function was called: /**
*******************************************************************************
*
* \brief Print Memory Heap Statistics
*
* This function send a system control message
* to all cores.
*
*
* \return SYSTEM_LINK_STATUS_SOK on success
*******************************************************************************
*/
Int32 Chains_memPrintHeapStatus()
{
UInt32 procId, linkId;
SystemCommon_PrintStatus printStatus;
memset(&printStatus, 0, sizeof(printStatus));
printStatus.printHeapStatus = TRUE;
for(procId=0; procId<SYSTEM_PROC_MAX; procId++)
{
if(System_isProcEnabled(procId)==FALSE)
continue;
linkId = SYSTEM_MAKE_LINK_ID(procId, SYSTEM_LINK_ID_PROCK_LINK_ID);
System_linkControl(
linkId,
SYSTEM_COMMON_CMD_PRINT_STATUS,
&printStatus,
sizeof(printStatus),
TRUE
);
}
return SYSTEM_LINK_STATUS_SOK;
} This is not the only place where my use-case get stuck, but I suppose the reason of issue can be System_linkControl function. It send control message for all the cores and waiting for acknowledge. If it set waitAck parameter to FALSE it says that this option does not avaliable and set it back to TRUE. There is a lot of futher System_linkControl functions in my use-case, can it be that any of this functions could be a reason of use-case stucking? Is there some way to force my use-case continue to run and what can be other possible reasons for that behaviour? Also, if in user task on IPU1-1 I have some more complicated logic, and use case on IPU1-0 is running, use-case impacting that task, like I can miss messages in queues in that task. And if I dont turn on use-case, task also works great. In total my use-case is responsible for taking real time video from camera and doing some calculations with it, like object recognition. I'm going to make some more logic in user task on IPU1-1, but I cant do that unlit I find out how to make my use-case keep running on IPU1-0 without any interactions with IPU1-1. Please help. Best regards, D.K. Tovmachenko.
Responses:
Hi, I'm on vacation & I will be back on Thursday. Thanks Gaviraju
Hi, Are you running any links on the IPU1_1 ? If yes, Can I which link? Thanks Gaviraju
Hi Gaviraju Sorry for late responce, I was on vacation too. No, I'm not running any links on IPU1_1 at all. IPU1_1 only responsible for managing CAN messages and diagnostics. All links and use-cases are on IPU1_0 right now. But still use-case get blocked somewhere.Maybe you need some use-case code to realize whats happening? For example, there is how use-case starts: gChains_usecaseCfg.captureSrc =
CHAINS_CAPTURE_SRC_IMX224_CSI2;
strncpy(
gChains_usecaseCfg.sensorName,
SENSOR_SONY_IMX224_CSI2,
ISS_SENSORS_MAX_NAME);
gChains_usecaseCfg.displayType = CHAINS_DISPLAY_TYPE_HDMI_720P;
gChains_usecaseCfg.issVtnfEnable = 1;
gChains_usecaseCfg.issLdcEnable = 1;
TIDL(&gChains_usecaseCfg); In TIDL() function calls a lot of functions, for example Chains_memPrintHeapStatus() as I mentioned before. Regards, D.K. Tovmachenko.
I tried to change waitAck flag in System_linkControl to FALSE, to force it not to wait acknowledge message, but it tells me that this function does not supported and changes it back. I also tried to send this command System_linkControl(
0x7f,
0x9004,
NULL,
0xc,
TRUE
); to fix that, but it doesnt work.
Hi, Can you please try to run debug the code using JTAG debugger to find out where it's hung-up? Seems it's blocking in the "System_linkControl" functions because it's waiting for ACK from the IPU1_1. How are you sending the DCAN message to the IPU1_1 core? Is it using the "System_linkControl" function call? Thanks Gaviraju
Hi About CAN messages, right now I'm not sending anything to anywhere. Right now I'm just trying to realise whats's going on, so the only thing which is working on IPU1_1 right now is the task I described above, User_Task. I'm also thincking that the reason of my problem is Ack from the IPU1_1. But I myself dont create any links on IPU1_1. Actually there is some links, I suppose VSDK itself create those links, for example this function: int32_t Chains_linkStatsMonitorInit()
{
SystemLink_registerHandler(Chains_linkStatsMonitorCmdHandler);
return SYSTEM_LINK_STATUS_SOK;
} have been called during the runtime, but I dont know how to understant is it the link I'm waiting Ack message from or not. The only information I have is link ID, I got it from System_linkControl function parameters, this is the link which does not senf Ack message. Besides, in System_linkControl there is a flag waitAck which is responsible for waiting for Ack message. By default it setted as TRUE, and I cant to set it as FALSE. To set it as FALSE it advise me to send System_linkControl command 0x9004 to this link id, but if I send this command, it also waits for acknowledje message and stuck again. How can I resolve it? Dmitriy
Hi, I'm suspecting the issue due to the below changes in the user-task created in the IPU1_1 while (1) { val++; /*I also did that with CAN receive/transmit logic*/ } This is the busy loop added in the task because of this you are not getting the ACK for the IPU1_0. Can you try with the below changes? while (1) { val++; /*I also did that with CAN receive/transmit logic*/ Task_sleep(200); } Thanks Gaviraju
Hi Yes, that was the problem. So as I understand, links work TI RTOS tasks alike, they have priorities as well as TI RTOS tasks and can take control from TI RTOS tasks. Cause I thought System_linkControl works interrupts alike. Now we get to the main problem. If I'm using CAN logic instead of that busy loop, I have opposite situation. When I ocasionly send CAN messages it is OK. But I have a process when CAN used for transmitting a big amount of data. During that process CAN messages rate become pretty hight. And when I run use case on IPU1-0 and that process of data transmission on IPU1-1 simultaniously, I lose CAN messages, and transmission of data fails. I have a certain protocol to check does all the data come or not, and if I lose something I get an error. Does that means that System_linkControl on IPU1-0 somehow takes control from task on IPU1-1, or maybe DCAN driver? CauseI tried to set my CAN logic task priority to 15 and nothing changed. DCAN driver works on IPU1-1 now. I checked, there is no busy loops and System_linkControl functions in the use-case or in the task. Maybe I lose something and cant find a mistake, but is there any other situations when IPU1-1 and IPU1-0 can interact? Because if I run transmission of file throught CAN on IPU1-1 without use-case performing on IPU1-0, everething works well. Best regards, D.K. Tovmachenko.
Hi, Can you share the code implemented in IPU1_1? I want to know how you are processing the data in IPU1_1. If you are transmitting the data from one core to another core use the shared memory. If you have JTAG please use it for debugging to know where it's hung-up. Thanks Gaviraju
Hi, I want to debug, but I started my project in Visual Studio. I have XDS110 probe, and I have already configured target for JTAG debugging in Code Composer, but it cant find source code to debug. I imported VS project to CCS as Existing project into workspace, how can I link debugging with files in Debug folder? Basicly now I have imported project in project explorer and TDA2Px target configuration in Target Configurations. Also I have object files for EVE, DSP and IPU cores. How I suppose to make them work together? For I can use breackepoints in source code while debugging using JTAG? Regards, D.K. Tovmachenko
Hi When I start to debug using JTAG, CCS shows me call stack, but it doesn't show me source code. Actually, I can't build imported project because there are a lot of unresolved types in there. CCS even marks TI-RTOS types like Task_Handle as unresolved, regardless there are all necessary includes. Apparently that is the reason I cant debug throught the source code. Because I have pre-builded object files, but can't compile source code in CCS. How can I import project from Visual Studio properly? We started project in VS, but attached VSDK later, thats why it entirely in VS, so it will take me a lot of time to start new project in CCS to make it work properly. P.S. Maybe I should ask that question as related in the other thread? Regards, D.K. Tovmachenko
Hi, I'm recommending you to build the source code in Debug mode from the command line. Refer to the user-guide:vision_sdk/docs/UserGuides/VisionSDK_UserGuide_TDA2px.pdf Chapter 3.2 Building the application & 3.7 Load using CCS Note: By default, code will build in release mode, so you need to set PROFILE ?= debug in your config file. Thanks Gaviraju
Hi, I have already done that, but in my way. I'm using makefile and .bat file to build appliction. That is what I have after the building process: There is "release" in the filenames, but I used PROFILE ?= debug in config file that time. I thats what I've got in CCS: As you can see, CCS tells me, that there is no debugging information avaliable. What am I doning wrong? Regards, D.K. Tovmachenko.
Hi, No need to import the project from visual studio to CCS for source build purposes & you can build the code in the visual studio itself & make sure it should be in debug mode. Once the build is completed then the O/P binary should be in some directory. Follow the instruction given in the user-guide(3.7 Load using CCS) If you are facing the issue while generating O/P binary for debug mode then please share the O/P of below command & run this command from the vision SDK build directory. gmake -s showconfig Thanks Gaviraju
Hi Gaviraju I failed to build application the way described in 3.2 Building the application. gmake output is Error 2. I attach the gmake -s showconfig results. d:\projects\InstalSDK\vsdk308\vision_sdk\build>gmake -s showconfig # # Build Config is [ tda2xx_evm_bios_all ] # Build Config file is @ d:/projects/InstalSDK/vsdk308/vision_sdk/configs/tda2xx_evm_bios_all/cfg.mk # Build Config .h file is @ d:/projects/InstalSDK/vsdk308/vision_sdk/links_fw/include/config/apps/tda2xx_evm_bios_all/system_cfg.h # Build CPUs is @ ipu1_0 ipu1_1 ipu2 a15_0 dsp1 dsp2 eve1 eve2 eve3 eve4 # # CPUs included in application, # PROC_IPU1_0_INCLUDE=yes # PROC_IPU1_1_INCLUDE=yes # PROC_IPU2_INCLUDE=yes # PROC_DSP1_INCLUDE=yes # PROC_DSP2_INCLUDE=yes # PROC_EVE1_INCLUDE=yes # PROC_EVE2_INCLUDE=yes # PROC_EVE3_INCLUDE=yes # PROC_EVE4_INCLUDE=yes # PROC_A15_0_INCLUDE=yes # # Platform config, # VSDK_BOARD_TYPE=TDA2XX_EVM [options: TDA2XX_EVM TDA2EX_EVM TDA3XX_EVM TDA3XX_RVP TDA2XX_RVP] # PLATFORM=tda2xx-evm # DUAL_A15_SMP_BIOS=no # IPU1_SMP_BIOS=no # DDR_MEM=DDR_MEM_512M [options: DDR_MEM_128M DDR_MEM_512M DDR_MEM_1024M] # EMIFMODE=SINGLE_EMIF_512MB [options: SINGLE_EMIF_512MB SINGLE_EMIF_1GB ref build_pdk.mk] # NDK_PROC_TO_USE=a15_0 [options: a15_0 ipu1_0 ipu1_1 ipu2 none] # NSP_TFDTP_INCLUDE=no [options: yes no] # TDA2EX_ETHSRV_BOARD=no [options: yes no] # FATFS_PROC_TO_USE=ipu1_0 [options: ipu1_0 none] # RADAR_BOARD=none [options: TDA3XX_AR12_ALPS TDA3XX_AR12_VIB_DAB_BOOSTER TDA3XX_RADAR_RVP none] # # Build config, # BUILD_OS=Windows_NT [options: Windows_NT Linux] # BUILD_DEPENDENCY_ALWAYS=no # BUILD_ALGORITHMS=no # BUILD_INFOADAS=no # PROFILE=release [options: debug release] # KW_BUILD=no # CPLUSPLUS_BUILD=no # IPU_PRIMARY_CORE=ipu1_0 [options: ipu1_0 ipu2] # IPU_SECONDARY_CORE=ipu2 [options: ipu1_0 ipu2] # A15_TARGET_OS=Bios [options: Bios Linux Qnx] # BSP_STW_PACKAGE_SELECT=all [options: all vps-iss-dss-only vps-vip-vpe] # # Safety Module config, # RTI_INCLUDE=no # ECC_FFI_INCLUDE=no # DCC_ESM_INCLUDE=no # # Video Module config, # IVAHD_INCLUDE=yes # VPE_INCLUDE=yes # CAL_INCLUDE=no # ISS_INCLUDE=no # ISS_ENABLE_DEBUG_TAPS=no # WDR_LDC_INCLUDE=no # DSS_INCLUDE=yes # # Open Compute config, # OPENCL_INCLUDE=no # TARGET_ROOTDIR=d:/projects/InstalSDK/vsdk308/vision_sdk/apps/src/rtos/opencl # ENABLE_OPENCV=no # ENABLE_OPENCV_TESTS=no # OPENVX_INCLUDE=no # # Log config, # ENABLE_UART_LOG=yes # ENABLE_NETWORK_LOG=no # ENABLE_CCS_LOG=no # CIO_REDIRECT=yes # # IPC config, # WORKQ_INCLUDE=no # IPC_LIB_INCLUDE=no # # AUTOSAR_APP=no # # Surround View config, # SRV_FAST_BOOT_INCLUDE=no # # Other Module config, # AVB_INCLUDE=no # DCAN_INCLUDE=no # RADAR_ONLY=no # RADAR_STUDIO=no # CPU_IDLE_ENABLED=yes # FAST_BOOT_INCLUDE=no # DATA_VIS_INCLUDE=no # HS_DEVICE=no # ULTRASONIC_INCLUDE=no # PGA450= # PGA460= # ENABLE_ALL_DEPTH= # # Linux config, # DEFAULT_UBOOT_CONFIG=dra7xx_evm_vision_config # DEFAULT_KERNEL_CONFIG=ti_sdk_dra7x_release_defconfig # DEFAULT_DTB=dra7-evm-infoadas.dtb # CMEM_INCLUDE=no # IPUMM_INCLUDE=no # IPU1_EVELOADER_INCLUDE=no # ROBUST_RVC_INCLUDE=no # BUILD_ADAM_CAR=no # # Alg plugins included in build, # ALG_autocalibration ALG_autoremap ALG_census ALG_clr ALG_denseopticalflow ALG_disparityhamdist ALG_dmaSwMs ALG_vpeSwMs ALG_edgedetection ALG_framecopy ALG_lanedetection ALG_objectdetection ALG_remapmerge ALG_safe_framecopy ALG_sfm ALG_sparseopticalflow ALG_stereo_postprocessing ALG_subframecopy ALG_surroundview ALG_tidl ALG_tiop # # Use-cases included in build, # UC_srv_calibration UC_lvds_vip_dual_cam_dual_display UC_lvds_vip_multi_cam_view UC_lvds_vip_sv_analytics_us UC_lvds_vip_sv_standalone UC_lvds_vip_single_stereo UC_lvds_vip_single_stereo_auto_calib UC_lvds_vip_single_stereo_calibration UC_network_rx_tx UC_network_stereo_display UC_null_src_dec_display UC_null_src_display UC_ov490_vip_sv_standalone UC_saveDisFrame UC_vip_single_cam_analytics2 UC_vip_single_cam_dense_optical_flow UC_vip_single_cam_dual_display UC_vip_single_cam_edge_detection UC_vip_single_cam_frame_copy UC_vip_single_cam_frame_copy_safety UC_vip_single_cam_lane_detection UC_vip_single_cam_object_detection2 UC_vip_single_cam_sfm UC_vip_single_cam_sparse_optical_flow UC_vip_single_cam_subframe_copy UC_vip_single_cam_tlr UC_vip_single_cam_view UC_vip_single_cam_view_encdec UC_tidl UC_semSeg UC_tidl_OD # # # CPUs that are NOT required but included in config [ tda2xx_evm_bios_all ], # # WARNING: IPU1_1 can be excluded from application # WARNING: IPU2 can be excluded from application # # CPUs that are required but not included in config [ tda2xx_evm_bios_all ], # # # Edit d:/projects/InstalSDK/vsdk308/vision_sdk/apps/configs/tda2xx_evm_bios_all/cfg.mk to include or exclude CPUs in an application # Right now I'm building my project like that: I'm using makefile and .dat file. There is how my .bat file is written: @ECHO OFF set projpath=%CD% set PATH=%vision_sdk_path%\ti_components\os_tools\windows\xdctools_3_32_01_22_core;%PATH%; set ITELMA_TARGET=TDA2PX call gmake.exe -j1 -s clean if errorlevel 1 ( echo Failure Reason Given is %errorlevel% cd .. exit /b %errorlevel% ) call gmake.exe -j1 -s vcop if errorlevel 1 ( echo Failure Reason Given is %errorlevel% cd .. exit /b %errorlevel% ) call gmake.exe -j1 -s all if errorlevel 1 ( echo Failure Reason Given is %errorlevel% cd .. exit /b %errorlevel% ) cd %vision_sdk_path%\vision_sdk\build echo %CD% set CURRENT_ITELMA_PROJECT=%projpath% set MAKECONFIG=tda2px_evm_bios_itelma rmdir /S /Q %vision_sdk_path%\vision_sdk\binaries\apps\tda2px_evm_bios_itelma\lib rmdir /S /Q %vision_sdk_path%\vision_sdk\binaries\apps\tda2px_evm_bios_itelma\obj call gmake -s clean if errorlevel 1 ( echo Failure Reason Given is %errorlevel% cd .. exit /b %errorlevel% ) call gmake -s -j4 depend if errorlevel 1 ( echo Failure Reason Given is %errorlevel% cd .. exit /b %errorlevel% ) call gmake -s -j4 if errorlevel 1 ( echo Failure Reason Given is %errorlevel% cd .. exit /b %errorlevel% ) call gmake -s appimage if errorlevel 1 ( echo Failure Reason Given is %errorlevel% cd .. exit /b %errorlevel% ) cd %projpath% But if I use this binary files as described in 3.7 Load using CCS, there is no debug information in CCS. Best regards
Hi, Please share the complete build log in a text file & set PROFILE=debug in your config file because it's set as the release Thanks Gaviraju