Skip to main content
cfleck
Associate
May 18, 2015 10:24 PM UTC
Question

STM8 With Cosmic Code Size

Posted on May 19, 2015 at 00:24

Hey guys,

I've been told that when using COSMIC to program my STM8S003F3 I should have a code size of 8 kilobytes. Currently my code size is at 3846 and I am getting a text size overflow. Is the 8 kilobytes not the true code size or is there something that I am missing?

Thank you very much!

Charles

#codesize #cosmic
    This topic has been closed for replies.

    6 replies

    luca239955_stm1_st
    Associate
    May 19, 2015 7:24 AM UTC
    Posted on May 19, 2015 at 09:24

    There are 2 possibilities:

    - the maximum ''application size'' of the 32k free version is calculated on the code+constants+ram

    - you might have a similar error (size overflow) if you somehow specify a maximum size (for example, 8k) for a given segment in the linker file and the segment gets bigger than that: in this case just change your linker file.

    Regards.

    Ian Legg
    Visitor II
    May 19, 2015 7:26 AM UTC
    Posted on May 19, 2015 at 09:26

    Hi Charles,

    I think(?) this question has been asked before and it seems that Cosmic includes the RAM footprint in its calculation too!

    Thanks,

    Ian

    cfleck
    cfleckAuthor
    Associate
    May 19, 2015 3:37 PM UTC
    Posted on May 19, 2015 at 17:37

    Hey,

    I'm pretty new to using ST Visual Develop. I'm looking at my linker information and it seems that the Input tab is specifying where to put my code. I've attached my a picture of my current screen, what exactly should I change to safely be able to increase my code size?

    Thanks again!

    Charles

    ________________

    Attachments :

    linker.JPG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htgo&d=%2Fa%2F0X0000000aVm%2F8iuQm8zeVIGUHR7eCznxV4kRKV7CXIqU.UfHBeJ3Ybs&asPdf=false
    luca239955_stm1_st
    Associate
    May 20, 2015 3:35 PM UTC
    Posted on May 20, 2015 at 17:35

    the stvd settings that you show generate a linker file that will limit the code size at 8k.

    If you get a .text size overflow with this linker file it means that your code (+constants) is bigger than 8k and not 3k something as you say in the first post (by the way, where did you get that info?)

    Regards.

    cfleck
    cfleckAuthor
    Associate
    May 20, 2015 9:45 PM UTC
    Posted on May 20, 2015 at 23:45

    Hey Luca,

    I actually ended up switching environments and got it to work, so this problem is now solved, thank you for your help!

    When I tried to compile the error I got was that my code did not fit. It's very possible that I misread it and that it was saying I was going 3000 over the 8 kilobyte limit? The code is definitely less than 8 kilobytes when I compile it in the other environment though. I assume they must compile drastically differently if my code was actually turning out to be 11 kilobytes using ST Visual Develop when it is well under 8 kilobytes in the other environment.

    Either way, thank you very much for your help!

    Charles

    Rohit Y
    Visitor II
    Feb 9, 2017 2:29 PM UTC
    Posted on February 09, 2017 at 14:29

    Hey Charles,

    Which environment you switched to? I am facing the same problem and stuck big time.

    Please help.