Skip to main content
DIvan.1
Associate III
October 16, 2020
Solved

How to reduce the use of FLASH and still keep NFC library?

  • October 16, 2020
  • 2 replies
  • 751 views

Hello!

I'm working on NFC project. I created a program on STM32070RB microcontroller (Nucleo and x-cube05) but all the store in EU don't have it on stock. Because of that I took STM32070C6T6.

Unfortunately, this chip have only 32kbayts of FLASH and IDE give me an error (region `FLASH' overflowed by 7428 bytes).

Can you recommend me which files and code would be the most efficient to delete or any other idea how to decrease the FLASH uses.

Below I attached my project for example.

Thank you and all the best,

Domen

    This topic has been closed for replies.
    Best answer by Brian TIDAL

    Hi,

    the default optimisation level in your project is None. When setting optimize for size, the footprint of your application is about 23kB.

    Rgds

    BT

    2 replies

    Brian TIDAL
    Brian TIDALBest answer
    Technical Moderator
    October 16, 2020

    Hi,

    the default optimisation level in your project is None. When setting optimize for size, the footprint of your application is about 23kB.

    Rgds

    BT

    In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
    DIvan.1
    DIvan.1Author
    Associate III
    October 16, 2020

    Thank you very much. I didn't know for this function till now.

    Is this most common used function or It's better to use it if only really don't have enough space?

    Also, for the future what would you think... Is it better to use some other chip (for example 32f4 family) or this is not big deal and I can keep this chip?

    Best regards,

    Domen

    Brian TIDAL
    Technical Moderator
    October 16, 2020

    Hi,

    this is a quite common feature available on most compile and quite commonly used.

    See also: http://blog.atollic.com/the-ultimate-guide-to-reducing-code-size-with-gnu-gcc-for-arm-cortex-m

    For the chip selection: just keep in mind to have some margin if you plan to add some new features in the future. Make sure to check also the RAM size margin.

    Rgds

    BT

    In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.