DSC56800/E xMAP question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DSC56800/E xMAP question

667 Views
bdang
Contributor II

Tool: Codewarrior tool for DSC56800/E version 8.3 build 091203

target: 56F8367 processor

Could someone help explain the xMAP below. 

I have z1_table[] declared as below, and I think the array is in internal data RAM. But looking at the xMAP file it doesn't make sense to me why it says  the array z1_table is in # .data_in_p_flash_ROM? The location seems to be in RAM, as all other global variables are also stored in RAM, signaled with # .data in the xMAP and begins at 0x209A.

Thank you,

Brian


unsigned long z1_table[]=
{
0,
108,
217,
325,
434,
542,
650,
759,
867,
975,

........

}

xMAP file shows:

# .user_flash_ROM_data

# .data_in_p_flash_ROM
#>00000001 __xRAM_data_start (linker command file)
00000002 00001002 .data Fz1_table (main.c)
00001004 00001002 .data Fz2_table (main.c)
00002006 00000090 .data F__files (MSL C 56800E lmm.lib ansi_files.o )
00002096 00000001 rtlib.data rtlib.data (Runtime 56800E lmm.lib console_asm.o )
00002097 00000002 rtlib.data rtlib.data (Runtime 56800E lmm.lib hostio_asm.o )
#>0000209A __xRAM_data_end (linker command file)
#>00002099 __data_size (linker command file)

# .data
0000209A 000000A0 rtlib.bss.lo rtlib.bss.lo (Runtime 56800E lmm.lib console_asm.o )
0000213A 00000100 rtlib.bss.lo rtlib.bss.lo (Runtime 56800E lmm.lib hostio_asm.o )
#>0000223A __bss_addr (linker command file)
0000223A 00000001 .bss Fcomms_err_timer$445 (main.c)
0000223B 00000001 .bss Ftimeout_state$446 (main.c)
0000223C 00000001 .bss Fz_speed (main.c)
0000223D 00000001 .bss Ft_speed (main.c)
0000223E 00000001 .bss Ff_speed (main.c)

0 Kudos
3 Replies

482 Views
bdang
Contributor II

Hi Xiangjun,

Thank you for the answer. So the comment # .data_in_p_flash_ROM  in the MAP file is to mean for those data (arrays and variables) that need to be initialized (with the values to be stored in flash)?

I understand your const example, but I need to have the arrays in RAM because their values can be modified later during code running. 

Thanks,

Brian

0 Kudos

482 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Brian,

I think the line 00000002 00001002 .data Fz1_table (main.c) is to allocate RAM space so that the initializing code can copy data from flash to RAM.

Hope it can help you.

BR

Xiangjun Rong

0 Kudos

482 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Brian,

As you know that the RAM is volatile memory, which means that the contents in RAM disapper after power off/power on. But you hope that the z1_tabl array keeps it's value after power off and power on, so the z1_tabl array have to store in  flash rather than in RAM.

The CodeWarior for DSP56800E ver8.x tools deals with the initialized array in the following ways, first of all, it store the initialized data in data flash or program flash, then copy the data from  data/program flash to RAM.

If you add a key words const before the array for example:

const unsigned long z1_table[]=
{
0,
108,
217,
325,
434,
542,
650,
759,
867,
975,

........

}

The CW will store the data in data or program flash directly, do not copy the initialized data to RAM.

Hope it can help you

BR

Xiangjun Rong