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

48275Re: [RoboMinds] 68332 can't run program twice

Expand Messages
  • James Fitzsimons
    Mar 2, 2014
    • 0 Attachment
      Hi Dave,

      Thanks for your reply. 

      I should have realised that of course! It's a combination of being pretty rusty when it comes to embedded development and being blinded by the fact that I keep assuming this RTEMS BSP was in a working state.

      I'm now taking nothing for granted and am working through it all once step at a time.

      So far I have found several errors in the linker file and the C start up code. I'm now debugging by "walking" some code that switches the green LED on the MRM on through the start up process. 

      Interestingly the program that was running out of RAM (albeit only once) doesn't run out of ROM, so I'm suspect about either the linker script, or some more of the BSP startup code.

      It's a slow process but I really don't want to let this one beat me now!


      On 27 February 2014 04:52, Dave Hylands <dhylands@...> wrote:
      Hey James,

      On Wed, Feb 26, 2014 at 1:49 AM, James Fitzsimons <james.fitzsimons@...> wrote:

      > So! I'm beginning to think this RTEMS BSP for the MRM can never have worked in it's current state. If I was running this out of ROM I wouldn't have this issue as the crt0 code would be copying a fresh version of the .data section into RAM each time, however I am running out of RAM so that is not happening. Does it seem strange that you would need to have a second copy of .data even when running out of RAM though?
      > Thanks all - I am now one step closer to understanding this problem.

      This isn't necessarily surprising. Many programs won't work if you run them out of RAM without reinitializing .data.

      If your code did something like this:

      bool already_initalized = false;  // Declared as a global

      if (already_initialized) {
      already_initialized = true;

      Then the second time that you ran that function already_initialized would be set to true and it wouldn't do the initialization, which could cause all kinds of havoc. Any globals containing pointers into the heap would be invalid since the heap would be reinitialized, but the data section would still have stale pointers.

      Dave Hylands
      Shuswap, BC, Canada

    • Show all 8 messages in this topic