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.

HWI interrupt on Cortex A15

Other Parts Discussed in Thread: SYSBIOS

Hello,

I tried  with configuring the HWI on Cortex-A15 for UART1 event on DRA75X board with the below configuration.

in .cfg file

var Hwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi');

in .c file

Error_Block eb;
Hwi_Params hwiParams;
unsigned int key;
Hwi_Handle hwhandle;

/* Construct Hwi object for this UART peripheral. */

Hwi_Params_init(&hwiParams);
hwiParams.arg = (UArg)handle;
hwiParams.eventId = 67;//intNum;
hwiParams.enableInt = TRUE;
hwiParams.maskSetting = Hwi_MaskingOption_SELF;
Error_init(&eb);
hwhandle = Hwi_create(62, (Hwi_FuncPtr)ptr, &hwiParams, &eb);

 but it is not working as expected. control never come to ISR routine. is there any setting to be done CPINTC?.

The same code is worked for C66x with  xdc.useModule('ti.sysbios.family.c64p.Hwi');

Thanks,

Ramesh.S

 

  • Hi Ramesh,

    are you sure it is the IRQ number you have configured? Suggest to check the UART1 hardware request connection again - there's a crossbar in between, hence it could be another index from MPU's view. Additionally check if the crossbar is configured properly.

    Regards,
    Marc

  • Hello Marc,

    The configured IRQ number is correct. do we need to configure the Cross BAR externally? I configured the interrupt  based on cross BAR default configuration.

    Thanks,

    Ramesh.S

  • Hi Ramesh,

    The code you shared in your first post looks right except for the following:

     - hwiParams.eventId is ignored on Cortex-A15 so you do not have to set it.

     - The intNum that you are passing to Hwi_create() is 62 but the DRA75x TRM I have says UART1_IRQ number is 72 (unless you are changing the default crossbar settings to map UART1_IRQ to IRQ 62). Please confirm that the IRQ number you are using is correct. Also, please note that our Hwi module uses the GIC interrupt numbering scheme. What that means is that if the TRM says an interrupt IRQ line number is 72, you need to pass 72 + 32 = 104 to Hwi_create(). This is because the first 32 interrupts in the A15 interrupt controller are private and software generated interrupts. Interrupt number 32 onwards are shared interrupts (the interrupts listed in the DRA75xx TRM). So you need to add the 32 offset to account for that fact.

    Hwi module documentation: http://downloads.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_40_03_39/exports/bios_6_40_03_39/docs/cdoc/ti/sysbios/family/arm/gic/Hwi.html#xdoc-desc

    One last thing. You mentioned CpIntc in one of your posts. This module is not present on DRA75xx as far as I know. So, you dont have to worry about configuring it. I believe it is only present on Keystone devices.

    Best,

    Ashish

  • Hello Ashish,

    Thanks for the reply. I tried it week back and it worked.what i didn't know was adding +32 to intnum and eventID has no role to play in configuration.

      My configuration is as below.

        Hwi_Params_init(&hwiParams);
        hwiParams.arg = (UArg)handle;
        hwiParams.eventId = 67;//intNum;
        hwiParams.enableInt = TRUE;
        hwiParams.maskSetting = Hwi_MaskingOption_SELF;
        Error_init(&eb);
        hwhandle = Hwi_create(104, (Hwi_FuncPtr)ptr, &hwiParams, &eb);

        if (hwhandle == NULL) {
            /* Error creating Hwi */
            return (NULL);
        }

    but with this configuration it works with freerun,if we put the breakpoints in the code .it won't work. is there any cache setting to be done?..

  • Hi Ramesh,

    There are two possible reasons that I can think of that may cause your app to not work properly if you add breakpoints to the app:

    The Clock module uses the A15 generic timer (on-chip timer) by default. This timer does not halt when the core is halted. If the core is halted a large number of clock interrupts may accumulate. Depending on how the app uses the clock, this may affect the app's behavior. You can change the timer proxy to dmtimer if you need to debug the app and change it back to generic timer when you are ready to go to production:

    var Clock = xdc.module('ti.sysbios.knl.Clock');
    
    Clock.TimerProxy = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');

    Another possibility is an emulation driver related bug. You can update the emulation driver (listed as TI Emulators in the list of installed software) from "Help"->"About Code Composer Studio"->"Installation Details" window. The latest version is 5.1.600.

    Best,

    Ashish