This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Library members are using more ROM space

I am using ARM cortex m0 and i am facing an issue of more ROM space usage in that considerable amount is used by library members like _rtentry.o, __scatter_copy.o, aeabi_sdiv.o,rt_memcpy.o, rt_memclr.o,sys_stackheap_outer.o. Now how do i reduce this memory usage, why these library functions are getting called.

Parents
  • Not sure what you mean with "more" ROM space.

    The CRTL - C Runtime Library - will also consume space just like the code you write yourself.

    Some functions in the CRTL are helper functions to prepare the C environment for your code. Some are functions you are directly calling. Some are helper functions for things that are too complex for the compiler to inline during the code-generation phase.

    The Keil tools are developed for use in embedded environments. So they are optimized to be as small as possible.

    A function like aeabi_sdiv will be added if the compiler sees a need for a signed division that can't be handled directly with a processor instruction. But if the code does need to perform the division, then you don't have much options.

    Remember that for small programs, the CRTL may represent a significant part of the total code size. As the program grows, the business logic part of the code will represent a larger and larger part of the total program size. But in the end, you need to select a processor that has enough resources for the intended task.

Reply
  • Not sure what you mean with "more" ROM space.

    The CRTL - C Runtime Library - will also consume space just like the code you write yourself.

    Some functions in the CRTL are helper functions to prepare the C environment for your code. Some are functions you are directly calling. Some are helper functions for things that are too complex for the compiler to inline during the code-generation phase.

    The Keil tools are developed for use in embedded environments. So they are optimized to be as small as possible.

    A function like aeabi_sdiv will be added if the compiler sees a need for a signed division that can't be handled directly with a processor instruction. But if the code does need to perform the division, then you don't have much options.

    Remember that for small programs, the CRTL may represent a significant part of the total code size. As the program grows, the business logic part of the code will represent a larger and larger part of the total program size. But in the end, you need to select a processor that has enough resources for the intended task.

Children