Hi,
I need uart5 to receive gps signal.
So I added utils_uart_0.c, when I run System_uartInit () the system hangs.
How can I solve it??
SDK : PROCESSOR_SDK_VISION_03_04_00_00
Board : Custom Board
The System_uart0Init() code below
Void System_uart0Init(void) { Uart_ChanParams chanParams; Error_Block eb; GIO_Params ioParams; static char uartName[16]; /* device name MUST be global or static variable */ static DEV_Struct uartDevObj; static GIO_Struct uartTxObj; static GIO_Struct uartRxObj; static SyncSem_Struct uartTxSyncSemObj; static SyncSem_Struct uartRxSyncSemObj; static Semaphore_Struct uartTxSemObj; static Semaphore_Struct uartRxSemObj; static IOM_Packet uartTxIomObj[UART_ASYNC_IOM_PACKET_MAX]; static IOM_Packet uartRxIomObj[UART_ASYNC_IOM_PACKET_MAX]; DEV_Params devParams; Uart_Params uartParams; SyncSem_Params syncSemParams; Semaphore_Params semParams; Int32 devId; Error_init(&eb); /* * Initialize channel attributes. */ GIO_Params_init(&ioParams); //Jay do not do it again, cause System_uartInit had already do Uart_init //Uart_init(); if(Bsp_platformIsTda2xxFamilyBuild()) { //Harware HD-AVM-0302 for GPS strcpy(uartName, "/uart4"); devId = 4; /* Set the pin Mux */ //Bsp_boardSetPinMux(BSP_DRV_ID_UART, BSP_DEVICE_UART_INST_ID_4, BSP_BOARD_MODE_DEFAULT); HW_WR_REG32(0x4A003440,0x00050008);// uart5_rxd Pinmux HW_WR_REG32(0x4A003444,0x00010008);// uart5_txd Pinmux } else if(Bsp_platformIsTda3xxFamilyBuild()) { #if 0 //adas_0101 //' strcpy(uartName, "/uart0"); //0x00050000 uart1 devId = 0; //0x00050000 uart1 HW_WR_REG32(0x4A0035BC,0x00050000);//0x00050000 uart1_rxd HW_WR_REG32(0x4A0035C0,0x00010000);//0x00010000 uart1_txd #endif #if 1 //Harware BSD-0101 for GPS /* Set the pin Mux */ strcpy(uartName, "/uart1"); // uart2 devId = 1; // uart2 HW_WR_REG32(0x4A003450,0x00050002);//0x00050000 Pinmux uart2_rxd #endif } else { Vps_printf("NOT TDA2XX AND TDA3XX!! PLEASE CHECK YOUR HARDWARE!!\n"); } Vps_printf("######Jay uart devId = %d###########\n",devId); uartParams = Uart_PARAMS; uartParams.opMode = UART_OPMODE_INTERRUPT; uartParams.hwiNumber = 8u; uartParams.rxThreshold = UART_RXTRIGLVL_8; uartParams.txThreshold = UART_TXTRIGLVL_56; uartParams.baudRate = UART_BAUDRATE_9_6K; //radar 230400U UART_BAUDRATE_9_6K uartParams.prcmDevId = 0; /* INVARIANT_CONDITION.UNREACH * MISRAC_2004_Rule_13.7 * MISRAC_WAIVER: * Code is currently unreachable. * This is kept to ensure future updates to modes. */ if(uartParams.opMode == UART_OPMODE_POLLED) { Vps_printf(" SYSTEM: UART: POLLED Mode is Selected \n"); } else if(uartParams.opMode == UART_OPMODE_INTERRUPT) { Vps_printf(" SYSTEM: UART: INTERRUPT Mode is Selected \n"); } else { /* MISRA WARNING */ } uartParams.enableCache = (Bool)FALSE; /* initialise the edma library and get the EDMA handle */ chanParams.hEdma = NULL; /* If cross bar events are being used then make isCrossBarIntEn = TRUE and * choose appropriate interrupt number to be mapped (assign it to * intNumToBeMapped) */ chanParams.crossBarEvtParam.isCrossBarIntEn = (Bool)FALSE; chanParams.crossBarEvtParam.intNumToBeMapped = 0xFFU; #if 0 //Not sure whether to do it //Add by TIM for HD_AVM_0302 //IRQ 59、OK if(Bsp_platformIsTda2xxFamilyBuild()) { UInt32 cookie = 0; uartParams.prcmDevId = 4;//Uart5 uartParams.hwiNumber = CSL_XBAR_INST_IPU1_IRQ_59; /* Configure the crossbar */ BspOsal_irqXbarConnectIrq((UInt32) CSL_XBAR_INST_IPU1_IRQ_59, (UInt32)CSL_XBAR_UART5_IRQ); /* Configure the Interrupt */ cookie = BspOsal_disableInterrupt(); Hwi_enableInterrupt(CSL_XBAR_INST_IPU1_IRQ_59); /* Restore interrupts */ BspOsal_restoreInterrupt(cookie); } #endif ioParams.chanParams = (Ptr)&chanParams; #if 1 DEV_Params_init(&devParams); devParams.deviceParams = &uartParams; devParams.initFxn = NULL; devParams.devid = devId; /* MISRA.CAST.CONST * MISRAC_2004 Rule_11.5 * MISRAC_WAIVER: * External package errors like bios which are not * part of VSDK package can't be fixed */ DEV_construct(&uartDevObj, uartName, (Ptr)&Uart_IOMFXNS, &devParams, &eb); #if 1 SyncSem_Params_init(&syncSemParams); Semaphore_Params_init(&semParams); semParams.mode = Semaphore_Mode_BINARY; Semaphore_construct(&uartTxSemObj, 0, &semParams); syncSemParams.sem = Semaphore_handle(&uartTxSemObj); SyncSem_construct(&uartTxSyncSemObj, &syncSemParams, &eb); ioParams.sync = SyncSem_Handle_upCast( SyncSem_handle( &uartTxSyncSemObj ) ) ; if(ioParams.numPackets > UART_ASYNC_IOM_PACKET_MAX) { UTILS_assert(ioParams.numPackets <= UART_ASYNC_IOM_PACKET_MAX); } memset(&uartTxIomObj[0], 0, ioParams.numPackets * sizeof (IOM_Packet)); ioParams.packets = &uartTxIomObj[0]; #endif /* create the required channels(TX/RX) for the UART demo */ GIO_construct(&uartTxObj, uartName, (UInt32)GIO_OUTPUT, &ioParams, &eb); #if 1 SyncSem_Params_init(&syncSemParams); Semaphore_Params_init(&semParams); semParams.mode = Semaphore_Mode_BINARY; Semaphore_construct(&uartRxSemObj, 0, &semParams); syncSemParams.sem = Semaphore_handle(&uartRxSemObj); SyncSem_construct(&uartRxSyncSemObj, &syncSemParams, &eb); ioParams.sync = SyncSem_Handle_upCast( SyncSem_handle( &uartRxSyncSemObj ) ) ; memset(&uartRxIomObj[0], 0, ioParams.numPackets * sizeof (IOM_Packet)); ioParams.packets = &uartRxIomObj[0]; #endif GIO_construct(&uartRxObj, uartName, (UInt32)GIO_INPUT, &ioParams, &eb); uart0TxHandle = GIO_handle(&uartTxObj); uart0RxHandle = GIO_handle(&uartRxObj); #endif /* INVARIANT_CONDITION.UNREACH * MISRAC_2004_Rule_13.7 * MISRAC_WAIVER: * Code is currently unreachable. * This is kept to ensure future updates by the called function. */ if ((NULL == uart0RxHandle) || (NULL == uart0TxHandle)) { Vps_printf(" SYSTEM: UART: ERROR: GIO_create(%s) Failed !!!\n", uartName); } else { Init0Done = (Bool)TRUE; } }