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

Memory corruption on TJPro with IC

Expand Messages
  • Dafydd Walters
    Has anyone experienced unexplained corruption of array variables on the TJPro when programming in Interactive C? If so, do you have any idea what could be
    Message 1 of 1 , Sep 1, 2000
    View Source
    • 0 Attachment
      Has anyone experienced unexplained corruption of array variables on
      the TJPro when programming in Interactive C? If so, do you have any
      idea what could be causing it? Of course the obvious answer is that
      there is a bug in my code (and I will continue to look for one), but
      I thought it would be worth shooting off this post to see if anyone
      has had any similar experiences.

      The code I am writing uses fairly large arrays. Could I be reaching
      any kind of IC memory constraints (before reaching the hardware
      constraints)? If so, IC is not telling me (and I've noticed that
      it generally *does* go out of its way to let you know when you're
      trying to do something you shouldn't, like access an array out of its
      bounds).

      I've just bought ICC11, so I will be moving my code over to that
      compiler soon, but I'd still like to get to the bottom of my problems
      in IC.

      Here are the kind of problems I am seeing (not all at the same time)
      with a typical array declaration, say:

      int readings[20];

      - Just entering 'readings[10]' at the IC> prompt gives rise to
      an "Array reference out of bounds" error.

      - Entering 'readings[2] = 123' followed by 'readings[2]' at the IC>
      prompt returns some large integer, instead of the expected 123.

      - Sometimes entering 'readings[22]' does *not* give rise to an "Array
      reference out of bounds" error, even though in this case, I would
      expect one.

      I should point out that I've seen these problems even without any
      threads running (except the IC user interaction thread).

      Of course it did occur to me that perhaps the MTJPRO11 board isn't
      working properly, but I think that's unlikely. Does anyone have any
      code that thoroughly exercises the memory? If not I may have to
      write something to do this just to rule out a bad SRAM chip.
    Your message has been successfully submitted and would be delivered to recipients shortly.