DSP56F801 : how to locate a long array in flash?

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

DSP56F801 : how to locate a long array in flash?

4,686 Views
jjl3
Contributor I
I am programming for DSP56F801 and want to define a long array, as following:
uchar program_content1[]={0x8B,0x89,0x9E,0xFE,0x05,0xF6,0xAF,0x01,0x9E,0xFF,0x05,0x88,0x8A,0x81,0xA7,0xFC,0xC6,0xC0,0x85,0x4C,0x95,0xE7,0x01,0xC6,0xC0,0x84,0x4C,0xF7,0x32,0xC0,0x86,0x20,
                          0x1F,0x89,0x8B,0xF6,0x87,0xE6,0x02,0x4C,0x9E,0xE7,0x06,0xE6,0x03,0xEE,0x01,0x8A,0x4C,0x20,0x03,0x7F,0xAF,0x01,0x4B,0xFB,0x9E,0x6B,0x05,0xF7,0x8A,0x88,0xAF,0x04,
                          0x9E,0x6B,0x02,0xDD,0x9E,0x6B,0x01,0xD9,0x32,0xC0,0x88,0x89,0x8B,0xAD,0xB1,0x97,0x4C,0x9E,0xE7,0x03,0xAD,0xAA,0x4C,0x9E,0xE7,0x04,0x4A,0x26,0x03,0x51,0x00,0x18,
                          0xAD,0x9E,0x87,0x8A,0xAD,0x9A,0x97,0x20,0x05,0xAD,0x95,0xF7,0xAF,0x01,0x9E,0x6B,0x04,0xF7,0x9E,0x6B,0x03,0xF3,0x20,0xD5,0xA7,0x06,0x81,0x45,0x01,0x50,0x94,0xAD,
                          0x8D,0xCC,0xC0,0x92,0x00,0x00,0xC0,0x8A,0xC1,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0xB6,0x13,0xA4,0xFD,0xAA,0x01,0xB7,0x13,0x3F,0x02,0x3F,0x06,
                          0xB6,0x0A,0xA4,0x80,0xB7,0x0A,0xB6,0x0E,0xA4,0xE4,0xB7,0x0E,0xB6,0x12,0xA4,0xC0,0xB7,0x12,0xB6,0x46,0xA4,0xF8,0xB7,0x46,0xCD,0xC0,0xE3,0xA6,0x48,0xCD,0xC0,0xFB,
                          0xA6,0x65,0xCD,0xC0,0xFB,0xA6,0x6C,0xCD,0xC0,0xFB,0xA6,0x6C,0xCD,0xC0,0xFB,0xA6,0x6F,0xCD,0xC0,0xFB,0xA6,0x21,0xCD,0xC0,0xFB,0xA6,0x0A,0xCD,0xC0,0xFB,0xC7,0x18,
                          0x00,0x20,0xFB,0x3F,0x1A,0x3F,0x1E,0x3F,0x1B,0x3F,0x18,0x6E,0x1A,0x19,0xB6,0x1E,0xAA,0x0F,0xB7,0x1E,0xB6,0x1B,0xAA,0x2C,0xB7,0x1B,0x81,0x0F,0x1C,0x02,0xB7,0x1F,
                          0x16,0x1B,0x81,0x00,0x00};
when I compile, but display as below:
Link Error: Segment overflow .x_internal_RAM
                  Reserved size is 0x000003c0 --overflow 0x0000009f
 
but  I need this array, so i want to locate this arrray into program flash.
how can i do?
 
thanks & best regards
Ji

Message Edited by CrasyCat on 2007-04-13 02:18 PM

Labels (1)
Tags (1)
0 Kudos
Reply
7 Replies

845 Views
jjl3
Contributor I
just simply define this array as below:
const   uchar   program_content1[ ] =
{
     (lots of stuff here)
};
 
the issue (RAM overflow) can't be solved.
0 Kudos
Reply

845 Views
Dhiman
Contributor I

you use

 

#pragma optimization_level 4
__pmem int [arrey you need to write]

with this mathod arrey or whatsoever you defined take programm memory

if you write

 int [arrey you need to write]

this take ram for storage

0 Kudos
Reply

845 Views
jjl3
Contributor I
Thanks all of you!
 
whether it is because I am using a evaluated license?
I will try as what mel said.

Message Edited by jjl3 on 2006-09-11 11:27 PM

0 Kudos
Reply

845 Views
Gene
Contributor I
Is there anyway to allocate entire flash block to the array.

I need to save my settings to Flash os that I could restore them after a full power down (battery change). uC I'm using does not have EEPROM so FLASH is my only option. The problem with FLASH is that it has to be erased in blocks (Pages) and I would like to tell CodeWarrior not to use one of the pages for program code. I understand that I can declare an array constant to put it in flash, but is there a way to specify start address of the arroay so that it would be in the beggining of the new page?

I hope my questions has made any sense.

Thank you,

Gene
0 Kudos
Reply

845 Views
mel
Contributor I
There a couple of options here --
To put it in flash data space just make it a const.
To put in code space do the following:

- Edit the .c file make an  array like:   __pmem const byte copybaud_block[]  = {0x07,0x0e,3,'B',0x82,0x17,0x22};
- Edit the .cmd file (linker file) and insert the line * (.const.data.pmem) in the application code,

I got this information from tech support and had trouble getting on my own

Or you might have enough ram data space and you just don;t have it configured big enough. 

In the memory section of your *.cmd file you should look at line

.x_Data  (RW) : ORIGIN = 0x00000001, LENGTH = 0x00001FFF  - here you need to check actually ram in your processor

and make sure you have it all set up.  Hope this helps.

 

0 Kudos
Reply

845 Views
admin
Specialist II
I agree, make it a const:
 
const   uchar   program_content1[ ] =
{
     (lots of stuff here)
};
 
 
-Tomahawk
0 Kudos
Reply

845 Views
Lundin
Senior Contributor IV
You might want to make a const array for that.

Also, check out the .prm file and #pragma CONST_SEG.
0 Kudos
Reply