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

The target doesn't initialize arrays, why?

Hi, my eval board is Phytec KC-161 (with 64k ext RAM, and 256k ext FLASH). Why the target doesn't initialize arrays in free running?
Thank you.

Parents
  • I though Phytec gives you a START167.A66 file with the correct settings of the memory. But it looks like you are using a standard one and as Joost implied you most likely have a problem with this setup.

    I believe you have the data set to Flash this is your problem. You need the data in RAM.

    I would suggest that you look for this *.a66 file from Phytec or make sure you have the correct settings for SYSCON and only use the RAM on-chip for now. Your memory settings should look something like this:

    From the *.lnp file

    "START167.obj",
    "main.obj"
    TO "test"
    IXREF
    CLASSES (ICODE (0x0-0xBFFF), NCODE (0x0-0xBFFF),
    FCONST (0x0-0xBFFF), HCONST (0x0-0xBFFF),
    XCONST (0x0-0xBFFF), NCONST (0x4000-0x7FFF),
    NDATA (0xC000-0xD7FF, 0xF600-0xFDFF), NDATA0 (0xC000-0xD7FF, 0xF600-0xFDFF),
    SDATA (0xC000-0xD7FF, 0xF600-0xFDFF), SDATA0 (0xC000-0xD7FF, 0xF600-0xFDFF),
    IDATA (0xF600-0xFDFF), IDATA0 (0xF600-0xFDFF),
    FDATA (0xC000-0xD7FF, 0xF600-0xFDFF), FDATA0 (0xC000-0xD7FF, 0xF600-0xFDFF),
    HDATA (0xC000-0xD7FF, 0xF600-0xFDFF), HDATA0 (0xC000-0xD7FF, 0xF600-0xFDFF),
    XDATA (0xC000-0xD7FF, 0xF600-0xFDFF), XDATA0 (0xC000-0xD7FF, 0xF600-0xFDFF))
     CINITTAB (0x0-0xBFFF)
    


    Then you will get something like this which should work.

    C166 COMPILER V6.06, MAIN
    
    NAME                                    CLASS    SPACE  TYPE   OFFSET   SIZE
    ----------------------------------------------------------------------------
    main . . . . . . . . . . . . . . . . .  public   NCODE  funct  -----
      array. . . . . . . . . . . . . . . .  auto            array     0H    6
    ?tpl?0001. . . . . . . . . . . . . . .  static   NCONST array     0H    6
    
    
    START     STOP      LENGTH    TYPE  RTYP  ALIGN  TGR  GRP  COMB  CLASS   SECTION NAME
    =====================================================================================
    000000H   000003H   000004H   ---   ---   ---    ---  ---  ---   * INTVECTOR TABLE *
    000004H   000005H   000002H   XDATA REL   WORD   ---  ---  GLOB  ---     ?C_INITSEC
    000006H   000125H   000120H   CODE  REL   WORD   ---  ---  PRIV  ICODE   ?C_STARTUP_CODE
    000126H   000139H   000014H   CODE  REL   WORD   ---    2  PUBL  NCODE   ?PR?MAIN
    004000H   004005H   000006H   DATA  REL   WORD   ---    3  PUBL  NCONST  ?NC?MAIN
    00C000H   00C1FFH   000200H   DATA  REL   WORD   ---    1  PUBL  NDATA   ?C_USERSTACK
    00FA00H   00FBFFH   000200H   ---   ---   ---    ---  ---  ---   * SYSTEM STACK *
    00FC00H   00FC1FH   000020H   DATA  ---   BYTE   ---  ---  ---   *REG*   ?C_MAINREGISTERS
    

    If you are a student then you can post your email and I will send you a project.

    -Chris

Reply
  • I though Phytec gives you a START167.A66 file with the correct settings of the memory. But it looks like you are using a standard one and as Joost implied you most likely have a problem with this setup.

    I believe you have the data set to Flash this is your problem. You need the data in RAM.

    I would suggest that you look for this *.a66 file from Phytec or make sure you have the correct settings for SYSCON and only use the RAM on-chip for now. Your memory settings should look something like this:

    From the *.lnp file

    "START167.obj",
    "main.obj"
    TO "test"
    IXREF
    CLASSES (ICODE (0x0-0xBFFF), NCODE (0x0-0xBFFF),
    FCONST (0x0-0xBFFF), HCONST (0x0-0xBFFF),
    XCONST (0x0-0xBFFF), NCONST (0x4000-0x7FFF),
    NDATA (0xC000-0xD7FF, 0xF600-0xFDFF), NDATA0 (0xC000-0xD7FF, 0xF600-0xFDFF),
    SDATA (0xC000-0xD7FF, 0xF600-0xFDFF), SDATA0 (0xC000-0xD7FF, 0xF600-0xFDFF),
    IDATA (0xF600-0xFDFF), IDATA0 (0xF600-0xFDFF),
    FDATA (0xC000-0xD7FF, 0xF600-0xFDFF), FDATA0 (0xC000-0xD7FF, 0xF600-0xFDFF),
    HDATA (0xC000-0xD7FF, 0xF600-0xFDFF), HDATA0 (0xC000-0xD7FF, 0xF600-0xFDFF),
    XDATA (0xC000-0xD7FF, 0xF600-0xFDFF), XDATA0 (0xC000-0xD7FF, 0xF600-0xFDFF))
     CINITTAB (0x0-0xBFFF)
    


    Then you will get something like this which should work.

    C166 COMPILER V6.06, MAIN
    
    NAME                                    CLASS    SPACE  TYPE   OFFSET   SIZE
    ----------------------------------------------------------------------------
    main . . . . . . . . . . . . . . . . .  public   NCODE  funct  -----
      array. . . . . . . . . . . . . . . .  auto            array     0H    6
    ?tpl?0001. . . . . . . . . . . . . . .  static   NCONST array     0H    6
    
    
    START     STOP      LENGTH    TYPE  RTYP  ALIGN  TGR  GRP  COMB  CLASS   SECTION NAME
    =====================================================================================
    000000H   000003H   000004H   ---   ---   ---    ---  ---  ---   * INTVECTOR TABLE *
    000004H   000005H   000002H   XDATA REL   WORD   ---  ---  GLOB  ---     ?C_INITSEC
    000006H   000125H   000120H   CODE  REL   WORD   ---  ---  PRIV  ICODE   ?C_STARTUP_CODE
    000126H   000139H   000014H   CODE  REL   WORD   ---    2  PUBL  NCODE   ?PR?MAIN
    004000H   004005H   000006H   DATA  REL   WORD   ---    3  PUBL  NCONST  ?NC?MAIN
    00C000H   00C1FFH   000200H   DATA  REL   WORD   ---    1  PUBL  NDATA   ?C_USERSTACK
    00FA00H   00FBFFH   000200H   ---   ---   ---    ---  ---  ---   * SYSTEM STACK *
    00FC00H   00FC1FH   000020H   DATA  ---   BYTE   ---  ---  ---   *REG*   ?C_MAINREGISTERS
    

    If you are a student then you can post your email and I will send you a project.

    -Chris

Children