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.

Argument to HW ISR is invalid

Other Parts Discussed in Thread: TM4C123FH6PM, SYSBIOS

I've attached a bare bones repro case for a problem I have found with a HW ISR.  All the app does is set up a HW interrupt on a GPIO pin, and go into an ISR on the interrupt.  When I set up the ISR, I specify an argument of 0xAA.  Note, in the ISR, that the argument passed into the method varies on each call, despite the fact that you can see from the call to Hwi_getFunc that the original parameter I specified is still intact.  Indeed, if you look at the memory pointed at by the HWI handle, you will see that it is correct.  I also do a stack check in the ISR, which passes.

This example runs on a LaunchPad; if you add a pullup to the F.4 pin, pressing the User 1 switch will trigger the input.  This example does not include any code specific to our application, and, as it repros on a LaunchPad, clearly it has nothing to do with our hardware.

My guess is that there is some kind of configuration error, so that some inappropriate structures or function signatures are being used, and therefore the calling stack is corrupted, or some other similar effect is happening.

We are using the TM4C123FH6PM part on our system, and to the best of my ability, I believe the configuration is appropriate for that part.

In any case, this is basic OS functionality, and I'd like to resolve this ASAP.

Component - 2013-12-04 12-34 - Min Repro HWI ISR Arg Error - Launch Pad.zip
  • Chris,

    This might be with how things are getting declared and initialized, but either way, I will look into this tomorrow when I have some hardware in front of me, and at least get you an update by end of day. Thank you for taking the time to reproduce the issue on a launchpad and posting the project for convenience.

    -Reagan

  • Chris,

    At this point, I think it's best to move this thread to the TI-RTOS forum.

    I've reproduced the issue on my side, but have been unable to find the source of the error yet. I've tried modifying the compiler options (including optimization), removing the M3-specific check box from the Hwi cfg section, and actually assigning the value of arg to arg2 to see if that plus any possible optimization was just not showing the true value of arg in the debug window.

    I will continue investigating, as well as ping others from the TI-RTOS team to see if anyone might know this off the top of their head.

  • Hi Chris,

    The Hwi in your app is being configured to be a zero-latency interrupt. The arg parameter to zero-latency interrupts is not functional by design.

    Here's an excerpt from the M3 Hwi cdoc that documents this:

    Link to SYS/BIOS 6.35.04 Hwi cdoc: http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_35_04_50/exports/bios_6_35_04_50/docs/cdoc/ti/sysbios/family/arm/m3/Hwi.html#xdoc-desc

    To get the arg paramter working, simply reduce the priority of the Hwi below the disablePriority (0x20 by default for Tiva devices) i.e. you need to increase the priority value to greater than equal to 0x20. This will ensure the interrupt is dispatched (not zero-latency) through SYS/BIOS's dispatcher.

    Best,

    Ashish