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

Possible scatter file problem

  • Note: This was originally posted on 30th October 2012 at http://forums.arm.com

    I think what you're seeing is that DS-5 is compressing the RW data at link time and at execution time decompressing it in place.  The second time your image runs (without having been loaded again) the decompression is reattempted with less than good results.  You can disable this by telling armlink --data_compressor=none (or some such).  Note that if you have initialized globals/statics (e.g. "int x = 42;") they will not be re-inited for the second run (also true with ADS).

    Two other things to note:

    [] The "CODE16" directive does not emit any instruction to change processor states at runtime, so if your startup code begins in ARM state I don't think it's doing quite what you think it's doing.  If it begins in Thumb state then the comment "start with any ARM instruction" is confusing.


             AREA        reset, CODE, READONLY
             ENTRY
          tsteq    r0, r0                    ; start with any ARM instruction
    ; *** needs an ldr/bx here to switch to Thumb state?
       CODE16
                    ldr   r0, =BEGIN_ARM_STATE
                    bx          r0
       CODE32
    BEGIN_ARM_STATE
                    ldr  r13, =TOP_USER_APPLICATION_STACK ; Init stack User
    [...]


    [] If it doesn't change at runtime you probably want g_CommandArray to be 'const' so that it is in the RO section instead of the RW section (although if it's never in ROM then there's not much advantage and RO won't get compressed).
  • Note: This was originally posted on 3rd November 2012 at http://forums.arm.com

    Scott,

    Thank you very much for your insight.  It was indeed the compression issue you mentioned.  I turned it off and everything started to work immediately.  You saved me an untold amount of time.

    Thanks,
    Ray