[an error occurred while processing this directive]
Вопр снят. 24xx действ кривоваты и необх копировать все const в saram. Я правильно понял?
(«Телесистемы»: Конференция «Цифровые сигнальные процессоры (DSP) и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено гоша 01 июня 2004 г. 13:30
В ответ на: Хм, при любых опциях линкеру - не работает... const char *str= "hello wold"; остается с таким же значением str== 0x4d38; /*секция .const. ...*/ :( т.е. У Вас с этим не было проблем? CCS221. Виноваты собств криворучки? отправлено гоша 01 июня 2004 г. 13:01

If your system configuration does not support allocating an initialized section such as .const/.econst to data memory, then you have to allocate the .const/.econst section to load in program memory and run in data memory. At boot time, copy the .const/.econst section from program to data memory. The following sequence shows how you can perform this task:
Modify the boot routine:

1) Extract boot.asm from the source library:

ar2000 -x rts.src boot.asm

2) Edit boot.asm and change the CONST_COPY flag to 1:

CONST_COPY .set 1

3) Assemble boot.asm:

asm2000 -v28 boot.asm

4) Archive the boot routine into the object library:

ar2000 -r rts2800.lib boot.obj

For a .const section, link with a linker command file that contains the following entries:

MEMORY
{
PAGE 0 : PROG : ...
PAGE 1 : DATA : ...
}

SECTIONS
{
...
.const : load = PROG PAGE 1, run = DATA PAGE 1
{
/* GET RUN ADDRESS */
__const_run = .;
/* MARK LOAD ADDRESS */
*(.c_mark)
/* ALLOCATE .const */
*(.const)
/* COMPUTE LENGTH */
__const_length = .- __const_run;
}
...
}

Similarly, for an .econst section, link with a linker command file that contains the following entries:

SECTIONS
{
...
.econst : load = PROG PAGE 1, run = DATA PAGE 1
{
/* GET RUN ADDRESS */
_ _econst_run = .;
/* MARK LOAD ADDRESS */
*(.ec_mark)
/* ALLOCATE .econst */
*(.econst)
/* COMPUTE LENGTH */
_ _econst_length = - ._ _econst_run;
}
...
}

In your linker command file, you can substitute the name PROG with the name of a memory area on page 0 and DATA with the name of a memory area on page 1. The rest of the command file must use the names as above. The code in boot.asm that is enabled when you change CONST_COPY to 1 depends on the linker command file using these names in this manner. To change any of the names, you must edit boot.asm and change the names in the same way.

Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru