Skip to main content
Visitor II
April 6, 2017
Question

_stext not defined

  • April 6, 2017
  • 1 reply
  • 1573 views
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

    This topic has been closed for replies.

    1 reply

    Visitor II
    April 7, 2017
    Posted on April 07, 2017 at 10:42

    Hello,

    change __stext with f__stext .

    Regards,

    Luca

    Visitor II
    April 11, 2017
    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

    Visitor II
    April 11, 2017
    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