2014-01-27 07:56 PM
Hello
My project compiles fine but I'm getting memory errors at the linker stage: segment .ubsct size overflow (4) .text size overflow (572) Is there any way to find out how much memory I have allocated for each of my memory sections (.text, .ubsct, etc.) , and can I change them?. By adding in a few more variables, I begin to get the overflow error, and could no longer build successfully. Any insights would be very much appreciated! Thanks! #overflow #memory-usage #segment-overlap #memory-overflow2014-01-28 01:14 AM
Hello,
the map file tells you how much memory you have used once the project has been compiled. The limits *you* have fixed to the linker (including the maximun size for each segment) are in the linker control file: this is a file with extension .lkf that is usually generated automatically by STVD (based on the micro used and that the user can modify in the STVD menus) - or it can be created/modifed by hand. Looking at your mapfile it looks like you set a limit to 16k of flash and that you are getting over it. For the RAM (segment .ubsct) you are getting over the hardware limit of 128 bytes in page0: put some (more) of your variables into 16 bit addressing ram (.data) if you have any space left there. Regards.2014-01-28 09:13 PM
Hi Luca,
Thanks for the reply. Here is my before introducing more variables that caused the error.I see a segment configuration section in the file :# Segment configuration - section reserved for STVD
#&.lt;BEGIN SEGMENT_CONF&.gt;# Segment Code,Constants:+seg .const -b 0x8080 -m 0x3f80 -n .const -it+seg .text -a .const -n .text+seg .FLASH_CODE -a .text -n .FLASH_CODE+seg .FLASH_CONST -a .FLASH_CODE -n .FLASH_CONST# Segment Eeprom:+seg .eeprom -b 0x4000 -m 0x400 -n .eeprom# Segment Zero Page:+seg .bsct -b 0x0 -m 0x100 -n .bsct+seg .ubsct -a .bsct -n .ubsct+seg .bit -a .ubsct -n .bit -id+seg .share -a .bit -n .share -is# Segment Ram:+seg .data -b 0x100 -m 0x500 -n .data+seg .bss -a .data -n .bss+seg .FLASH_CODE -a .bss -n .FLASH_CODE#&.lt;END SEGMENT_CONF&.gt;Would you be able to direct me to any guide on how I can modify the segment size manually?Can I tell if how much memory is left in every segment?Also, I tried changing the MCU from STM8S105C4 (16K) to STM8S105C6 (32K). Now I get the following error:#error clnk Debug\ecmotor.lkf:1 segment .ubsct size overflow (4)
#error clnk Debug\ecmotor.lkf:1 no default placement for segment .FLASH_CODE#error clnk Debug\ecmotor.lkf:1 segments .ubsct (0x8f-0x104) and .data (0x100-0x1cb) overlapIs there a setting required to tell the linker that I have 32K memory now? Best regards,YA2018-02-12 04:43 AM
Hello tan.yu_ang,
Could you solve this problem? Because i have the same...
Thanks