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.

How to disable/enable interrupt in ARM (no thumb)

Other Parts Discussed in Thread: SYSBIOS

Hello,

 I just want to activate the global interrupt, like with _enable_IRQ(), but since I'm not in thumb anymore, it does not build:

...warning: intrinsic "_enable_IRQ" not supported in thumb mode, treated as function call

...and unresolved symbols in the linker.

 

_enable_IRQ line is recognized with rtsv7R4_T_be_v3D16_eabi.lib, but I don't want to be in thumb.

 

What's the equivalent in ARM? I cannot found it anywhere!

By the way, where can I found the assembler instruction set for the TMS570?

Is there a way to call these instruction using a method from a xdc package?

 

My run time support library is: rtsv7R4_A_be_v3D16_eabi.lib, but was

Target is ti.targets.arm.elf.R4Ft_big_endian

 My chip is TMS570LS20216SZWT and I've got the development kit TMDX570LS20SUSB.

CCS4.2

 

  • Simon lapointe said:
    .warning: intrinsic "_enable_IRQ" not supported in thumb mode, treated as function call

    You only see this message if you are building with the --thumb_state (or -mt) option.  Remove that option and it will work.

    Thanks and regards,

    -George

  • Hi Simon,

    Regarding you request concerning documentation.

    Cortex-RF is compatible with ARM7, so you can use TI SPNU134b (http://focus.ti.com/lit/ug/spnu134b/spnu134b.pdf). For the ARM v7R architecture (Cortex-R4F) you would be better off using ARM DDI0406B (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0406b/index.html). This describes the v7A and V7R architecture and the corresponding instructions. You need to create a user ID to download from the ARM site.

    From information supplied by  and  in forum post http://e2e.ti.com/support/microcontrollers/tms570/f/312/p/88490/306317.aspx#306317.

    Regards, Tony.

     

  • I'm still stuck with the thumb problem, I do not want to be in this mode and I do not compile with the -mt option at all.

    In fact I was wrong previously, using  rtsv7R4_A_be_v3D16_eabi.lib or rtsv7R4_T_be_v3D16_eabi.lib doesn't seem to matter. It seems really to be my target lib ti.targets.arm.elf.R4Ft the problem (Cortex R4 big endian thumb2 with floating point support (vfpv3d16) (ELF)).

    If I try ti.targets.arm.elf.R4F (no thumb) but I got this error:

    «

    Error: Target not supported: ti.targets.arm.elf.R4F

    »

    Do I have another alternative?

    Is it possible to use SYS/BIOS without the RTSC?

    Simon

     

     

  • By the way, in the ARM architecture reference manual I`ve read that the in thumb many common operations are most efficiently executed using 16-bit instructions.

    I want to optimize my application for speed. Is it better for me to be in thumb? Well the lib that build is in fact in thumb II which is a variant of thumb.

    Simon

     

  • Simon,
    you can't use SYS/BIOS without RTSC, but if you get a message that target is not supported by RTSC, it usually means that SYS/BIOS does not support that target either. As far as I can tell, SYS/BIOS supports only R4 thumb targets. Someone from the SYS/BIOS team might know more about the future plans.

  • Thanks for the info.

    Could you contact this person in order to have a post informing what about the futur plan and to know if SYS/BIOS without RTSC support 32bits ARM mode.

    We got recently a TI formation here on the TMS570 and the guy said that ARM will migrate in thumbII, ARM mode will not be there anymore. Is that exact and is it why SYS/BIOS not support ARM?

    Simon

  • Simon --


    We have no plans to support Arm mode for SYS/BIOS on the R4.   I think you should use the BIOS Hwi_enable API to enable interrupts.  Our Hwi module for the Arm defers to an assembly language function to disable interrupts if the code is compiled in thumb mode.

     

    #include <ti/sysbios/hal/Hwi.h>

    Hwi_enable();

     

    This brings up another point.    You should defer to BIOS to enable interrupts the first time.  The last line in main() should be a call BIOS_start().  BIOS_start() enables interrupts and enables BIOS scheduler so tasks start running.   Use Hwi_disable/Hwi_restore() to manage interrupt enable/restore.

    -Karl-

  • Thank for the answer. Those informations are very good but I think I had to explain at the very beginning of my post what I`m trying to do:

    I`m trying here to evaluate the impact (on CPU load overhead) of using SYS/BIOS and threads compare to our application with a home-made implementation.

    I`ve implemented a stip-down version of my application as a project WITHOUT RTSC. I use a timer and ISR and I increments a counter in the main loop as a measurement. All is going well.

    I`ve implemented on another projet RTSC-SYS/BIOS and use a timer HWI thread and a task thread to increment my timer. So all in going well at this point also.

    BUT, we realise that the mapping and probably optimisation of both projets aren`t the same, so the comparaison isn`t satisfying.

    So I`m trying to merge both projet in one RTSC project to have the same segment mapping, optimisation and all the stuff. My strategy is to commented out things I do not need for my home-made application measurement (BIOS_start() for instance) and use a custom defined timer to do the interrupt. At this point it doesn`t work.

    My custom timer does not start, I have no interrupt (and by the way that`s why I was trying to enable by hand interrupt). It seems to have a conflict somewhere.

    Questions:

    Do you have a suggestion?

    Do you have a RTSC project exemple that define a timer interrupt WITHOUT using a Hwi thread? Or better than that, a project that use Hwi thread based on a timer AND a another custom timer interrupt witout Hwi thread?

    How you know which HAL timer RTSC is using, where I have to look in the lib code to avoid custom configure the same timer as RTSC?

    Simon

  • To respond to my first question, this is the code that works:

    //_enable_IRQ();
    asm(" MRS R0, SPSR");
    asm(" BIC R0, R0, #128");
    asm(" MSR SPSR_cf, R0");

     //_disable_IRQ();     
       asm(" MRS             R12, CPSR");
       asm(" ORR             R12, R12, #128");
       asm(" MSR             CPSR_cf, R12");
    

     

    Simon

  • Simon --

    Be careful with inline asm code.  The compiler just drops these into the code stream and doesn't parse this code for register use, etc.  It's very possible that the compiler is using R0 or R12 for something else and this assembly code would conflict with that.   You should make these into separate functions, similar to the ones we made for BIOS.   Why aren't you using BIOS's Hwi_disable/restore?

    -Karl-