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.

TMS570LS1224: Interrupts and Configure Threadx to Halocgen generated code.

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN

Interrupts and Configure Threadx to Halocgen generated code.

 

We are using TMS570LS1224PGE for one our safety product, and using Hlcogen(04.05.02) to generate code and IAR Embedded Workbench. We want use irqDispatch mode for interrupts. _irqDispatch function is not generated by Halcogen. Is it bug with Halcogen or what way implement _irqDispatch function. sample code will be helpful.

 

We are configuring the Threadx for TMS570LS1224PGE, as per Thread safety manual, _tx_thread_context_save should be called before the IRQ dispatch, to do this we need edit halcogen generated code, by doing this we might lose the  safety certificate(package) bought from TI for halcogen.

Is there any way to configure without handing editing the Halcogen generated code and same time satisfying Threadx safety manual.

snap from thredx safaty manul.

Standard IRQ Interrupts

Standard IRQ interrupts are the most common. In this implementation, all IRQ interrupts are funneled through the IRQ vector at address 0x18. The IRQ interrupt processing must then figure out which interrupt(s) occurred and dispatch accordingly. The following is an example of a standard IRQ interrupt handler in ThreadX:

RSEG .text:CODE:NOROOT(2)

PUBLIC __tx_irq_handler

RSEG .text:CODE:NOROOT(2)

PUBLIC __tx_irq_processing_return

__tx_irq_handler

;

; /* Jump to context save to save system context. */

B _tx_thread_context_save

__tx_irq_processing_return

;

; /* At this point execution is still in the IRQ mode. The CPSR,

; point of interrupt, and all C scratch registers are available for

; use. Note that IRQ interrupts are still disabled at this

; point. */

;

; /* Application ISR dispatch call goes here! */

;

; /* Jump to context restore to restore system context. */

B _tx_thread_context_restore

 

Vectored IRQ Interrupts

Vectored IRQ interrupts are implementation specific for the ARM9 architecture. The primary advantage is that each IRQ interrupt source has a unique vector address, which is specified by the application during initialization. Hence, vectored IRQ interrupts eliminate the need for an IRQ dispatch function. This makes the interrupt handling logic simpler and more streamlined. The following is an example of a vectored IRQ interrupt handler in ThreadX:

RSEG .text:CODE:NOROOT(2)

PUBLIC __tx_example_vectored_irq_handler

__tx_example_vectored_irq_handler

;

; /* Jump to context save to save system context. */

STMDB sp!, {r0-r3} ; Save some scratch registers

MRS r0, SPSR ; Pickup saved SPSR

SUB lr, lr, #4 ; Adjust point of interrupt

STMDB sp!, {r0, r10, r12, lr} ; Store other registers

BL _tx_thread_vectored_context_save

;

; /* At this point execution is still in the IRQ mode. The CPSR,

; point of interrupt, and all C scratch registers are available for

; use. Note that IRQ interrupts are still disabled at this

; point. */

;

; /* Application ISR dispatch call goes here! */

;

; /* Jump to context restore to restore system context. */

B _tx_thread_context_restore


  • Hello Sheetal,

    Threadx is not listed as one of the supported RTOS's on our product pages. This doesn't preclude them from supporting Hercules but it is something they would need to support as we have no experience with it. In fact, all of the RTOS's that support Hercules are third party applications and our ability to support them is limited. I would suggest you reach out to ThreadX for support since we have no license or experience with this OS.

    In regard to the _irq_Dispatch function you are mentioning, I assume this is something that is specific to ThreadX as well and would not be supported directly through Halcogen. Halcogen creates the interrupt vectoring for abort, prefetch, IRQ, FIQ, etc. in the sys_invects.asm file. In addition, interrupts are initialized in the sys_vim.c. VIM is our vectored interrupt manager.
  • HI,

    I want implement IRQ_Disaptch function please provide sample example, Halcogen does not generate IRQ Dispatch function.

     

  • Hello Sheetal,

    Threadx is not an RTOS that we support nor is Hercules supported by Threadx based on the information contained on their website. This is why there is no IRQ_Dispatch function created. Please contact Express Logic for assistance since they would need to help port their ThreadX RTOS to support Hercules.