Loading ...
Sorry, an error occurred while loading the content.

205Re: Build without debug info

Expand Messages
  • gnuarm
    Jan 27, 2011
      Well done finding this so quickly. Memory bugs can be some of the hardest to spot. I expect there is a flag somewhere to initialize memory to zeros. When you switch to debug it is getting turned on, but I'm pretty sure you can turn it on for release code as well.

      Good luck!

      Rick


      --- In OKI-ARM-mcus@yahoogroups.com, Ed Feten <Fetona@...> wrote:
      >
      >
      > Thanks for the tips Rick. To answer one of your questions, my program runs from Flash. I was able to connect the emulator and here is what I have found so far:
      >
      > 1.) I had a variable that I had to add the volatile qualifier to. For some reason the debug build didn't have problem but the release version did. So that was the 1st place where my code was getting stuck. It was getting stuck in the while loop shown below;
      >
      > // Wait here while sysetem determines what the line frequency is
      > while( TRUE == measureFrequency );
      >
      > 2.) It seems that when I do a debug build, all static variables declared in a file are initialized to 0. In the release mode, the static variables are not initialized to 0. This was causing big problems, I had some variables that were being used as array indexes. When those indexes were used to access elements of the array, the program would access invalid memory locations and consequently my program was jumping to the abort exception.
      >
      > So the good news is now my program runs and it takes up way less FLASH. Now I just need to go thru the code and try to find any other potential trouble spots. I ported this program over from an 8051 platform several years ago so I am sure there are other little or big problems lurking.
      >
      > Thanks,
      > Ed
      >
      >
      >
      > To: OKI-ARM-mcus@yahoogroups.com
      > From: gnuarm.2006@...
      > Date: Wed, 26 Jan 2011 21:05:55 +0000
      > Subject: [OKI-ARM-mcus] Re: Build without debug info
      >
      >
      >
      >
      >
      >
      >
      >
      > I can't give you any specific advice, but this sounds like a memory problem to me. Either part of your program is clobbering another part and setting the debug option moves things enough that it isn't a problem anymore. Does your program get copied to ram before execution or does it run from Flash?
      >
      > Check the mapper output for each and see where the sections are being located. Maybe something is going past the end of ram? I guess the linker/mapper would warn you of that though.
      >
      > Do any parts of your program work or does it not come up at all? Can you connect a JTAG debugger?
      >
      > Rick
      >
      > --- In OKI-ARM-mcus@yahoogroups.com, "edfeten" <Fetona@> wrote:
      > >
      > > Ok here is another question.
      > >
      > > I have an application that runs on the ML67Q4003. My program will only run on the hardware if I build with the *Active config set to Debug. If I set the *Active config to "Release", it will build the hex file without problems but it won't run on the hardware.
      > >
      > > This hasn't been a problem in the past, but now I am getting close to using up all the chips flash. So I want to do a release build since it uses much less memory (flash).
      > >
      > > Does anybody know what the problem could be? I am using the RealView tools version 1.6.1
      > >
      > > Thanks,
      > > Ed
      > >
      >
    • Show all 5 messages in this topic