cancel
Showing results for 
Search instead for 
Did you mean: 

STM8 Linker: text size overflow ... just in Release ... not in Debug

cr
Associate
Posted on April 08, 2016 at 17:04

Hello everyone!

Currently I'm switching from an Atmel ATTiny to a STM8 microcontroller and so I'm evaluating different IDEs and compilers. I started with a combination of the ST Visual Development and the COSMIC STM8 Compiler (Cosmic CXSTM8 Special Edition 4.4.4). So far, it worked quite nice. I migrated the ATTiny code step by step to the STM environment. I always used both, the Debug builds and Release builds on my target. But at one point, there seems to be a limit to the Release build:

Running Linker

clnk -l''C:\Program Files (x86)\COSMIC\FSE_Compilers\CXSTM8\Lib''  -o Release\stm8s003.sm8 Release\stm8s003.lkf 

#error clnk Release\stm8s003. segment .text size overflow (164)

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

exit code=1.

When I remove code, the number (164) reduces. The Debug build is ok without any problems. Is there any limit to the linker? or does anyone have a hint? 

Thanks!

Chris

2 REPLIES 2
cr
Associate
Posted on April 08, 2016 at 18:37

Ok, damn, - it was just the code size.

I switched the optimization to ''minimize code size'' and now it works 🙂

...Also ''split functions into separate sections'' works

But how can I see how big my code is? Is there a statistic somewhere? - In the programmer window I can just see how big the .s19 files are... and in my case they are always same size.

luca239955_stm1_st
Senior II
Posted on September 08, 2016 at 15:47

the map file created by the linker contains all the information you need about code size and memory usage.

Regards,

Luca