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

Memory models/support reply times

Hi all,

I posted a support request (now viewable when I log into https://silver.arm.com) on Thursday morning and have yet to hear back. Does anyone know how long it normally take to get support? I need to be completing some work with the Keil compiler soon and this is really holding me back!

Incase anyone here can help me, here is the request:

I am encountering problems with memory models, and would appreciate some help. Here is what I
am trying to do:

- Compile many files (~240) with the following compile options:
C166.exe filename OBJECT(objectname) MODV2 MEDIUM BROWSE MODV2 WL(0)
- Add these files to a library:
LIB166.exe TRANSFER a.o, b.o, c.o, ..., z.o TO MYLIB.LIB
- Compile a file and link in this library
C166.exe myFile.c OBJECT(myFile.o) MODV2 MEDIUM BROWSE MODV2 WL(0)
L166.exe myFile.o, location\MYLIB.LIB TO myExe.exe assortedOptions

The problem is that when I carry out the last step, I get various warnings saying that I have
incompatible memory models, e.g.

*** WARNING L14: INCOMPATIBLE MEMORY MODEL MODULE: C:\workspace\Cantata++Deployment2\libs\lib-Keil_C166_c\LIBCANTPP.LIB
(CPP_TMP_T1A02) MODEL: SMALL
*** WARNING L14: INCOMPATIBLE MEMORY MODEL MODULE: C:\workspace\Cantata++Deployment2\libs\lib-Keil_C166_c\LIBCANTPP.LIB
(CPP_TMP_T1A3Y) MODEL: SMALL

t1a02.c and t1a3y.c are two of the ~240 files.

What is puzzling me is that when I try to compile and link myFile.c with the small memory model selected instead, I get some warnings like this:

*** WARNING L14: INCOMPATIBLE MEMORY MODEL MODULE: C:\workspace\Cantata++Deployment2\libs\lib-Keil_C166_c\LIBCANTPP.LIB
(CPP_TMP_T2A22) MODEL: MEDIUM
*** WARNING L14: INCOMPATIBLE MEMORY MODEL MODULE: C:\workspace\Cantata++Deployment2\libs\lib-Keil_C166_c\LIBCANTPP.LIB
(CPP_TMP_T2A30) MODEL: MEDIUM

where t2a22.c and t2a30.c are another two of the ~240 files.

This implies that some of the 240 files (e.g. t1a02.c and t1a3y.c) have been built with the
small memory model and some of them (e.g. t2a22.c and t2a30.c) have been built with medium.
Which is very strange indeed because I have built every single file with the same options:
C166.exe filename OBJECT(objectname) MODV2 MEDIUM BROWSE MODV2 WL(0)

So far I have been unable to determine why t1a02.c and 34 other files are 'small'. I've checked their LST files, and it shows that they've been compiled with the MEDIUM option.

Thanks,

Emma

  • I would stop disabling the warnings from the compiler. There may be a warning that indicates what's going on. In the shops where I've worked, disabling any compiler warnings without written justification wasn't allowed.

    Also, I'm pretty certain it's possible to change memory models in the source file. Maybe the model is getting changed by a header file or source file.

    Jon

  • Hi Jon,

    Thanks for the reply. The reason I'm suppressing warnings is that my customer provided their standard compile options for me to use (including the WL(0)). I've deleted the option for now though.

    I'm getting a fair few warnings for some of the files: a few unknown pragmas ('line ignored'), a few unreferenced parameters and some unreferenced static functions. At the moment I can't find a link between the files with lots of warnings and the ones which are coming out, mistakenly, as small (but I'll keep looking :) ).

    Do you know how memory models can be changed in the source file? The source doesn't deliberately contain anything about memory models.

    Thanks again,

    Emma

  • Emma;
    Just a thought! In the Project window, look for any source files with custom options. They will appear with three red squares to the left of the source file. Right click on any of the suspect files and select Options. Look at the Register Optimization and the Emphasis windows.

    These two selections can change options for single source files and they will override any global options in the Target window.

    Bradford

  • Hi Bradford,

    Thanks for the thoughts :) At the moment I'm compiling the files on the command line rather than in the IDE. I don't think therefore that any rogue options could be making their way in. I tried compiling a few in the IDE a while back, and I don't recall any red squares.

  • Ooh, it seems adding a #pragma medium line at the top of the source files forces them to be medium. No idea why they weren't before, but this solves the current problem.

    Thanks to everyone who replied :)