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
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- [New ways to play with SAMR21] 14. LSM6DSO gyroscope sensor
- Excuse me, are the units of magnetic field strength, Henry, and inductance, the same units? The former is A/m and the latter is ohm*second
- I want to use FPGA to make an SPI Slave. I have a few questions about the clock.
- [NXP Rapid IoT Review] + First Look at IOT Kit
- Revealed! PPO, the "hard core" material in the 5G era
- [Atria AT32WB415 Series Bluetooth BLE 5.0 MCU Review] 1.0 Unboxing and evaluation and setting up the operating environment
- Briefly describe the application of embedded logic analyzer in FPGA testing.zip
- Share MSP430F5529 library functions
- One year after being sanctioned, the U.S. Department of Commerce suddenly allowed U.S. companies to work with Huawei to develop 5G network standards
- Is there any microcontroller burning tool that supports Android?