Electronic – Inbuilt flash memory size not enough

eepromflashmemorymicrocontrollerprogramming

I am using TM4C1230C3PMI controller from Texas instrument in one of my project. It has 32KB of internal flash, which is not sufficient for my application. Higher flash sized micro-controller are available in the market which can be used but I want to go with this micro-controller only. As per my knowledge external EEPROM can be used to increase the total flash size (Program memory).

Is my thinking is correct?

If not please suggest how can I increase the total flash memory size of the controller?

Best Answer

You cannot extend the program memory (flash). TI produces the same chip with double the flash and RAM, but nothing else changed: TM4C1230D5PMI.

If you cannot use a chip with larger flash, you will have to reduce your code size:

  • Disable debugging, such as the expensive printf function. A printf that supports floating point output will typically set you back around 5KB-10KB.
  • Make sure you compile with optimization enabled - typically the compiler flag is -Os.
  • Modern compilers can do link time optimization (LTO). With gcc, you get this with -flto. You have to pass -flto to both compilation and link stages, for all files. This typically reduces the produced code size by 30%-50%.