File size: 14,117 Bytes
5aefcf4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Ticket Name: Compiler/TDA2EXEVM: TI-RTOS: How to support the function of USB2.0 HOST/OTG on TDA2XX

Query Text:
Part Number: TDA2EXEVM Other Parts Discussed in Thread: TDA4VM, TDA2, SYSBIOS Tool/software: TI C/C++ Compiler Hi, I would like to enable the function of USB2.0 HOST & OTG on the TDA2XX EVM. I couldn't found out any USB drvier sample code from PROCESSOR_SDK_VISION product for reference. But I observed thtat there is a TivaWare™ USB Library seems could support the feature on the TDA2XX platform. Could you help provide some guide/suggestions to porting the function ? Thanks. BRs, Sam Hsieh.

Responses:
Hi, I really doubt that this is supported in RTOS driver, so I will check with an expert then let you know. Thanks Gaviraju

Hi, We are not supporting this in the Bois RTOS. Thanks Gaviraju

Hi Gaviraju, Thank you for your confirmation. BTW, I browsed that DRA7xx and TDA2xx are J6 TDA famliy of devices, and the DRA7xx dedicated for the In-Vehicle Infotainment system. the processor SDK RTOS automotive which the USB Low-Level Driver (USB lld) support the function of USB Host/Device in PDK package. I try to port the USB driver into TDA2xx platform, migrate the LLD into the direcorty of ti_components/drivers/pdk_01_10_03_07/packages/ti/drv/usb. At the same time, I confirmed that the makefile file (ti/drv/build) include the usb_component.mk. I add tda2xx into the "drvusb_SOCLIST" variable of usb_component.mk. but it shows that 3662 Nothing to be done for tda2xx a15_0 usb 3663 Nothing to be done for tda2xx a15_0 usb_profile 3664 Nothing to be done for tda2xx a15_0 usb_indp 3665 Nothing to be done for tda2xx a15_0 usb_profile_indp It seems that there is no dependencies between LLD and PDK, It needs configure and rebild the component of usbdrv. Could you help teach me how to porting the usb lld? Thanks. BRs, Sam Hsieh

Hi Gaviraju, BTW, I could build usb component and output ti.drv.usb.aem4 (ipu1_0 core) file after modified the file usb_component.mk. But I don't know how to link it into RTOS. Could you help provide me the solution or some suggestion to fix the problem? Thanks. BRs, Sam Hsieh

Hi Sam, If it's about library linking then can you take a look at this thread ? Regards Vineet

Hi Vineet, Thank you for your feedback. I understood how to link the driver library (ti.drv.usb.aem4) into RTOS. But I met the problem of undefine symbols: Could you help teach me how to fix the related osal library linking error ? Thanks. undefined first referenced (symbol in file ti_components/drivers/pdk_01_10_03_07/packages/ti/drv/ --------- ---------------- HwiP_Params_init HwiP_create HwiP_disable HwiP_restore MuxIntcP_create Osal_DeleteInterrupt Osal_RegisterInterrupt Osal_RegisterInterrupt_initParams SemaphoreP_Params_init SemaphoreP_create SemaphoreP_delete SemaphoreP_pend SemaphoreP_post _DebugP_assert BR, Sam.

Can you take a look at the makefile inside gateway-demos/can_eth_gateway ? I think you need to link osal library as shown in the makefile. Regards Vineet

Hi Vineet, As http://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7 I can't found out the source codes and makefile of gateway package from the processor SDK (v03.07). Could you teach me where could download the package? Thanks. BTW, I observed that TDA2xx should be Jacinto 6 platform (cortex A15 core) and TDA4VM is Jacinto 7 (Cortex A72 core), Are their Processor_SDK_Vision and Platform Development Kit (PDK, version 7) compatible on TI RTOS ? BRs, Sam.

Hi Vineet, I downloaded the source package of psdk_rtos_auto_j7_07_00_00_11.tar.gz and found out the makefile of gateway-demos/can_eth_gateway. I just observed that the rule related to osal library, it link failure. EXT_LIB_LIST_COMMON += $(osal_tirtos_LIBPATH)/$(SOC)/$(ISA_EXT)/$(BUILD_PROFILE_$(CORE))/$(osal_tirtos_LIBNAME).$(LIBEXT) but both the variables of osal_tirtos_LIBPATH and osal_tirtos_LIBNAME are not defined. It seems that the it needs include osal_component.mk file and the source codes of related package (osal_library). Could you help teach me how to link osal library? thanks. BRs, Sam.

Hi Sam, Just try with direct path, ignore the variables. OSAL library is inside PDK. The makefile system is complicated, sorry. I suggest to just link what you need. EXT_LIB_LIST_COMMON is the makefile variable that is relevant here. Let me know Regards Vineet

Hi Vineet, Thank you for your suggestion. I tried to port the "OSAL Modules" into the PDK, But I met the dependency failure ( ) when make depend (for osal_component.mk). At the same time, I observed that there is a lost file of "EventCombinerP_tirtos.c" from the latest processor sdk (psdk_rtos_auto_j7_07_00_00_01.tar.gz). Could you help teach me where could download file ? Thanks. make[4]: *** No rule to make target 'src/tirtos/EventCombinerP_tirtos.c', needed by '/home/sam/test/Git-Ver/TI_SDK_VISION_V03_07/vision_sdk/binaries/apps/tda2 make[4]: Leaving directory '/home/sam/test/Git-Ver/TI_SDK_VISION_V03_07/ti_components/drivers/pdk_01_10_03_07/packages/ti/osal' makefile:137: recipe for target 'osal_tirtos' failed make[3]: *** [osal_tirtos] Error 2 BRs, Sam.

Hi Vineet, I have solved the problem of compiler osal library (symbol unresolved), but I met the memory problem when link it into AppImage. The error message as the following: binaries/apps/tda2xx_evm_bios_opencx/obj/vision_sdk/tda2xx-evm/ipu1_0/release/vision_sdk_configuro/linker_mod.cmd", line 268: error: program will not fit into available memory. run placement with alignment fails for section "GROUP_1" size 0x15e7952 . Available memory ranges: IPU1_0_DATA_MEM size: 0x1000000 unused: 0xcf0af5 max hole: 0xcf0af4 I observed that the IPU1_0_DATA_SIZE is assigned to 0x1000000(16MB) in the apps/build/tda2xx/mem_segment_definition_bios.xs. I try to refer to the userguide (VisionSDK_UserGuide_MemoryMap.pdf), increase the IPU1_0_DATA_SIZE to (24MB). But it got the failure of MEMORY_MAP OVERFLOW ERROR : Region End: 0xb4000000 Actual End: 0xb5280000 Could you help instruct me how to define the memory segment for the OSAL library on IPU1_0 core? Thanks. ps. I configured successfully the DDR3_SIZE =1024MB on TDA2XX, it worked fine. BRs, Sam.

Please share your xs and cmd files. I didn't understand the problem, typically you don't have to assign separate segment for OSAL library. If you have a specific program memory used for IPC then that's usually an array and you can point that array to a section like this (just an example) static uint8_t gCntrlBuf[RPMSG_DATA_SIZE] __attribute__ ((section("ipc_data_buffer"), aligned(8))); ipc_data_buffer is then a separate entry in CMD file with it's own size and start address. xs file is used to set cacheable, shareable attributes for a memory region (typically in 8M and 16M increments) Regards Vineet

Hi Vineet Roy: USB driver had merged to tda2xx, But use USB some function as below: #if 1 USB_Params usb_dev_params; USB_Handle usb_handle; usb_dev_params.usbMode = USB_DEVICE_MSC_MODE; // usb_dev_params.instanceNo = USB_DEV_INSTANCE; /* USB port # */ // usb_dev_params.usbClassData = (void*)&g_sMSCDevice; Vps_printf("\nRTOS USB Dev MSC example!!\n"); usb_handle = USB_open(usb_dev_params.instanceNo, &usb_dev_params); if (usb_handle == 0) { Vps_printf("Failed to open USB driver\n"); return; } usbdIntrConfig(usb_handle, &usb_dev_params); Vps_printf("Done configuring USB and its interrupt. Example is ready!\n"); Vps_printf(" USB Init Completed Sucessfully \n"); #endif I got the error messages, show below : [HOST ] 5.453760 s: SYSTEM: Initializing Links ... DONE !!! [HOST ] 5.453821 s: SYSTEM: System A15 Init Done !!! [HOST ] 5.747239 s: NSP GMAC: PHY 2 Found on MAC Port 0 [HOST ] 5.747697 s: NSP GMAC: PHY 3 Found on MAC Port 1 [HOST ] 5.947874 s: NDK: Link Status: 100Mb/s Full Duplex on PHY 2 [DSP1 ] 5.435978 s: ***** DSP1 Firmware build time 15:26:01 Sep 24 2020 [DSP1 ] 5.436070 s: *** SYSTEM: CPU Frequency <ORG = 600000000 Hz>, <NEW = 600000000 Hz> [DSP1 ] 5.450771 s: SYSTEM: Notify register to [IPU1-0] line 0, event 15... ----- crash --- another sample disable USB function above sample code, the TDA2XX is working. message show below: [HOST ] 5.478466 s: SYSTEM: Initializing Links ... DONE !!! [HOST ] 5.478527 s: SYSTEM: System A15 Init Done !!! [HOST ] 5.771975 s: NSP GMAC: PHY 2 Found on MAC Port 0 [HOST ] 5.772433 s: NSP GMAC: PHY 3 Found on MAC Port 1 [HOST ] 5.972610 s: NDK: Link Status: 100Mb/s Full Duplex on PHY 2 [DSP1 ] 5.460348 s: ***** DSP1 Firmware build time 15:26:01 Sep 24 2020 [DSP1 ] 5.460440 s: *** SYSTEM: CPU Frequency <ORG = 600000000 Hz>, <NEW = 600000000 Hz> [DSP1 ] 5.475477 s: SYSTEM: Notify register to [IPU1-0] line 0, event 15... [DSP1 ] 5.475568 s: SYSTEM: Notify register to [IPU1-1] line 0, event 15... [DSP1 ] 5.475629 s: SYSTEM: Notify register to [IPU2] line 0, event 15... [DSP1 ] 5.475660 s: SYSTEM: Notify register to [DSP2] line 0, event 15... [DSP1 ] 5.475690 s: SYSTEM: Notify register to [EVE1] line 0, event 15... [DSP1 ] 5.475751 s: SYSTEM: Notify register to [EVE2] line 0, event 15... [DSP1 ] 5.475782 s: SYSTEM: Notify register to [EVE3] line 0, event 15... [DSP1 ] 5.475812 s: SYSTEM: Notify register to [EVE4] line 0, event 15... [DSP1 ] 5.475873 s: SYSTEM: Notify register to [HOST] line 0, event 15... [DSP1 ] 5.476056 s: *** UTILS: CPU MHz = 20 Mhz *** Do you know what next step for TD2xx default usecase after [DSP1 ] 5.475477 s: SYSTEM: Notify register to [IPU1-0] line 0, event 15...

Hi export: I found the problem, If program used "return (handle->fxnTablePtr->openFxn(handle, params)); " , the TDA2xx system will be crash. the sample code below list: /* * ======== USB_open ======== */ USB_Handle USB_open(unsigned int index, USB_Params *params) { USB_Handle handle; handle = (USB_Handle)&(USB_config[index]); // printf("%s[%d]\n",__func__,__LINE__); #if 1 /* Get handle for this driver instance */ return (handle->fxnTablePtr->openFxn(handle, params)); #else return handle; #endif } The error messages is same last blog: [DSP1 ] 5.450771 s: SYSTEM: Notify register to [IPU1-0] line 0, event 15... Why ???

Hi Ethan, Good to know. I did not understand. Is your problem resolved with your fix ? Are you just curious about the log message ? Regards Vineet

Hi Vineet, Due to system hang up after call USB_OPEN() function, I would like to trace into the USB_OPEN function by consolePrintf() output debug message. But I observed that there is a undefine symbol of consolePrintf() when enable _DEBUG_ flag. Could you help teach me how to enable consolePrintf() in the USB driver? Thanks. BRs, Sam Hsieh

Hi, Can you use the App_consolePrintf() instead ? You can see it's usage in ti/drv/i2c/example/i2c_utility The app itself defines it inside via static void App_consolePrintf(const char *pcString, ...) { char printBuffer[APP_PRINT_BUFFER_SIZE]; va_list arguments; /* Start the var args processing. */ va_start(arguments, pcString); vsnprintf (printBuffer, sizeof(printBuffer), pcString, arguments); printf(printBuffer); /* Bypassing UART for initial bring up */ #if 0 App_consolePrintf(printBuffer); #endif /* End the var args processing. */ va_end(arguments); } and the related functions are linked by linking csl_uart_console module (see Makefile) Regards Vineet

Hi Vineet, Thank you for your kind instruction. I could debug the usb driver via output uart message (debug_printf). So far, I could call USB_open() function with MSC_DEV mode successfully, but it couldn't recognize USB device from NB. It pop unknown device on the HOST side. At the same time, I observed that it occurred the error when setup usb_osalRegisterInterrupt(); [IPU1-0] 5.230098 s: ### XDC ASSERT - ERROR CALLBACK START ### [IPU1-0] 5.230159 s: [IPU1-0] 5.230372 s: E_alreadyDefined: Hwi already defined: intr# 110 [IPU1-0] 5.230433 s: [IPU1-0] 5.230464 s: ### XDC ASSERT - ERROR CALLBACK END ### I don't know how to look into the Hwi interupt service routine on TDA2XX@RTOS. Could you help instruct me how to solve the issue ? Thanks. BRs, Sam.

Hi Sam, Can you take a look at this thread Regards Vineet

Hi Vineet, I have studied the thread, it should be related to the USB clock & cache control. I think that the thread is different from the USB interrupt source routine (ISR). BTW, l observed that the interrupt number of USB2 (USB 2.0 port), I #define SYS_INT_USB0 ((uint32_t)108U) /* USB1_IRQ_INTR0 (main MPU_IRQ_76) */ #define SYS_INT_USBSS0INT ((uint32_t)109U) /* USB1_IRQ_INTR1 (misc MPU_IRQ_77) */ #define SYS_INT_USB1 ((uint32_t)110U) /* USB2 IRQ_INTR0 (main MPU_IRQ_78) */ #define SYS_INT_USBSS1INT ((uint32_t)124U) /* USB2 IRQ_INTR1 (misc MPU_IRQ_92) */ I am extremely suspicious of the module ('ti.sysbios.hal.Hwi') ti_sysbios_family_arm_m3_Hwi_create. I couldn't found out which code repeat register interrupt number (#110). Could you help teach me or provide some suggestion to figure out why the ISR could not be registered? thanks. BRs, Sam.

Hi Vineet, I observed that the function of "Hwi_Instance_init()" check vector table entry whether if already in use. if in use then call Error_raise("Hwi_E_alreadyDefined"). I still couldn't found out the root cause (alreadyDefined). BTW, I also try to replace the value of SYS_INT_USB1 with 111, it got the same failure. #define SYS_INT_USB1 ((uint32_t)111U) Could you help update the issue ? Thanks. BRs, Sam Hsieh

Hi Vineet, I recently observed that the interrupt controller of TDA2XX are too complex to understand in the TRM (SPRUI29F). As I understood that the usb2 (usbmini_ab) hardwired with the USB2_DRVVBUS of TDA2XX, and bind the usb driver library (ti.drv.usb) into the IPU1 core, but I don't understand clear how to register interrupt number and map the IPU1_IRQ_xx and CSL_XBAR_USB2_IRQ_INTR1. Could you help teach how to handle the IRQ_CROSSBAR mapping for USB2 device ? Thanks. BRs, Sam.

Hi Sam, I want to check with you whether this issue has been resolved or you still need help with this. Based on your input I will plan the next steps. Regards Karthik

Hi Karthik, Thank you for your feedback. Due to the problem had been suspended for a long time, We gave up the request for support. BRs, Sam