11
\$\begingroup\$

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?

\$\endgroup\$
6
  • 1
    \$\begingroup\$ External EEPROM is typically used for storing data because the internal Flash allows less erase/write cycles then most EEPROMs and it can be overwritten byte-wise. For CPUs with an external bus interface (your one does not have this) it would be possible to add external program memory (however this is a bit complicated...). Theoretically it would be possible to store pieces of code in an external EEPROM and to load this code into RAM to execute it - however in most cases this scenario is not realistic. \$\endgroup\$ Commented Jun 27, 2015 at 16:38
  • 3
    \$\begingroup\$ Many years ago, a related maxim was "If you can't do it in 1K, you can't do it." I thought it was clever and worth thinking about, but didn't really accept it. Then MicroChess arrived in 1K. \$\endgroup\$ Commented Jun 28, 2015 at 3:30
  • 1
    \$\begingroup\$ Why dont you boot your code from an external memory? There are a number of external memories that can be interfaced to your uC. This will not place constraints on your internal flash as you will be booting your code externally. \$\endgroup\$ Commented Mar 17, 2016 at 5:36
  • \$\begingroup\$ Code size optimization forembedded processors \$\endgroup\$ Commented Mar 17, 2016 at 7:49

2 Answers 2

22
\$\begingroup\$

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%.
\$\endgroup\$
2
\$\begingroup\$

You might get the smallest software footprint by using assembler and a Forth-like language designed for your purpose. Another is compressed machine code if there is a lot of almost identical code.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.