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

problem compiling standard keil examples

I have been using ARM for a few days and downloaded the file lpc2100_intsio.zip from the Keil file download section. I have a question. The program compiles and runs fine in THUMB mode, but when I switch the Target options to ARM mode the compiler generates 2x errors. Error L104 Multiple public definitions of putchar?A and _getkey?A and and 1x warning L23 unresolved external symbols.

For the life of me I cannot figure how to fix the problem. I would greatly appreciate if someone can enlighten me!

Also I see that it should be possible to change the serial window 1,2 or 3 to look at the Com1 port (to save me running hyperterminal). I see the information about using the ASSIGN command. But I dont get what I have to do, I have tried doing this in the start-run-cmd window of windows and it keeps giving various errors. Can someone provide a "dummies guide" as to how to do this - thanks

  • You need to put a -

    #pragma INTERWORK
    

    in front of your 'Serial.C' which contains putchar(), getchar(), init_serial() etc. This works for both arm and thumb mode.

  • Peter, Thank you it worked. I don't think I would have found this option by myself. I notice that the Options for target menu changes. With the examples the Target-options tab has a C tab. But if I create a new project I see an target-options with a C/C++ tab under that tab there is a button to select "Enable Arm/Thumb interworking". This sounds they added the same thing as a selectable option?

    Thanks for the help.

  • Graham,

    The 'C/C++ tab' exists only if you have selected the RealView Compilation Tools. You can choose the toolset you like under 'Components, Environment and Books' using the Folders/Extensions tab. You will notice that 'Use RealView Compiler' is selected there.

    One more note on the toolset: if you are starting a new ARM project, then you should use the RealView Compiler tools. The CARM toolset is no longer actively developed and will disappear from the CD someday in the future. Also, the RealView Compiler supports ARM7, ARM9 and Cortex - besides ARM7, the CARM tools will never support ARM9, Cortex etc.

    Hope that brings some light into this corner.

    Regards,
    Peter