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.

ez430-RF2500 conflicting interrupt vectors using MRFI [newbie]

Other Parts Discussed in Thread: SIMPLICITI

Let me preface this post with the fact that I've only been doing programming for the msp430 for just about 2 months. I have no prior experience with any embedded programming other than what I've learned working on this project.

I'm trying to add the RF API from the SimpliciTI package into my existing project. The project involves RS485 ICs. I enabled the interrupt on pin 6 (P2.3) from the ez430 board and connected it to pin 1 (R) on the RS485. I've successfully programmed two target boards to send data back and forth over the RS485 connection and the next step is to add a third target board to connect to one of the wired boards wirelessly. I'm getting the error described below when I go to download/debug...

Warning[w52]: More than one definition for the byte at address 0xffe6 in common segment INTVEC. It is defined in module "mrfi" as well as in module "main"

 

I know the problem is with conflicting "pragma vector" methods, mine and the MRFI's. How do I fix this issue? I need to "listen" on the RF end AND the wired end, but they're using the same ports. I appreciate any help. Thank you.

  • apparently both, your main and the mrfi module, wants to react on the same interrupt with an ISR. This is not possible.It's not about using the same ports, it's that an event can only trigger one interrupt function to be executed. And there are two competing for this hardware functionality.

    Eithe ryou include your functionality into the mrfi function or include their functionality in yours. It is possible (but I cannot tell for your compiler how it works) to call one from the other, but you won't get away without altering the mrfi module one way or the other.

    There is only one hardware interrupt vector for this specific interrupt and two functions want it to point to them. This is as impossible as writing two independent values into one variable without overwriting the other one.

    you should read the users guide chapter about interrupt vectors. The 'pragma' just assigns a functions address to a vector. Which of course only works for one.

  • I'm using IAR workbench and C code. I've found the method in the mrfi module relating to the PORT2_VECTOR which is what I'm after. Unfortunately, my knowledge of C is limiting what I can do next.

    BSP_ISR_FUNCTION( BSP_GpioPort1Isr, PORT2_VECTOR )
    {
      /*
       *  This ISR is easily replaced.  The new ISR must simply
       *  include the following function call.
       */
      MRFI_GpioIsr();
    }

    I don't know how to make a call to a method inside the scope of my main from the mrfi module properly.

  • It looks like the ISR inside the MRFI module is simply calling a (normal) function MRFI_GpioIsr.

    There are three options.

    Since only one ISR can be assigned to a vaector, you can either comment out the whole BSP_GpioPort1Isr function, write your own and include the call to MRFI_GpioIsr() into it.

    Alternatively, you can put your own ISR codeinto the existing ISR, eigher before or after the call to MRFI_GpioIsr.

    Both require that you alter the file inside the MRFI source.

    There might be a third solution:

    BSP_ISR_FUNCTION is not a normal intrinsic function for defining an ISR.
    It rather looks like a macro that is defined by the MRFI module.
    Maybe there is a switch defined somewhere that will cause this macro to either expand to an ISR or expand to a normal (yet usueless, since never called) function.
    The prefix BSP_ and the use of a macro seems to indicate this.

    So if you set this switch (however it might be implemented, perhaps a global define or a compileer define that must be added to the compiler project settings or whatever, I'd look for a commented #define NO_BSP_ISRS or something like that, maybe in a MRFI_config.h file or such), you must implement ALL BSP_xxx ISRs yourself in your own code, but you must include the function calls used in the BSP_ ISRs.

    Anyway, you should lokk into these functions, because if they rely on e.g. an interrupt status register which is cleared by reading it, you may not read it in your own ISR or the called MRFI function wouldn't work anymore (as the register would be empty then)

     

  • I went with the 2nd option and added a call to my ISR method and all seems well. I will probably try the 3rd option if time allows. Thank you for the help!

  • I was pulling out hair over this problem!

    Thanks to Jens-Michael Gross for a succinct solution!

    I simply 'removed' the BSP_ISR_FUNCTION( BSP_GpioPort1Isr, PORT2_VECTOR ) function from mrfi_board.c and move the call to MRFI_GpioIsr to an appropriate place in my ISR code. 

    Now everything is tickety-boo!

  • Hi thats exactly what I would like to do but it tells me that: Error[Pe223]: function "MRFI_GpioIsr" declared implicitly
    How do I overcome this issue? I am not an expert with microcontrollers at all but would appreciate the help. Are there files I need to include to define the function?
  • I don't know this exact error, but it seems to indicate that you call a function (or pass a pointer to it) that hasn't been declared yet (in code or in a header file).
    The call might be the result of a macro expansion. Without knowing the code line(s) that lead to the error, I can't help.

**Attention** This is a public forum