This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320C6678: Hwi in OSAL

Part Number: TMS320C6678
Other Parts Discussed in Thread: SYSBIOS

Hi,

ti-processor-sdk-rtos-c667x-evm\pdk_c667x\packages\ti\drv\uart\src\v0

When uart driver under pdk_c667x\packages\ti\drv was used in project, regardless of the customer created HWI in cfg statically or dynamically and HWI does not work.

How HWI was created and used in OSAL? For example, UART_open_v0 in ti-processor-sdk-rtos-c667x-evm\pdk_c667x\packages\ti\drv\uart\src\v0.

  • Hi Nancy,

    You can see a tutorial on how to create runtime HWI here:
      http://www.ti.com/download/trng/multimedia/dsp/OLT110026/hwis.mp4

    They should also make sure they have:
     var Hwi            = xdc.useModule('ti.sysbios.family.c64p.Hwi');

    set in their .cfg file.

    They can also check section 3.4Hardware Interrupts in http://www.ti.com/lit/ug/spruex3u/spruex3u.pdf and the following online training: http://processors.wiki.ti.com/images/b/b2/Hwis.pdf

    Best Regards,
    Yordan

  • Hi,

    After initializing uart by code under drv, HWI cannot be created successfully via Hwi_creat. But HWI can be created successfully if not use code under drv.

    void uart_int_test_fxn(UART_Handle handle,void *buf,size_t count)
    {
    System_printf("Drv Uart callback");

    }
    Board_STATUS Board_uartInit()
    {

    Board_STATUS ret;
    UART_Params params;
    UART_HwAttrs hw_params;

    UART_Params_Init(&params);
    params.readMode = UART_MODE_CALLBACK;
    params.readCallback = uart_int_test_fxn;
    params.baudRate = 115200;
    params.readReturnMode = UART_RETURN_FULL;
    params.readEcho = UART_ECH_OFF;
    Board_obj.uartHandle = UART_open(0,&params);
    if(Board_obj.uartHandle == NULL){
    ret = BOARD_UART_OPEN_FAIL;
    }else{
    ret = BOARD_SOK;
    }
    }

    HWI configuration:
    void myEvent148Fxn(UArg arg)
    {
    System_printf("Hwi int");
    }
    void thread_init_hwi()
    {
    Hwi_Handle hwi_Uart;
    Error_Block eb;
    Int eventId;
    Hwi_Params params;

    Error_init(&eb);
    CpIntc_mapSysIntToHostInt(0,148,8);
    CpIntc_dispatchPlug(148,&myEvent148Fxn,148,TRUE);
    CpIntc_enableHostInt(0,8);
    eventId = CpIntc_getEventId(8);
    Hwi_Params_init(&params);
    params.eventId = eventId;
    params.arg = 8;
    params.enableInt = Ture;
    hwi_Uart = Hwi_creat(6,&CpIntc_dispatch,&params,&eb);
    if(hwi_Uart == NULL){
    System_printf("Hwi_Uart create failed");
    }
    }

  • Nancy,

    Can you please provide the .cfg file in the application. I am  not sure what the intent of the configuration is in the application. When you call UART_open the HWI for UART is already created by the driver. If the intent is to provide custom ISR code then we recommend using the UART driver in callback mode so that when interrupt occurs the driver HWI will handle the interrupt event and then pass control to user ISR. 

    If the usecase is to create HWI other than for UART interrupt then you should be able to directly use BIOS HWi module and create interrupts other than the UART interrupt which is already registered by BIOS using UART_open. the UART_open makes a call to  UART_osalRegisterInterrupt which makes call to OSAL function Osal_RegisterInterrupt which calls HwiP_create and registers the ISR for the driver.

    Regards,

    Rahul