This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using external INT0 on DSTINI400 in C with Keil

I have bodged an Exar UART onto a DSTINIs400 board & need to use INT0 with it. As a starting point pressing a push button to create an INT to test a handler gets executed would be nice before getting into writing various UART routines.

When I compile my C code, I get the
warning L30: memory space overlap
from c:200003H
to c:200007H

I'm not sure why this has happened & how do I get it working??

I am using the mon390 code to debug.

Help! Thanks

Trevor

  • That's essentially just the linker's somewhat cryptic way of telling you that you tried to define two distinct interrupt handlers for the same interrupt. Which, obviously, can't work.

    Odds are that the software you're adding that UART to already is using INT #0 in some other way. Check the rest of the message, and/or the map file, to see where the second one is coming from.

  • Thanks for the reply.

    The code I have written doesn't contain anything else, I am using:

    void Ext_INT0 (void) interrupt 0
    {
    counter++;
    }

    to test INT0, but I get a similar warning (with different addresses) if I change the interrupt number from 0 through to 8, implying that the first 9 are being used...

    Could it be something to do with mem map & vector address location, or someting else under the target options?

    Trevor

  • Looks like there is already code at your interrupt vector location. Take a look to the MAP file of your project to figure out where the code space is already used.

  • The code I have written doesn't contain anything else

    That may be the case --- but that doesn't say anything about code others have already written, and which has become part of your project one way or another. That's why it's so important to actually go and check the full linker report, i.e. the map file.

  • OK - discovered map file...

    The startup400.a51 file I am using has

    ?C_CPURESET?0 segment code at 200000H
    
    causing the overlap - int vector code also goes in this area.

    I took this start-up code from the Hello World type example. I'm not really clear on how interrupt vectors / mem map / start up code fit together - should I be using a different type of start-up code that sets up int vectors too, or can I just shift where this code is?

    Thanks

    Trevor