реклама на сайте
подробности

 
 
 
Reply to this topicStart new topic
> как и где можно указать в ИАРе адрес бута, для выполнения инструкции самопрограммирования
addi
сообщение Oct 21 2012, 07:42
Сообщение #1


Знающий
****

Группа: Участник
Сообщений: 679
Регистрация: 9-08-06
Пользователь №: 19 422



Здравствуйте

Пожалуйста подскажите кто знает где и как в xcl файле указать адерс бута, чтобы потом понял меня IAR
Необходимо делать инструкции самопрограммирования из облсасти бута
Первопричина:

http://electronix.ru/forum/index.php?showtopic=107158
Go to the top of the page
 
+Quote Post
_Артём_
сообщение Oct 21 2012, 10:36
Сообщение #2


Гуру
******

Группа: Свой
Сообщений: 2 128
Регистрация: 21-05-06
Пользователь №: 17 322



Цитата(addi @ Oct 21 2012, 10:42) *
Пожалуйста подскажите кто знает где и как в xcl файле указать адерс бута, чтобы потом понял меня IAR
Необходимо делать инструкции самопрограммирования из облсасти бута


Нужно изменить в xcl строки задающие стартовый адрес:
Цитата
/*************************************************************/
/* Segments in program address space (internal Flash memory) */
/*************************************************************/
-D_..X_INTVEC_SIZE=1F4 // 4 bytes * 125 vectors
-D_..X_APPLICATION_SECTION_START=401F4
-D_..X_APPLICATION_SECTION_SIZE=1E0C
-D_..X_APPLICATION_START=(_..X_APPLICATION_SECTION_START+_..X_INTVEC_SIZE)
-D_..X_APPLICATION_END=(_..X_APPLICATION_SECTION_START+_..X_APPLICATION_SECTION_S
IZE-1)


/*
* Reset and interrupt vectors.
*
* The reset vector and interrupt vectors must be placed at address 0
* and forwards. This definition allows for up to 23 interrupt vectors
* and the reset vector.
*/
-Z(CODE)INTVEC=40000-401F4
-H1895 -h(CODE)40000-401F4 /*Fill unused interrupt vector's with RETI*/

Это для xm256.
Go to the top of the page
 
+Quote Post
addi
сообщение Oct 21 2012, 12:36
Сообщение #3


Знающий
****

Группа: Участник
Сообщений: 679
Регистрация: 9-08-06
Пользователь №: 19 422



Цитата(_Артём_ @ Oct 21 2012, 14:36) *
Нужно изменить в xcl строки задающие стартовый адрес:

Это для xm256.

извиняюсь, чегото я запутался

как я понимаю я должен выполнять инструкции по самопрограммирования в области под boot, т.е на момент выполнения самих инструкций
Подскажите пожалуйста если мой адресс бута по датащиту с 2000 по 27FF, что я должен сделать согласно Вашему примеру

Код
-D_..X_APPLICATION_SECTION_START=401F4
-D_..X_APPLICATION_SECTION_SIZE=1E0C
-D_..X_APPLICATION_START=(_..X_APPLICATION_SECTION_START+_..X_INTVEC_SIZE)
-D_..X_APPLICATION_END=(_..X_APPLICATION_SECTION_START+_..X_APPLICATION_SECTION_S
IZE-1)


если у меня по умолчанию есть следующая конфигурация

Код
/* Code (flash) segments */
-D_..X_INTVEC_SIZE=1E8   /* 4 bytes * 122 vectors */
-D_..X_FLASH_NEND=FFFF   /* End of near flash memory */

-D_..X_APPLICATION_SIZE=40000
-D_..X_BOOT_SIZE=2000
-D_..X_APPLICATION_TABLE_SIZE=2000

-D_..X_FLASH_END=(_..X_APPLICATION_SIZE+_..X_BOOT_SIZE-1)
-D_..X_APPLICATION_START=_..X_INTVEC_SIZE
-D_..X_APPLICATION_END=(_..X_FLASH_END-_..X_BOOT_SIZE-_..X_APPLICATION_TABLE_SIZE)
-D_..X_APPLICATION_TABLE_START=(_..X_APPLICATION_END+1)
-D_..X_APPLICATION_TABLE_END=(_..X_FLASH_END-_..X_BOOT_SIZE)
-D_..X_BOOT_START=(_..X_APPLICATION_TABLE_END+1)
-D_..X_BOOT_END=_..X_FLASH_END


Сообщение отредактировал addi - Oct 21 2012, 12:37
Go to the top of the page
 
+Quote Post
_Артём_
сообщение Oct 21 2012, 13:08
Сообщение #4


Гуру
******

Группа: Свой
Сообщений: 2 128
Регистрация: 21-05-06
Пользователь №: 17 322



Цитата(addi @ Oct 21 2012, 15:36) *
Подскажите пожалуйста если мой адресс бута по датащиту с 2000 по 27FF, что я должен сделать согласно Вашему примеру

У вас иксмега какая? 32d4?
2000 - маловато.
Go to the top of the page
 
+Quote Post
addi
сообщение Oct 21 2012, 13:48
Сообщение #5


Знающий
****

Группа: Участник
Сообщений: 679
Регистрация: 9-08-06
Пользователь №: 19 422



Цитата(_Артём_ @ Oct 21 2012, 17:08) *
У вас иксмега какая? 32d4?
2000 - маловато.

угу 32d4, 4000?, по даташиту с 2000 по 27FF
Go to the top of the page
 
+Quote Post
_Артём_
сообщение Oct 21 2012, 14:12
Сообщение #6


Гуру
******

Группа: Свой
Сообщений: 2 128
Регистрация: 21-05-06
Пользователь №: 17 322



Цитата(addi @ Oct 21 2012, 16:48) *
угу 32d4, 4000?, по даташиту с 2000 по 27FF

По даташиту: 4000-47FF.

Если не ошибся, то как-то так:
Код
-D_..X_APPLICATION_SECTION_START=80E8
-D_..X_APPLICATION_SECTION_SIZE=F18
-D_..X_APPLICATION_START=(_..X_APPLICATION_SECTION_START+_..X_INTVEC_SIZE)
-D_..X_APPLICATION_END=(_..X_APPLICATION_SECTION_START+_..X_APPLICATION_SECTION_S
IZE-1)

Z(CODE)INTVEC=8000-80E8 // 4 *122
-H1895 -h(CODE)8000-80E8 /*Fill unused interrupt vector's with RETI*/
Go to the top of the page
 
+Quote Post
addi
сообщение Oct 21 2012, 15:12
Сообщение #7


Знающий
****

Группа: Участник
Сообщений: 679
Регистрация: 9-08-06
Пользователь №: 19 422



Цитата(_Артём_ @ Oct 21 2012, 18:12) *
По даташиту: 4000-47FF.

Если не ошибся, то как-то так:
Код
-D_..X_APPLICATION_SECTION_START=80E8
-D_..X_APPLICATION_SECTION_SIZE=F18
-D_..X_APPLICATION_START=(_..X_APPLICATION_SECTION_START+_..X_INTVEC_SIZE)
-D_..X_APPLICATION_END=(_..X_APPLICATION_SECTION_START+_..X_APPLICATION_SECTION_S
IZE-1)

Z(CODE)INTVEC=8000-80E8 // 4 *122
-H1895 -h(CODE)8000-80E8 /*Fill unused interrupt vector's with RETI*/

спасибо большое за пример!

Но к сожалению теперь я чтото напутал со вставкой Вашего примера

Вот так почемуто тоже не получается
моя редакция файла конфигурации памяти который теперь подгружаю вместо стандартного:
Цитата
//////////////////////////////////////////////////////////////////////////////
//
// Contains resource definitions of Atmel ATxmega32D4
//
// File version: $Revision$
//
// The '_..X_' prefix is used by C-SPY as an indication that the label should
// not be displayed in the dissassembly window.
//

//////////////////////////////////////////////////////////////////////////////
// Code (flash) segments
-D_..X_INTVEC_SIZE=16C // 4 bytes * 91 vectors

-D_..X_APPLICATION_SIZE=8000
-D_..X_BOOT_SIZE=1000
-D_..X_APPLICATION_TABLE_SIZE=1000


-D_..X_FLASH_END=(_..X_APPLICATION_SIZE+_..X_BOOT_SIZE-1)
////////////////////////////////////////////////////
////////////////////////////////////////////////////
-D_..X_APPLICATION_SECTION_START=80E8
-D_..X_APPLICATION_SECTION_SIZE=F18
-D_..X_APPLICATION_START=(_..X_APPLICATION_SECTION_START+_..X_INTVEC_SIZE)
-D_..X_APPLICATION_END=(_..X_APPLICATION_SECTION_START+_..X_APPLICATION_SECTION_S
IZE-1)

Z(CODE)INTVEC=8000-80E8 // 4 *122
-H1895 -h(CODE)8000-80E8 /*Fill unused interrupt vector's with RETI*/
/////////////////////////////////////////////////
/////////////////////////////////////////////////
-D_..X_APPLICATION_TABLE_START=(_..X_APPLICATION_END+1)
-D_..X_APPLICATION_TABLE_END=(_..X_FLASH_END-_..X_BOOT_SIZE)
-D_..X_BOOT_START=(_..X_APPLICATION_TABLE_END+1)
-D_..X_BOOT_END=_..X_FLASH_END

-D_..X_FLASH_NEND=_..X_FLASH_END // End of flash memory

//////////////////////////////////////////////////////////////////////////////
// Data (SRAM, external ROM or external NV RAM) memory
-D_..X_SRAM_BASE=2000 // Start of ram memory
-D_..X_SRAM_TBASE=0 // Start of tiny ram memory
-D_..X_SRAM_TSIZE=0 // Size of the tiny ram memory
-D_..X_SRAM_END=2FFF // End of ram memory

//////////////////////////////////////////////////////////////////////////////
// Internal EEPROM
-D_..X_EEPROM_START=0
-D_..X_EEPROM_END=3FF // End of eeprom memory
Go to the top of the page
 
+Quote Post
_Артём_
сообщение Oct 21 2012, 15:22
Сообщение #8


Гуру
******

Группа: Свой
Сообщений: 2 128
Регистрация: 21-05-06
Пользователь №: 17 322



Цитата(addi @ Oct 21 2012, 18:12) *
Вот так почемуто тоже не получается

На первый взгляд - правильно...разве что векторов меньше чем я написал, но это не так важно.
Проект не собирается?
Какие ошибки выдаются?
Go to the top of the page
 
+Quote Post
addi
сообщение Oct 21 2012, 16:11
Сообщение #9


Знающий
****

Группа: Участник
Сообщений: 679
Регистрация: 9-08-06
Пользователь №: 19 422



Цитата(_Артём_ @ Oct 21 2012, 19:22) *
На первый взгляд - правильно...разве что векторов меньше чем я написал, но это не так важно.
Проект не собирается?
Какие ошибки выдаются?

извиняюсь он у меня так и не собрался, сначала ругался на переопределение -H185, я его убрал, далее ругался на то что не может открыть Z(code) INTVEC....,- я поставил перед Z - и далее застрял на следующем комментарии компоновщика - "Fatal Error[e72]:Segment NEAR_Z must be defined in a segment definition option(-Z,-b or -P)"

sm.gif

В итоге xcl получается таким:

CODE
//////////////////////////////////////////////////////////////////////////////
//
// Contains resource definitions of Atmel ATxmega32D4
//
// File version: $Revision$
//
// The '_..X_' prefix is used by C-SPY as an indication that the label should
// not be displayed in the dissassembly window.
//

//////////////////////////////////////////////////////////////////////////////
// Code (flash) segments
-D_..X_INTVEC_SIZE=16C // 4 bytes * 91 vectors

-D_..X_APPLICATION_SIZE=8000
-D_..X_BOOT_SIZE=1000
-D_..X_APPLICATION_TABLE_SIZE=1000


-D_..X_FLASH_END=(_..X_APPLICATION_SIZE+_..X_BOOT_SIZE-1)
////////////////////////////////////////////////////
////////////////////////////////////////////////////
-D_..X_APPLICATION_SECTION_START=80E8
-D_..X_APPLICATION_SECTION_SIZE=F18
-D_..X_APPLICATION_START=(_..X_APPLICATION_SECTION_START+_..X_INTVEC_SIZE)
-D_..X_APPLICATION_END=(_..X_APPLICATION_SECTION_START+_..X_APPLICATION_SECTION_S
IZE-1)

-Z(CODE)INTVEC=8000-80E8 // 4 *122
-h(CODE)8000-80E8 /*Fill unused interrupt vector's with RETI*/
/////////////////////////////////////////////////
/////////////////////////////////////////////////
-D_..X_APPLICATION_TABLE_START=(_..X_APPLICATION_END+1)
-D_..X_APPLICATION_TABLE_END=(_..X_FLASH_END-_..X_BOOT_SIZE)
-D_..X_BOOT_START=(_..X_APPLICATION_TABLE_END+1)
-D_..X_BOOT_END=_..X_FLASH_END

-D_..X_FLASH_NEND=_..X_FLASH_END // End of flash memory

//////////////////////////////////////////////////////////////////////////////
// Data (SRAM, external ROM or external NV RAM) memory
-D_..X_SRAM_BASE=2000 // Start of ram memory
-D_..X_SRAM_TBASE=0 // Start of tiny ram memory
-D_..X_SRAM_TSIZE=0 // Size of the tiny ram memory
-D_..X_SRAM_END=2FFF // End of ram memory

//////////////////////////////////////////////////////////////////////////////
// Internal EEPROM
-D_..X_EEPROM_START=0
-D_..X_EEPROM_END=3FF // End of eeprom memory


Сообщение отредактировал IgorKossak - Oct 21 2012, 16:15
Причина редактирования: [codebox] для длинного кода!!!
Go to the top of the page
 
+Quote Post
_Артём_
сообщение Oct 21 2012, 16:19
Сообщение #10


Гуру
******

Группа: Свой
Сообщений: 2 128
Регистрация: 21-05-06
Пользователь №: 17 322




Попробуйте такой вариант (переделал по-быстрому из xm256):
CODE

/* - lnk6s.xcl -
*
* XLINK command file for the ICCAVR C-compiler using the -v6, -ms options.
* Segments are defined for a generic ATmega with a maximum of 16 Mbytes
* data address space and 8 Mbytes program address space.
*
* Usage: xlink your_file(s) -f lnk6s
*
* File version: $Revision: 1.11 $
*/

/*
* Modify the lines below to alter the size of the RSTACK, CSTACK and HEAP
* segments. These need to be fine-tuned to suit your specific application.
*/
-D_..X_CSTACK_SIZE=100 /* 4096 bytes for auto variables and saved registers. */
-D_..X_RSTACK_SIZE=100 /* 512 bytes for return addresses, equivalent to */
/* 128 levels of calls, including interrupts. */
//-D_..X_HEAP_SIZE=1000 /* 4096 bytes of heap. */
//-D_..X_NEAR_HEAP_SIZE=1000 /* 4096 bytes of heap. */
//-D_..X_FAR_HEAP_SIZE=8000 /* 32768 bytes of heap. */
//- D_..X_HUGE_HEAP_SIZE=8000 /* 32768 bytes of heap. */

/*
* The following segments are used by the compiler:
*
* Program address space read-only segments (internal Flash)
* =========================================================
* segment address range max size (dec)
* ------- ------------- --------------
* INTVEC 0 - 1F 32 bytes
* TINY_F 0 - FF 256 bytes
* SWITCH 0 - FFFF 64 Kbytes
* DIFUNCT 0 - FFFF 64 Kbytes
* NEAR_F 0 - FFFF 64 Kbytes
* CODE 0 - 1FFFF 128 kbytes
* FARCODE 0 - 7FFFFF 8 Mbytes
* FAR_F 0 - 7FFFFF 8 Mbytes
* INITTAB 0 - 7FFFFF 8 Mbytes
* HUGE_F 0 - 7FFFFF 8 Mbytes
* TINY_ID 0 - 7FFFFF 8 Mbytes
* NEAR_ID 0 - 7FFFFF 8 Mbytes
* FAR_ID 0 - 7FFFFF 8 Mbytes
* HUGE_ID 0 - 7FFFFF 8 Mbytes
*
* Data address space read/write segments
* ==============================================================
* segment address range max size (dec)
* ------- ------------- --------------
* TINY_Z 60 - FF 160 bytes
* TINY_N 60 - FF 160 bytes
* TINY_I 60 - FF 160 bytes
* CSTACK 60 - FFFF 64 kbytes
* HEAP 60 - FFFF 64 kbytes
* NEAR_HEAP 60 - FFFF 64 kbytes
* FAR_HEAP 60 - FFFFFF 16 Mbytes
* HUGE_HEAP 60 - FFFFFF 16 Mbytes
* RSTACK 60 - FFFF 64 kbytes
* NEAR_Z 60 - FFFF 64 kbytes
* NEAR_I 60 - FFFF 64 kbytes
* NEAR_N 60 - FFFF 64 kbytes
* NEAR_C 60 - FFFF 64 kbytes
* FAR_Z 60 - FFFFFF 16 Mbytes
* FAR_I 60 - FFFFFF 16 Mbytes
* FAR_N 60 - FFFFFF 16 Mbytes
* FAR_C 60 - FFFFFF 16 Mbytes
* HUGE_Z 60 - FFFFFF 16 Mbytes
* HUGE_I 60 - FFFFFF 16 Mbytes
* HUGE_N 60 - FFFFFF 16 Mbytes
* HUGE_C 60 - FFFFFF 16 Mbytes
*
* String literals and constant objects are placed in the NEAR_C segment,
* unless the -y command line option is given. If it was given, string
* literals and constant objects will be placed in the NEAR_ID segment which
* is initialized by cstartup.
*
* The address ranges given in the table above specify the "hard" limits
* where a given segment may be placed, e.g. it is not possible to place the
* TINY_F segment anywhere outside of the given range 0-FF.
*/

/* Define CPU */
-ca90

/*************************************************************/
/* Segments in program address space (internal Flash memory) */
/*************************************************************/
-D_..X_INTVEC_SIZE=1F4 // 4 bytes * 125 vectors
-D_..X_APPLICATION_SECTION_START=81F4
-D_..X_APPLICATION_SECTION_SIZE=E0C
-D_..X_APPLICATION_START=(_..X_APPLICATION_SECTION_START+_..X_INTVEC_SIZE)
-D_..X_APPLICATION_END=(_..X_APPLICATION_SECTION_START+_..X_APPLICATION_SECTION_S
IZE-1)


/*
* Reset and interrupt vectors.
*
* The reset vector and interrupt vectors must be placed at address 0
* and forwards. This definition allows for up to 23 interrupt vectors
* and the reset vector.
*/
-Z(CODE)INTVEC=8000-81F4
-H1895 -h(CODE)8000-81F4 /*Fill unused interrupt vector's with RETI*/
//-Z(CODE)INTVEC=8000-81F4




/*
* __tinyflash declared objects.
*
* Constant objects that have been declared with the __tinyflash keyword
* will be placed in this segment. The code generated is almost the same
* as for objects declared with __flash, the exception is that a __tinyflash
* pointer is one byte instead of two.
*/
//-Z(CODE)TINY_F=0-FF

/*
* Compiler generated segments
*
* There are currently three compiler generated segments. These are used
* for storing information that is vital for the operation of the program.
*
* The first segment is the SWITCH segment which contains data statements
* used in the switch library routines. These tables are encoded in such a
* way as to use as little space as possible.
*
* The second segment, INITTAB, contains the segment initialization
* description blocks that are used by the __segment_init function which is
* called by cstartup. This table consists of a number of SegmentInitBlock_Type
* objects. This type is declared in the segment_init.h file located in the
* AVR\SRC\LIB directory.
*
* Tha last segment is only used when a source file has been compiled
* in EC++ mode and the file contained global objects (class instances).
* The segment will then contain a number of function pointers that
* point to constructor methods that should be executed for each object.
*/
-Z(CODE)SWITCH,DIFUNCT=_..X_APPLICATION_START-_..X_APPLICATION_END

/*
* __flash declared objects.
*
* Constant objects that have been declared with the __flash keyword will
* be placed in this segment.
*/
//-Z(CODE)NEAR_F=0-FFFF

/*
* Program code, __nearfunc declared functions
*
* Code that comes from __nearfunc declared functions is placed in the CODE
* segment. This segment must be placed in the first 128 Kbytes of flash
* memory. The reason for this is that function pointers to __nearfunc
* functions are 2 bytes large. All function pointers are word pointers.
*/
-Z(CODE)CODE=_..X_APPLICATION_SECTION_START-_..X_APPLICATION_END

/*
* Initialization data for the FAR_I segments
*
* If any non-zero initialized variables exist in the application the
* corresponding _ID segment will contain the initial values of those
* variables. The cstartup module will initialize the _I segments at
* system start up by calling the __segment_init function.
*
* FAR_ID must have the same offset
* from a 64 Kbyte boundary as FAR_I
*
*/
-Z(FARCODE)FAR_ID=_..X_APPLICATION_SECTION_START-_..X_APPLICATION_END


/*
* Program code, __farfunc declared functions
*
* Code that comes from __farfunc declared functions is placed in the FARCODE
* segment. This segment can be placed anywhere in the flash memory. Function
* pointers to __farfunc functions are 3 bytes large. All function pointers
* are word pointers.
*/
-Z(CODE)FARCODE=_..X_APPLICATION_SECTION_START-_..X_APPLICATION_END

/*
* __farflash declared objects.
*
* Constant objects that have been declared with the __farflash keyword will
* be placed in this segment. The objects are limited to 32 Kbytes in size
* and by using the FARCODE segment type XLINK guarantees that no object in
* the segment spans over a 64K boundary.
*/
-Z(FARCODE)FAR_F=_..X_APPLICATION_SECTION_START-_..X_APPLICATION_END

/*
* __hugeflash declared objects.
*
* Constant objects that have been declared with the __hugeflash keyword will
* be placed in this segment.
*/
-Z(CODE)HUGE_F,INITTAB=_..X_APPLICATION_SECTION_START-_..X_APPLICATION_END

/*
* Initialization data for the TINY_I, NEAR_I and HUGE_I segments
*
* If any non-zero initialized variables exist in the application the
* corresponding _ID segment will contain the initial values of those
* variables. The cstartup module will initialize the _I segments at
* system start up by calling the __segment_init function.
*/
-Z(CODE)TINY_ID,NEAR_ID,HUGE_ID=_..X_APPLICATION_SECTION_START-_..X_APPLICATION_END
-Z(CODE)CHECKSUM#_..X_APPLICATION_END

/***************************************************************************/
/* Segments in data address space (internal or external SRAM/EPROM/EEPROM) */
/***************************************************************************/


//////////////////////////////////////////////////////////////////////////////
// Data (SRAM, external ROM or external NV RAM) memory
-D_..X_SRAM_BASE=2000 // Start of ram memory
-D_..X_SRAM_TBASE=0 // Start of tiny ram memory
-D_..X_SRAM_TSIZE=0 // Size of the tiny ram memory
-D_..X_SRAM_END=3FFF // End of ram memory
-D_..X_CSTACK_BASE=_..X_SRAM_BASE
-D_..X_CSTACK_END=_..X_SRAM_END
-D_..X_RSTACK_BASE=_..X_SRAM_BASE
-D_..X_RSTACK_END=_..X_SRAM_END


//////////////////////////////////////////////////////////////////////////////
// Internal EEPROM
-D_..X_EEPROM_END=7FF // End of eeprom memory
-D_..X_EEPROM_START=0



/*
* __tiny declared objects
*
* These three segments contain objects that haven been declared with the
* __tiny keyword. After cstartup has run, the _I segment has been initialized
* with the values in the _ID segment and the _Z segment has been cleared so
* that it contains all zeros.
*/
-Z(DATA)TINY_I,TINY_Z,TINY_N=_..X_SRAM_TBASE:+_..X_SRAM_TSIZE

/*
* Data stack
*
* The data stack is used for auto variables, function parameters, and
* temporary storage. It is therefore important that the size of the data
* stack is large enough. However, a too large stack will waste valuable
* RAM space. To determine approximately how much data stack that is needed
* for an application, perform a trial link with the list file option 'o'
* present, e.g. -xmos. This will tell XLINK to generate a stack usage tree
* in the map file. The values in the map file could then be used as an
* approximation. Please note that the given value does not include stack
* used by interrupts and assembler functions written by the end user. It is
* therefore neccesary to add a small safety margin to the value given by
* XLINK.
*/
-Z(DATA)CSTACK+_..X_CSTACK_SIZE=_..X_CSTACK_BASE-_..X_CSTACK_END

/*
* The malloc HEAP segment
*
* If the application uses malloc or calloc the memory is allocated from this
* segment. It is therefore important that the segment is placed so that a
* default pointer can point to it. Since this linker file assumes that the
* small memory model is used the heap must be placed in the range 0 ... FFFF.
*
* The library technology that is used is such that if no calls are made to
* malloc, calloc, or realloc, this segment will not be included. It is
* therefore safe to include it in all your linker files.
*/
//-Z(DATA)HEAP+_..X_HEAP_SIZE=_..X_SRAM_BASE-_..X_SRAM_END
//-Z(DATA)NEAR_HEAP+_..X_NEAR_HEAP_SIZE=_..X_SRAM_BASE-_..X_SRAM_END
//-Z(DATA)FAR_HEAP+_..X_FAR_HEAP_SIZE=_..X_SRAM_BASE-_..X_SRAM_END
//-Z(DATA)HUGE_HEAP+_..X_HUGE_HEAP_SIZE=_..X_SRAM_BASE-_..X_SRAM_END

/*
* Return address stack
*
* The return address stack is used to store the return address when a CALL,
* RCALL, ICALL, or EICALL instruction is executed. Each call will use three
* bytes of return address stack. An interrupt will also place a return
* address on this stack. Use the same technique as for the data stack to
* determine the size of the return address stack. Note however that if the
* cross-call optimization has been used (-z9 and not --no_cross_call) the
* value given by XLINK can be off by as much as a factor of five depending on
* how many times the cross-call optimizer has been run (--cross_call_passes).
*/
-Z(DATA)RSTACK+_..X_RSTACK_SIZE=_..X_RSTACK_BASE-_..X_RSTACK_END

/*
* __near declared objects
*
* These three segments contain objects that haven been declared with the
* __near keyword. After cstartup has run the, _I segment has been initialized
* with the values in the _ID segment and the _Z segment has been cleared so
* that it contains all zeros.
*/
-Z(DATA)NEAR_I,NEAR_Z,NEAR_N=_..X_SRAM_BASE-_..X_SRAM_END
-Z(DATA)IOSTREAM_N#_..X_SRAM_BASE-_..X_SRAM_END

//////////////////////////////////////////////////////////////////////////////
// Internal EEPROM

-Z(XDATA)EEPROM_I,EEPROM_N=_..X_EEPROM_START-_..X_EEPROM_END

/*
* __near declared constant objects
*
* This segment contains data that should be placed in an EXTERNAL ROM.
* The data stored in this segment include constant __near declared objects
* as well as string literals and aggregate initializers. The need for a _C
* segment can be eliminated by using the -y and --initializers_in_flash
* command line options. The use of these options will increase the size of
* the _I and _F segments.
*/
//-Z(CONST)NEAR_C=60-FFFF

/*
* __far declared objects
*
* These three segments contain objects that haven been declared with the
* __far keyword. After cstartup has run the _I segment has been initialized
* with the values in the _ID segment and the _Z segment has been cleared so
* that it contains all zeros.
*
* FAR_I must have the same offset
* from a 64 Kbyte boundary as FAR_ID
*
*/
-Z(FARDATA)FAR_I,FAR_Z,FAR_N=_..X_SRAM_BASE-_..X_SRAM_END

/*
* __far declared constant objects
*
* This segment contains data that should be placed in an EXTERNAL ROM.
* The data stored in this segment include constant __far declared objects.
* The need for a _C segment can be eliminated by using the -y and
* --initializers_in_flash command line options. The use of these options
* will increase the size of the _I and _F segments.
*/
//-Z(FARCONST)FAR_C=60-FFFFFF

/*
* __huge declared objects
*
* These three segments contain objects that haven been declared with the
* __huge keyword. After cstartup has run the _I segment has been initialized
* with the values in the _ID segment and the _Z segment has been cleared so
* that it contains all zeros.
*/
-Z(DATA)HUGE_I,HUGE_Z,HUGE_N=_..X_SRAM_BASE-_..X_SRAM_END

/*
* __huge declared constant objects
*
* This segment contains data that should be placed in an EXTERNAL rom.
* The data stored in this segment include constant __huge declared objects.
* The need for a _C segment can be eliminated by using the -y and
* --initializers_in_flash command line options. The use of these options
* will increase the size of the _I and _F segments.
*/
//-Z(CONST)HUGE_C=60-FFFFFF

/*
* Select reduced "printf" support to reduce library size.
* See configuration section in manual concerning printf/sprintf.
*/

/*Dlib*/
//-e_PrintfSmall=_Printf

/*Clib*/
//-e_small_write=_formatted_write
//-e_small_write_P=_formatted_write_P

/*
* Disable floating-point support in "scanf" to reduce library size.
* See configuration section in manual concerning scanf/sscanf */

/*Dlib*/
//-e_ScanfSmall=_Scanf

/*Clib*/
//-e_medium_read=_formatted_read
//-e_medium_read_P=_formatted_read_P

/* Suppress one warning which is not relevant for this processor */
-w29

/* Code will now reside in file aout.a90 or aout.d90, unless -o is specified */
/* .d90 is the default if debug system is linked (option -r) */
/* .a90 is the default without debugging. Default format is -Fmotorola */


Update: не то скопипастил sm.gif
Go to the top of the page
 
+Quote Post
_Артём_
сообщение Oct 21 2012, 18:47
Сообщение #11


Гуру
******

Группа: Свой
Сообщений: 2 128
Регистрация: 21-05-06
Пользователь №: 17 322



Цитата(addi @ Oct 21 2012, 21:02) *
далее на переопределение CSTACK и RSTACK, - это все закомментил не смог закоментить следующее поскльку его нет и видимо изза этого ругается:

Видимо из-за того, что в настройках проекта Options - General options - вкладка Target - System configuration - выбрана галка Configure system using dialog (not in XCL file). Соответственно стеки и прочее настраиваются и через файл и через диалог.

P.S. Вызывают сомнения такие строки в xcl файле (я про них забыл)
Цитата
-D_..X_SRAM_END=3FFF // End of ram memory

у xm32d наверное 4к ОЗУ, а не 8.

Цитата
-D_..X_INTVEC_SIZE=1F4 // 4 bytes * 125 vectors
-D_..X_APPLICATION_SECTION_START=81F4
-D_..X_APPLICATION_SECTION_SIZE=E0C

И векторов поменьше, наверное.

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 4th August 2025 - 06:55
Рейтинг@Mail.ru


Страница сгенерированна за 0.0148 секунд с 7
ELECTRONIX ©2004-2016