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.
Thank you for for paying atention, Chris Wunderlich . The information you requested is: My simple code is:
#include <reg161.h> void main (void) { unsigned char array[6]={1,2,3,4,5,6}; while (1) {} }
(1),(3) the size and the declaration - look above; (2) If it'll help you to discover what may be the problem, I pasted the important parts(I think so) from two files(Ithe 'array' word is red as to find it quickly): -> "Phytec KC161.lst"
C166 COMPILER V6.06, PHYTEC_KC161 04/25/2007 09:50:00 PAGE 2 NAME CLASS SPACE TYPE OFFSET SIZE ---------------------------------------------------------------------------- BUSCON1. . . . . . . . . . . . . . . . sfr uint FF14H 2 .. .. main . . . . . . . . . . . . . . . . . public FCODE funct ----- array. . . . . . . . . . . . . . . . auto array 0H 6 ?tpl?0001. . . . . . . . . . . . . . . static NCONST array 0H 6 MODULE INFORMATION: INITIALIZED UNINITIALIZED CODE SIZE = 20 -------- NEAR-CONST SIZE = 6 -------- ......
-> "project.m66" :
....... MEMORY MAP OF MODULE: .\Object\project (PHYTEC_KC161) 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 000008H 00000BH 000004H --- --- --- --- --- --- * RESERVED MEMORY * 00000CH 00001FH 000014H CODE REL WORD --- --- PUBL FCODE ?PR?PHYTEC_KC161 0000ACH 0000AFH 000004H --- --- --- --- --- --- * RESERVED MEMORY * 0000B0H 0001CDH 00011EH CODE REL WORD --- --- PRIV ICODE ?C_STARTUP_CODE 004000H 004005H 000006H DATA REL WORD --- 1 PUBL NCONST ?NC?PHYTEC_KC161 008000H 0080FFH 000100H DATA REL WORD --- 2 PUBL NDATA ?C_USERSTACK 00D900H 00DFFFH 000700H --- --- --- --- --- --- * RESERVED MEMORY * 00FA00H 00FBFFH 000200H --- --- --- --- --- --- * SYSTEM STACK * 00FC00H 00FC1FH 000020H DATA --- BYTE --- --- --- *REG* ?C_MAINREGISTERS .......... SYMBOL TABLE OF MODULE: .\Object\project (PHYTEC_KC161) VALUE TYPE REP LENGTH TGR SYMBOL NAME ========================================================= 00000CH GLOBAL LABEL --- --- main 004000H SYMBOL VAR --- --- ?tpl?0001 00000CH BLOCK LVL=0 0014H --- main 00000EH BLOCK LVL=1 0012H --- 000000H SYMBOL AUTO --- --- array --- BLOCKEND LVL=1 --- --- ........
...and the startup file (startup.a66) that initializes the vars.
Could you provide the following information to see what might be your problem?
1) The size of your array? 2) The address of the array from the map file? 3) The declaration of the array in the C file?
View all questions in Keil forum