cancel
Showing results for 
Search instead for 
Did you mean: 

_stext not defined

irfan karazor
Associate III
Posted on April 06, 2017 at 16:20

Hi.

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

The error receive after linking:

#error clnk Debug\canli.lkf:1 symbol __stext not defined (Debug\stm8l_stl_startup.o )

The command: 'clnk -l'C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\Lib' -o Debug\canli.sm8 -mDebug\canli.map Debug\canli.lkf ' has failed, the returned value is: 1

The code is #define GotoCompilerStartUp() _asm('xdef __stext\n jp __stext\n'); /* _stext() */

When i change 

memory model and libraries for code larger than 64K,  Should i update assambly code in different way?

Best regards.

irfan

6 REPLIES 6
luca239955_stm1_st
Senior II
Posted on April 07, 2017 at 10:42

Hello,

change __stext with f__stext .

Regards,

Luca

Posted on April 11, 2017 at 08:18

 ,

 ,

You mean is, ,

♯ define GotoCompilerStartUp() _asm('xdef f__stext\n jp f__stext\n'), ,

if yes,  ,the error is keeep going.

♯ error clnk Debug\canli.lkf:1 symbol f__stext not defined (Debug\stm8l_stl_startup.o )

i am new for cosmic so Can you describe detailly?

Regards,

irfan

Posted on April 11, 2017 at 09:21

Hello,

the symbol __stext (or f__stext when you use long memory models in order to use memory above address 0xFFFF) is defined in the startup (crts.s the source is available in the subdirectory /hstm8 of the compiler) file and is the entry point after a reset. Simple applications know nothing about this symbol, but complex application sometimes need to execute a sw reset and therefore jump to it.

If you replace __stext with f__stext in all your application (and also 'jp __stext' with 'jpf f__stext', I forgot in my previous message) all should work ok. Maybe you did not recompile that file? Or you have more than one occurrence of the __stext symbol?

Regards,

Luca

Posted on April 11, 2017 at 10:39

Thank you.

i add 

crts.s file manually and all compile ok.

But Should i had to add 

crts.s to my project?.

Why Setting like below is not add crts.s to in my project automatically? 

0690X00000606iwQAA.png
Posted on April 11, 2017 at 12:24

When i run the software, software has problem such as RAM, stack and etc.

Should i add 

crts.s file to in my project manually or not?

Posted on April 11, 2017 at 17:40

Hello,

use crtsi instead of crts, it also does variables initialization in the data section and that might be the problem you see.

You surely need to have one 'crts' (C Run Time Startup) file in your application (usually crtsi) to perform all the initializations needed by the C langiage environment: you can add it manually to your projet or use the precompiled version and just link it, depending on your preferences and on the way used by default by your IDE.

Regards,

Luca