microlib 是缺省 C 库的备选库。 它用于必须在极少量内存环境下运行的深层嵌入式应用程序。 这些应用程序不在操作系统中运行。microlib 不会尝试成为符合标准的 ISO C 库。
microlib 进行了高度优化以使代码变得很小。 它的功能比缺省 C 库少,并且根本不具备某些 ISO C 特性。某些库函数的运行速度也比较慢,例如,memcpy()。
优化选项不是那个
我指勾不勾选microlib跟memset是否有问题基本无关。我倒认为,勾选了microlib反而会增加出问题的几率。如果代码空间够用,最好别勾选microlib。下面是使用microlib需要注意的一些问题(包括但不限于这些):
Microlib is not compliant with the ISO C library standard. Some ISO features are not supported and others have less functionality.
Microlib is not compliant with the IEEE 754 standard for binary floating-point arithmetic.
Microlib is highly optimized for small code size.
Locales are not configurable. The default C locale is the only one available.
main() must not be declared to take arguments and must not return.
Microlib provides limited support for C99 functions.
Microlib does not support C++.
Microlib does not support operating system functions.
Microlib does not support position-independent code.
Microlib does not provide mutex locks to guard against code that is not thread safe.
Microlib does not support wide characters or multibyte strings.
Microlib does not support selectable one or two region memory models as the standard library (stdlib) does. Microlib provides only the two region memory model with separate stack and heap regions.
Microlib does not support the bit-aligned memory functions _membitcpy[b|h|w][b|l]() and membitmove[b|h|w][b|l]().
Microlib can be used with either --fpmode=std or --fpmode=fast.
The level of ANSI C stdio support that is provided can be controlled with #pragma import(__use_full_stdio).
#pragma import(__use_smaller_memcpy) selects a smaller, but slower, version of memcpy().
setvbuf() and setbuf() always fail because all streams are unbuffered.
feof() and ferror() always return 0 because the error and EOF indicators are not supported.
同不懂帮顶 。
microlib 是缺省 C 库的备选库。 它用于必须在极少量内存环境下运行的深层嵌入式应用程序。 这些应用程序不在操作系统中运行。microlib 不会尝试成为符合标准的 ISO C 库。
microlib 进行了高度优化以使代码变得很小。 它的功能比缺省 C 库少,并且根本不具备某些 ISO C 特性。某些库函数的运行速度也比较慢,例如,memcpy()。
优化选项不是那个
我指勾不勾选microlib跟memset是否有问题基本无关。我倒认为,勾选了microlib反而会增加出问题的几率。如果代码空间够用,最好别勾选microlib。下面是使用microlib需要注意的一些问题(包括但不限于这些):
Microlib is not compliant with the ISO C library standard. Some ISO features are not supported and others have less functionality.
Microlib is not compliant with the IEEE 754 standard for binary floating-point arithmetic.
Microlib is highly optimized for small code size.
Locales are not configurable. The default C locale is the only one available.
main() must not be declared to take arguments and must not return.
Microlib provides limited support for C99 functions.
Microlib does not support C++.
Microlib does not support operating system functions.
Microlib does not support position-independent code.
Microlib does not provide mutex locks to guard against code that is not thread safe.
Microlib does not support wide characters or multibyte strings.
Microlib does not support selectable one or two region memory models as the standard library (stdlib) does. Microlib provides only the two region memory model with separate stack and heap regions.
Microlib does not support the bit-aligned memory functions _membitcpy[b|h|w][b|l]() and membitmove[b|h|w][b|l]().
Microlib can be used with either --fpmode=std or --fpmode=fast.
The level of ANSI C stdio support that is provided can be controlled with #pragma import(__use_full_stdio).
#pragma import(__use_smaller_memcpy) selects a smaller, but slower, version of memcpy().
setvbuf() and setbuf() always fail because all streams are unbuffered.
feof() and ferror() always return 0 because the error and EOF indicators are not supported.
个人认为,为了保证代码的兼容性、可扩展性、可维护性,只在代码空间实在太大且不违背上述局限性时再考虑使用microlib优化空间的问题。
http://www.xuebuyuan.com/1357284.html 我的理解 使用 microlib 跟优化是无关的吧
使用microlib就意味着你要优化。
优化的是代码空间,但优化也意味着损失一些东西,见microlib的一些注意事项。
你使用了相比经过优化的microlib,则意味着附带的优化了自己程序的代码空间。但这些优化是有副作用的(肯定的)。
我认为,这类优化导致了可移植性差(你写的代码在自己的IDE上行,但别人试用时不行了-除非也打开microlib)、扩展性差(因为可能要用RTOS等其它选项,导致你的代码无法添加到这类应用中)等问题。
所以STM32CubeFX中的代码是基于标准c来写的,当然也不会进行任何优化。而优化过的库,比如DSP会进行特殊说明,或者出不同版本(比如优化过的和未优化)的DSP库,以符合各类需求。
我主要是看到很多帖子上来就提勾选microlib,这会导致错误的导向!我认为应该把microlib的问题说清楚,选不选程序员自己决定!
谢谢~~,我明白了