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
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.
Previous article:The fastest configuration method for STM8 compiler (STVD+COSMIC)
Next article:I2C Operation Notes - Taking AT24C04 as an example
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Disassembly of GM520 differential pressure gauge
- I've seen wire winding, but I've never seen one so creative!
- Please recommend a domestically produced isolated 485 chip with a single power supply
- Analog digital exam is not difficult (Mu Sen's analog circuit series, original
- 【ufun learning】Part 4: Serial port printing output
- About MOS tube recommendation
- CC4024-----7-bit binary serial counter
- How to keep the AD schematic synchronized with the PCB after it is split?
- Main application categories of millimeter wave radar
- pybL development board pinout