IAR for STM8 Error

Source: Internet
Author: User
Tags constant definition

An IAR for STM8 v1.3 project, the following error occurred after changing to version 1.4

Unable to allocate space for sections/blocks with a total estimated minimum size of 0x2341 bytes in <[0x008000-0x009fff ]> (Total uncommitted space 0x1f80).

Find the following article on the Web and change the "Printf formatter" and "Scanf formatter" in the "Library options" to "small" in the project options or

Source: stm8s and IAR program common errors

First, the problem of duplicate definition in IAR

When you write your own header file, Remember to define the constants in the. c file, if you define the constants in the. h file, when you include the header file in Main.c or elsewhere, the constant definition in the header file is included in the MAIN.C, and the corresponding. c file also has the constant definition statement, which causes the linker error. There is the XXXX redefinition (redefined). Also, when you want to use the amount defined in the other. c file in Main.c, remember the + extern+ < type >+<+ variable name >.

Standard practice: Declare variables in the. h file, define variables in a. c file, and other. c files to use the variable as long as it contains the. h header file, equivalent to the variable declaration, you can refer to the variables defined in the other. c files. In general, variables are only declared in the header file, and variables are defined in the original file, even if you use precompiled directives in the header file #ifndef ... #endif, and you cannot define variables in the header file. cannot be defined, must be declared. Second, program overflow problem (error[lp011] problem)

ERROR[LP011]: section placement failed:unable to allocate space for sections/blocks with a total estimated minimum size o F 0x2ba9 Bytes in <[0x008000-0x009fff]>

Reason: Change the library from full to normal, all of a sudden space to reduce a lot, and printf and scanf format from full to small, but this can not be used in printf.

(Total uncommitted space 0x1f80). 971 bytes of readonly code memory 915 bytes of readonly data memory 726 bytes of readwrite data memory Er Rors:1

CPU:STM8S103F3P, which has 8 K FLASH[0X008000-0X009FFF], has 1 K RAM, the actual hint of the FLASH size is 10582+809>8192

[0x008000-0x009fff]=8192,0x1f80=8064 0x3180=12672, 0x1f80=8064, 11971+915=12886 8s207 There is no problem, replaced by 103 problems on overflow.

Related discussions:

Http://www.amobbs.com/thread-5516889-1-26.html

Http://www.amobbs.com/thread-5516388-1-1.html

Http://www.amobbs.com/thread-5526431-1-1.html

Http://www.amobbs.com/thread-4181924-1-1.html

Three, error[pe169]: expected a declaration

Answer: more} closing curly braces.

Four, the PL2303 power after the mouse moves the solution method:

1, re-power, because we developed the board with a button to download the circuit, so the first power on, will cause several times (3~6) MCU reset, very normal. You do not have to press the power button every time to achieve the reset, there is no problem.
2, because your routine, a power, through the serial port output data, and at this time CH340 still in and computer communication, CH340 in and computer USB connection established, received data, it may lead to your serial port is not recognized as the serial port, and was recognized why ball and other equipment, so that the mouse flying.

Workaround:
Before power on, press and hold the MCU reset, then power on. Wait about 10 seconds before releasing the reset. It's all OK.

IAR for STM8 error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.