Hi all, indeed, Peter described what happens and he's right - the CW *doesn't* check if your data exceed the size of pFlash. The thing it actually does is that it checks whether your data fit into particular MEMORY segment. However, this doesn't prevent your data from exceeding the size of pFlash if it consists of several MEMORY segments located using the linker command 'AT' (which is the case, I guess, if you store your globals' init values into pFlash memory - .pIntRAM_Mirror or something similar). Regards, Lubomir -----Original Message----- From: Pete Becher [mailto:] Sent: 15. kvetna 2003 16:37 To: Subject: [motoroladsp] Re: CodeWarrior linker does not check memory limits John, If it is checking, it must not be doing a very good job of it. I am only using about 1/10 of my stack space so I'm quite sure that is not the problem. My .xMAP file was showing that the sum of the segments that go into pFLASH (.pFlash, .pIntRAM_Mirror, .xExtRAM_Mirror) is larger than the .pFlash segment. However, I should say I was getting the following error message randomly. Can't write application "M2CanCntlV0.00.15.S". An unknown error occurred when linking target "Flash" for project "M2CanContl.mcp". If I reboot or remove object code, recurse and reboot it will compile and link "just fine". When is the last time the linker was checked for this condition? Maybe there is an error in my linker.cmd file that could cause this or maybe it is just a CWerk. Pete --- In , "jdw_atx" <jdw_atx@y...> wrote: > Pete, > > The CodeWarrior linker DOES check for memory overruns in segments > already so that must not be what is happening. > > If you are using the Embedded SDK (which it sounds like you are), the > PFlash memory segment is defined as follows on the 805 for example: > > MEMORY { > > .pFlash (RX) : ORIGIN = 0x0086, LENGTH = 0x7D7A > > If that MEMORY segment exceeds the pre-defined length of 0x7D7A in > your project the linker will return an error and not finish the build > so that must not be what's happening in your case. > > What the linker doesn't do for you is it doesn't check for stack > usage > to make sure that you will not exceed the amount of space that you > have alloted for it which can lead to funny behavior when you run > your > project (maybe that is what is happening). However, the Embedded SDK > includes stack check utilities to help out in that regards.....see > 5.2.2 in the SDK Programmer's Guide. > > Regards, > John |
RE: Re: CodeWarrior linker does not check memory li mits
Started by ●May 15, 2003