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.

RTOS/TMS570LS0432: Issue with GIOA and GIOB interrupts

Part Number: TMS570LS0432
Other Parts Discussed in Thread: HALCOGEN,

Tool/software: TI-RTOS

I created a simple project with HALCOGEN for TMS570LS04x for Hercules LaunchPad development board with FreeRTOS support. I wanted just to blink the GIOA2 LED while pressing GIOA7 button on the board. In HALCOGEN I enabled interrupt for GIOA7 button triggered on falling edge then I generated the code for Code Composer Studio. In CCS I've added some code for blinking GIOA2 LED. I set the breakpoint in GIOA ISR handler.

The problem I've got is that the GIOA ISR is not fired at all. I mean the TMS570 CPU should set interrupt flag on channel 9 and fire my ISR for GIOA. Instead of it I noticed that I get interrupt flag on channel 23 (GIOB) in vimREG->INTREQ0 register. 

I've checked VIM interrupt channel mapping and there is everything ok. It means that there is mapping INT_REQ9 -> INT_CHAN9 and INT_REQ23->INT_CHAN23. So when I press the GIOA7 button I should get interrupt on channel 9 but it appears as a interrupt on channel 23. 

How to explain this effect?

  • Hello,
    Channel 9 is Level 0 interrupt and Channel 23 is Level 1 interrupt. Check your GIO settings in HALCoGen to see the level of interrupt that is enabled.

    Best regards,
    Miro

  • Hi. Could you describe more precisely and verbosely what exactly should I do? I'm new to this development board. Where can I find the level of given interrupt? And what exactly is the level of the interrupt? Do you mean as a level of interrupt FIQ or IRQ?

    Kindr Regards,
    Adam
  • Hello,

    The following is GIO Block Diagram:

    In HALCoGen you can set all registers shown in this diagram.

    Regarding interrupts, If you enable GIO interrupt on a particular pin (GIOENASET/GIOENACLR), then you can select (by setting GIOLVLSET/GIOLVLCLR registers) two levels of interrupt for that GIO - level A/high level interrupt (serviced by VIM channel 9) and level B/low level interrupt (services by VIM channel 23).

    After setting GIO module then in VIM module you could select whether this GIO pin is generating IRQ or FIQ.

    HALCoGen generates interrupt handler in gio.c for the level you have selected . For example: void gioHighLevelInterrupt(void)

    Best regards,

    Miro

  • Ok, I didn't write in my first post that I selected IRQ (not FIQ) for GIOA in HALCoGen.

    The problem is that VIM tells that the IRQ came from channel 23 (GIOB) but should report channel 9 (GIOA). VIM sets bit 23(GIOB) in INTREQ0 register when I press the GIOA7 button and this is wrong because it should set bit 9 (GIOA).
  • Hello Adam,
    How did you set High/Low priority in GIO->Port A tab (what I have marked with red circle in second picture)? According to figure 19-4 if you have selected Low priority (red circle in second picture) then GIO interrupt is mapped to level B/low level interrupt (serviced by VIM channel 23).

    Best regards,
    Miro
  • Hello Miroslav,

    Yes, I set GIO->Port A the same as you: to Low Priority (selected with red circle). But it is not clear to me why GIOA interrupts will be serviced by channel 23 while in channel mapping (VIM Channel 0-31 tab in HALCoGen) for INTREQ9 I've got channel 9 (not 23).

    Kind Regards

  • Hello,
    TMS570LS0432 can generate Low level interrupt B and High Level interrupt A. This is done by GIOLVLSET and GIOLVLCLR. Low level interrupt B is with lower priority than High level interrupt A. In VIM module (Vectored Interrupt Manager module) channels with lower number has higher priority and they a serviced first. Channel 9 has higher priority than channel 23.
    TMS570LS0432 has only GIO Port A (GIOA). But it is the same for devices with more GIO ports (GIOA and GIOB for example). Both GIOA and GIOB ports will be services by GIO Int A (channel 9) and GIO Int B (channel 23).
    In your case if you select "High Priority" (the setting I have marked with red circle) then GIO interrupt generated by GIOA[7] (in this picture GIOA[7] is shown) will be services by channel 9.

    Hope this helps.

    Best regards,
    Miro
  • Ok, I think now I see what was my misunderstanding. I thought that "GIO Int A" regards interrupt for GIOA and "GIO Int B" regards interrupt for GIOB. Your last answer cleared it. GIO Int x concerns interrupt levels, not GIO ports directly. Thank you.