cancel
Showing results for 
Search instead for 
Did you mean: 

Cosmic compiler - section boundary crossing

krzysztof239955_st
Associate II
Posted on November 13, 2009 at 12:00

Cosmic compiler - section boundary crossing

5 REPLIES 5
krzysztof239955_st
Associate II
Posted on May 17, 2011 at 15:05

Hi,

I use Cosmic compiler with STVD.

The error receive after linking:

#error clnk Debug\waga tw.lkf:34 Debug\beep.o: section boundary crossing (.text:018d) c_uitolx

#error clnk Debug\waga tw.lkf:37 Debug\funkc.o: section boundary crossing (.text:0003) c_uitolx.

How can one remove this error?

Best regards.

Kris.

luca239955_st
Associate III
Posted on May 17, 2011 at 15:05

Hello,

looks like you are exceeding the 64k limit (for stm8, this actually means exceeding address 0xFFFF, which means 32k of code, since the flash starts at 0x8000), bot you are still using a memory model / libraries for smaller applications (you now need to use mod/lib that do not end with 0)

Regards,

Luca (Cosmic)

krzysztof239955_st
Associate II
Posted on May 17, 2011 at 15:05

Hi Luca.

I change memory model and libraries for code larger than 64K.

The error receive after linking:

#error clnk Debug\waga tw.lkf:1 prefixed symbol f__stext in conflict (C:\Program Files\COSMIC\CXSTM8\Lib\crtsi.sm8 Debug\stm8_interrupt_vector.o)

#error clnk Debug\waga tw.lkf:1 symbol __stext not defined (Debug\stm8_interrupt_vector.o )

Best regards.

Kris

luca239955_st
Associate III
Posted on May 17, 2011 at 15:05

Hi,

can you please send me, on my personal email (luca.ubiali@cosmic.fr)

- the files interrupt_vector.c /.o /.ls

- the compiler version you are using

- the file crtsi.sm8

I have to make some checks before I give you an answer.

Regards,

Luca

luca239955_st
Associate III
Posted on May 17, 2011 at 15:05

just to close this thread, the problem was due to a wrong way to declare the interrupt vectors: the way used was ok for < 64k, but did not work for bigger applications.

Cosmic recommends to declare the interrupt vectors in the following way, that works for all memory models / application sizes:

/* INTERRUPT VECTORS TABLE FOR STM8

* Copyright (c) 2007 by COSMIC Software

*/

#define NULL 0

extern void _stext(); /* startup routine */

extern void recept(); /* character receive handler */

#pragma section const {vector}

void (* const @vector _vectab[32])() = {

_stext, /* RESET */

NULL, /* TRAP */

NULL, /* TLI */

NULL, /* AWU */

NULL, /* CLK */

NULL, /* EXTI PORTA */

NULL, /* EXTI PORTB */

NULL, /* EXTI PORTC */

NULL, /* EXTI PORTD */

NULL, /* EXTI PORTE */

NULL, /* CAN RX */

NULL, /* CAN TX */

NULL, /* SPI */

NULL, /* TIMER 1 OVF */

NULL, /* TIMER 1 CAP */

NULL, /* TIMER 2 OVF */

NULL, /* TIMER 2 CAP */

NULL, /* TIMER 3 OVF */

NULL, /* TIMER 3 CAP */

NULL, /* USART TX */

recept, /* USART RX */

NULL, /* I2C */

NULL, /* LINUART TX */

NULL, /* LINUART RX */

NULL, /* ADC */

NULL, /* TIMER 4 OVF */

NULL, /* EEPROM ECC */

NULL, /* Reserved */

NULL, /* Reserved */

NULL, /* Reserved */

NULL, /* Reserved */

NULL, /* Reserved */

};

the linker file should contain the lines

+seg .vector -b 0x8000 -m 0x80 -k # vectors start address

vector.o # interrupt vectors

(sorry if it's not too clear, the CODE tag does not seem to work properly on the forum..)