STM8L052R8 code compilation error after exceeding 32KB

Publisher:Jinyu2022Latest update time:2017-02-20 Source: eefocusKeywords:STM8L052R8 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

I am working on a project using STM8L052R8. The FLASH of this chip should be 64KB. IAR looks at the lnkstm8l052r8.icf file and finds the following definition:

define region NearFuncCode = [from 0x8000 to 0xFFFF];

define region FarFuncCode = [from 0x8000 to 0xFFFF]

                          | [from 0x10000 to 0x17FFF];

define region HugeFuncCode = [from 0x8000 to 0x17FFF];

However, if the compiled code exceeds 32KB in my program, the compilation fails with the following message:

Error[Lp011]: section placement failed

          unable to allocate space for sections/blocks with a total estimated

                    minimum size of 0x96ee bytes in <[0x008000-0x00ffff]>

                    (total uncommitted space 0x7f80).

If the optimization level is increased and the code size is controlled within 32KB, the compilation can be successful.

In the project settings, select Optione->Target->Device and select stm8l152r8; in stm8l152.h, select #define STM8L15X_HD

I don't know what else could be causing this error? Or is there something wrong with the chip I bought?

Solution: Change the project configuration, change the Code in General Options->Target to Medium or Large

STM8L052R8 code compilation error after exceeding 32KB - My Heart Will Go On - ARM Embedded Development

 

        The small mode of Code has a 64K byte address range, the medium mode has a 16M byte address range, but functions are not allowed to cross 64K byte boundaries. The large mode has a 16M byte address range, and functions do not have cross-border restrictions and can be placed anywhere.

        The small address range of Date is 256 bytes, the medium address range is 64K bytes, and the large address range is 16M bytes.


Keywords:STM8L052R8 Reference address:STM8L052R8 code compilation error after exceeding 32KB

Previous article:The fastest configuration method for STM8 compiler (STVD+COSMIC)
Next article:I2C Operation Notes - Taking AT24C04 as an example

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号