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.

loading Interrupt Service Routine into specific address

Other Parts Discussed in Thread: AM3703, DM3730

Hi There,

How could I load a ISR routine to a specific address to enable interrupt? I am using Am3703. From the spec, It seems I need to write an small ARM assembly code into a fixed address (IRQ/FIQ entry PC, 0x00000018 for IRQ). How could I load this compiled ARM assembly to that particular address in Code Composer? Is this the right way to implement hardware interrupt? Thanks for your attention.

 

Frank

  • Presume your ISR assembly source code is in a file named isr.asm, and the section is named .text.  Then this line, in the SECTIONS directive of the link command file, will do it:

    for_irq { isr.obj(.text) } > 0x18

    That line says create an output section named for_irq, it is made up of one input section, which is .text from isr.obj, and place for_irq at the address 0x18.  

    I don't know whether this is typical of how other ARM users configure interrupts.

    Thanks and regards,

    -George

  • Thanks. This is very helpful.

  • Hello,

    I'm using DM3730 processor and I use CCS v5.5. I have the following assembly code (irqHandler.asm):

        .ref IRQ_Handler
        .sect "irqhandler"
        .global irq_handler

    irq_handler: .asmfunc
    stmdb sp!,{r0-r4,r12,lr}
    bl IRQ_Handler
    ADD sp,sp,#4
    ldmia sp!,{r0-r4,r12,lr}
    SUBS pc,lr,#4
    .endasmfunc

    and here is part of my linker file: 

    MEMORY
    {
    #ifndef DSP_CORE /* ARM memory map */

    SRAM: o = 0x40200000 l = 0x00010000 /* 64kB Internal SRAM */
    BEGIN: o = 0x80400000 l = 0x00000010 /* mDDR in CS0 */
    IRQH: o = 0x80400010 l = 0x00000100
    CS0_SDRAM: o = 0x80400110 l = 0x1FBFFEF0
    CS1_SDRAM: o = 0xA0000000 l = 0x20000000

    ...

    SECTIONS
    {
    #ifndef DSP_CORE /* ARM memory map */

    .text > CS0_SDRAM
    .stack > CS0_SDRAM
    ...
    .ppdata > CS0_SDRAM
    codestart > BEGIN
    irqhandler > IRQH


    My question is, how come the irqHandler didn't get link to the memory location specified in the linker file? but it did get compiled (irqHandler.obj is there). 

    any help is appreciated. 

    Thanks,

    Aristo Wibawa

  • You probably need to use the .retain directive in that assembly function.  An explanation can be found in the documentation for the .retain directive in the ARM assembly tools manual.  

    Thanks and regards,

    -George

  • George,

    Thanks for the help. 

    - Aristo