2010-06-12 01:25 AM
Hello everyone,
I'm a student from Italy and I'm working on a project in which the testing platform is an STM8S-Discovery board.
I developed my project with no problem but now, after few modifications to improve the performance of the code running on the board I keep obtaining the same error (reported below):
&sharperror clnk Debug\aes.lkf:1 segment .bsct size overflow (10)
&sharperror clnk Debug\aes.lkf:1 segment .ubsct size overflow (10)
The command: ''clnk -l''C:\Program Files\COSMIC\CXSTM8_16K\Lib'' -o Debug\aes.sm8 -mDebug\aes.map Debug\aes.lkf '' has failed, the returned value is: 1
exit code=1.
I found little information about .bsct and .ubsct segments, they should be related to static and static uninitialized data. The problem is that I didn't change the size of those data in the modified version of the code.
The code that compiles and runs fine contains 6 look-up tables of 256 bytes (1.5 kB total). The code that is supposed to compile, which doesn't, contains exactly 6 look-up tables of 256 bytes (1.5 kB total again). One of those tables is not the same as before, but I hardly think the contents can make any difference since it is of the same size.
Note: I tried both the debug and release mode and I see no changes.
Is there anyone that can help with this problem?
Thank you in advance.
#linking #c #programming #compiling #cosmic #stm8s-discovery2010-06-13 11:48 PM
Hello Sirus,
The problem you have is caused (I think) about the data size (size of your global variables) in your program. I got the same error message the moment the amount of data my program used, exceeded 256 bytes. The STM8 processor has 256 bytes at the begining of its memory map, and the Cosmic compiler / linker (I guess you must be using Cosmic, and not Rasonance), by default, uses this space for data; the moment the needed amount exceeds 256 bytes, the linker gives an error message and quits. I did not manage to find a way to tell Cosmic to move the data somewhere else (the procesor does have 2k of data space, so it is possible); I found that the Raisonance compiler gives the same error message, however if I use the word ''data'', e.g. ''data char buffer[1000]'', the application compiles and links OK. The problem is, the Rasonance toolset (1) returns an error message when used from STVD, and for the life of me, I do not understand what the error message window is trying to tell me and what I must do, and (2) the demo for the board comes with a project for Cosmic, but not Rasonance; when I created a workspace, a project, and I included the same files that compiled under Cosmic, I started getting all kinds of errors. Clearly, ST gives this board for $10, but the software tools are terrible. I am a professor in a Canadian university, am trying very hard to learn this board and the tools, to be able to use them in my courses, but I do this only because the board is cheap, and not because STM has made my life easy and because of that I love their product... It's too bad. I hope this helps. Daniel2010-06-14 12:08 AM
2010-06-14 12:27 AM
Hello Luca,
Thank you for your reply. I am using the STM8S-Discovery board (STM8S105C I believe). Can you please tell us what settings we must use to be able to successfully compile an application having more than 256 bytes of data, with your compiler / linker. If I understand you correctly, we must use: @near char aa; or @near char aa = 1; Correct? Daniel2010-06-14 03:55 AM