Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

More than one IRQ interrupt source with TMS570 (LC43)

Posted by simointe on September 12, 2016

(TMS570LC4, C++) I have a fully functionnal FreeRtos implementation on TMS570. My high frequency interrupt is on FIQ though, and now I want to change it on IRQ. FreeRtos is on IRQ, are interrupts could be nested and how ? I have already some assembler code to handle this in « usual C++ function » but I don't know how to merge it within the vPortPreemptiveTick and vPortYeildWithinAPI interrupts. You could refer to a previous post I've done.

https://sourceforge.net/p/freertos/discussion/382005/thread/0caeaa55/#45db

For others interrupt than FreeRtos, nesting seems to work (no crash at least) puting this 2 little codes before and after:

BEFORE /// Copy SPSRirq to LR /// Save SPSRirq /// Enable IRQ and set System Mode /// Save LR //----------------------------------------------------------------------------- { asm( " ADD SP, SP, #8 " ); asm( " SUB LR, LR, #4 " ); asm( " SRSFD #0x12 ! " ); asm( " CPS #0x13 " ); asm( " PUSH {R0-R12} " ); asm( " FMRX R5,FPEXC " ); asm( " PUSH {R5} " ); asm( " FMRX R5,FPSCR " ); asm( " PUSH {R5} " ); asm( " FSTMDBD SP!, {D0-D7} " ); asm( " MOV R1, SP " ); asm( " AND R1, R1, #4 " ); asm( " SUB SP, SP, R1 " ); asm( " PUSH {R1, R14} " );

AFTER /// Restore LR /// Disable IRQ (IRQ Mode) /// Restore SPSRirq to LR /// Copy LR to SPSRirq //-----------------------------------------------------------------------------
asm( " POP {R1, LR} " ); asm( " ADD SP, SP, r1 " ); asm( " FLDMIAD SP!, {D0-D7} " ); asm( " POP {R5} " ); asm( " FMXR FPSCR, R5 " ); asm( " POP {R5} " ); asm( " FMXR FPEXC, R5 " ); asm( " POP {R0-R12} " ); asm( " CPS #0x12 " ); asm( " RFEFD SP! " );


More than one IRQ interrupt source with TMS570 (LC43)

Posted by davedoors on September 13, 2016

It is normal to have more than one interrupt on the irq. Find some Cortex R irq nesting code here:

https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/portable/GCC/ARM_CR5/portASM.S

or maybe here depending on your interrupt controller

https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/portable/GCC/ARMCRxNo_GIC/portASM.S


More than one IRQ interrupt source with TMS570 (LC43)

Posted by simointe on September 13, 2016

As you know, there is already a portAsm file in my ARM_Cortex-R4 directory. This new file is to add, or merge ? Could-you indicate how to use it. Thanks.


More than one IRQ interrupt source with TMS570 (LC43)

Posted by rtel on September 13, 2016

The link was to a generic Cortex-R port which supports interrupt nesting. For historical reasons the RM48/TMS570 port is different, so the files are not compatible.

See the "interrupt service routines" section of the following page for information on adding additional interrupts http://www.freertos.org/FreeRTOSforTIRM48andTMS570.html

Search for all occurrences of vSCIInterruptHandler in the following file to see how an interrupt is defined and installed.

https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Demo/CORTEXR4RM48TMS570CCS5/serial.c


More than one IRQ interrupt source with TMS570 (LC43)

Posted by simointe on September 13, 2016

More than one IRQ interrupt source with TMS570 (LC43)

Posted by simointe on September 20, 2016

Thank you. The ISR section of the TMS570LC4 FreeRtos port indicates that there is no special thing to do comparing to compiler specifications. Basically, it is said in the TMS that you just have to activate the interruption in the ISR if you want to be preampted by other high priority interrupt. The ISR that preampt have to take care of the context. Now, I need some help to know where to enable the interrupt. I've tried many things no success.

vPortPreemptiveTick:

	; Save the context of the current task.
    portSAVE_CONTEXT

    ; Clear interrupt flag
    MOVW    R0, #0xFC88
    MOVT    R0, #0xFFFF
    MOV     R1, #1
    STR     R1, [R0]

    ;HERE ????????
    ;Enable int.
    CPSIE I

    ; Increment the tick count, making any adjustments to the blocked lists
    ; that may be necessary.
    BL      xTaskIncrementTick

    ; Select the next task to execute.
    CMP	R0, #0
    BLNE    vTaskSwitchContext

    ; Restore the context of the task selected to execute.
    portRESTORE_CONTEXT

Best Regards.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS