cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S207 - Linker error ''Section boundary crossing''

StefanHogg
Associate II
Posted on April 24, 2013 at 16:11

Hi together,

I'm writing a application for a STM8S207C8 (64k flash).Currently my code needs 50kB of the flash, what means that the ''magic'' address 0xFFFF is crossed. Therefore I use the compiler option ''+modsl'' (recommended by the compiler manual). This configuration works properly. Now I would like to use the power-on self-test functionality from the ST self-test library. Therefore I created the needed sections in linker file and mapped the call of ''STL_StartUp'' at my reset interrupt vector (as recommended by AN3181, corresponding to the ST self-test library). The bad fact is that with this new configuration I get the following linker error:

#error clnk Debug_Standard\sey-redesign.lkf:92 Debug_Standard\stm8s_stl_startup.o: section boundary crossing (.text:00c9) f__stext

I looked for this error code in the STM8 forum but I couldn't find a answer that would help me. I only found the hint to note the chapter ''Memory Models for code larger than 64K'' in the compiler manual. It recommends to use the compiler option ''+modsl''. This option I've already used. Additionally I found the hint to avoid the compiler options ''-gnc'' and ''+nocross''. These options were not used in my application. Do anyone of you have another idea how to avoid this linker error? Thanks, Stefan. I use following environment: IDE: ST Visual Develop (v4.3.1) Compiler: COSMIC CXSTM8 (v4.3.7) Content of the used linker file:


# LINK COMMAND FILE AUTOMATICALLY GENERATED BY STVD:

# * TOTALLY IF AUTO MODE IS ENABLED

# * ONLY INSIDE MARKERS IN SEMI-AUTO MODE

#

# CHOOSE THE CUSTOM MODE IN STVD IN ORDER TO HAVE FULL CONTROL OVER THIS FILE.

#

# Sections delimited by <
BEGIN
...> and <
END
...> markers are reserved for

# STVD: DO NOT MODIFY INSIDE.

#

# Manual modifications are allowed OUTSIDE these sections, WHEN STVD AUTO MODE

# IS DISABLED.

#

# CAUTION:

# * Changing from Custom to Semi-Auto mode removes modifications in

# STVD-reserved sections

# * Changing to Auto mode removes all modifications.

#

# In Semi-Auto mode, you are allowed to remove <
BEGIN
...> and <
END
...> markers

# in order to gain control over the concerned sections. As a consequence any

# modification from the STVD graphical interface concerning this section will be

# ignored.

#

# Please refer to Cosmic User Manuals before any modification.

# Note that errors in editing this file may have unpredictable results when

# running STVD.


# Segment configuration - section reserved for STVD

#<
BEGIN
SEGMENT_CONF>

# Segment Code,Constants:

+seg .const -b 0x9080 -m 0xd980 -n .const -it -ck

+seg .FLASH_CONST -a .const -n .FLASH_CONST

+seg .FLASH_CODE -a .FLASH_CONST -n .FLASH_CODE

+seg .text -a .FLASH_CODE -n .text -ck

+seg .cksum -a .text -n .cksum -ik

# Segment lcDSL flash data:

+seg .lcDSL_flash -b 0x16a00 -m 0x1600 -n .lcDSL_flash -ck

# Segment Eeprom Encoder Settings:

+seg .eep_enc_sets -b 0x4000 -m 0x100 -n .eep_enc_sets

# Segment Eeprom Factory Settings:

+seg .eep_fact_sets -b 0x4100 -m 0x100 -n .eep_fact_sets

# Segment Eeprom #1:

+seg .eeprom -b 0x4200 -m 0x2fe -n .eeprom

# Segment Eeprom Bootloader:

+seg .eep_boot -b 0x44fe -m 0x2 -n .eep_boot

# Segment Eeprom lcDSL:

+seg .eep_lcDSL -b 0x4500 -m 0x100 -n .eep_lcDSL

# Segment Zero Page:

+seg .bsct -b 0x0 -m 0x100 -n .bsct

+seg .ubsct -a .bsct -n .ubsct

+seg .bit -a .ubsct -n .bit -id

+seg .share -a .bit -n .share -is

# Segment Ram:

+seg .data -b 0x200 -m 0xc01 -n .data

+seg .bss -a .data -n .bss

+seg .FLASH_CODE -a .bss -n .FLASH_CODE -a .bss -n boot_RAM -ic

# Segment Class B:

+seg .RUN_TIME_BUF -b 0x100 -m 0x100 -n .RUN_TIME_BUF -m 0x10

+seg .CLASS_B -a .RUN_TIME_BUF -n .CLASS_B -a .RUN_TIME_BUF -m 0x78

+seg .CLASS_B_REV -a .CLASS_B -n .CLASS_B_REV -a .CLASS_B -m 0x78

# Segment Stack Bottom:

+seg .STACK_BOTTOM -b 0xd00 -m 0x100 -n .STACK_BOTTOM

#<
END
SEGMENT_CONF>



# Startup file - section reserved for STVD

#<
BEGIN
STARTUP_FILE>

crtsi.sm8

#<
END
STARTUP_FILE>



# Object files list - section reserved for STVD

#<
BEGIN
OBJECT_FILES>

Debug_Standard\adc.o

Debug_Standard\commands.o

Debug_Standard\eeprom.o

Debug_Standard\error.o

Debug_Standard\hiperface.o

Debug_Standard\init.o

Debug_Standard\lcdsl.o

Debug_Standard\main.o

Debug_Standard\pcbtest.o

Debug_Standard\position.o

Debug_Standard\stm8s_it.o

Debug_Standard\util.o

Debug_Standard\_block_cksumo

Debug_Standard\_classb_cksumo

Debug_Standard\stm8s_stl_clockstart.o

Debug_Standard\stm8s_stl_cpustart_csmc.o

Debug_Standard\stm8s_stl_crc16run.o

Debug_Standard\stm8s_stl_fullram_csmc.o

Debug_Standard\stm8s_stl_main.o

Debug_Standard\stm8s_stl_startup.o

Debug_Standard\stm8s_adc2.o

Debug_Standard\stm8s_awu.o

Debug_Standard\stm8s_beep.o

Debug_Standard\stm8s_clk.o

Debug_Standard\stm8s_exti.o

Debug_Standard\stm8s_flash.o

Debug_Standard\stm8s_gpio.o

Debug_Standard\stm8s_i2c.o

Debug_Standard\stm8s_itc.o

Debug_Standard\stm8s_iwdg.o

Debug_Standard\stm8s_rst.o

Debug_Standard\stm8s_spi.o

Debug_Standard\stm8s_tim1.o

Debug_Standard\stm8s_tim2.o

Debug_Standard\stm8s_tim3.o

Debug_Standard\stm8s_tim4.o

Debug_Standard\stm8s_uart1.o

Debug_Standard\stm8s_uart3.o

Debug_Standard\stm8s_wwdg.o

#<
END
OBJECT_FILES>



# Library list - section reserved for STVD

#<
BEGIN
LIBRARY_FILES>

libisl.sm8

libm.sm8

#<
END
LIBRARY_FILES>



# Interrupt vectors file - section reserved for STVD

#<
BEGIN
VECTOR_FILE>

+seg .const -b 0x9000 -k

Debug_Standard\stm8s_interrupt_vector.o

#<
END
VECTOR_FILE>


# Defines - section reserved for STVD

#<
BEGIN
DEFINED_VARIABLES>

+def __endzp=@.ubsct # end of uninitialized zpage

+def __memory=@.bss # end of bss segment

+def __startmem=@.STACK_BOTTOM

+def __endmem=0x13ff

+def __stack=0x17ff

#<
END
DEFINED_VARIABLES>

#stm8-linker-section-boundary
0 REPLIES 0