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

static const 2D array gives Error L6220E

Hello, my application is utilizing almost all RAM.

Now i need to add a feature and for that i declare a 2D array:

static const char * states[][2] =
                                  {
                                     {"st10","st20"},
                                     {"st11","st21"},
                                     .
                                     .
                                     .
                                  }

I am using a chip with 32KB Ram. Without this new array memory consumption is as follows:

Program Size: Code=95100 RO-data=6428 RW-data=396 ZI-data=37728

once i add 17-th element in the array I get:

Error: L6220E: Execution region RW_IRAM1 size (32776 bytes) exceeds limit (32768 bytes)

Why do i get this error? Aren't static const arrays are stored only in flash memory?

Parents
  • The language of international business is bad English. Don't worry, you're in good company.

    Const and pointers can be confusing. A deep understanding of what the compiler does with these things can be very helpful. As long as you keep on following up on the things that confuse you, this understanding will with your experience.

    I'm not familiar with any of the ARM architectures, yet your issue was obvious to me, simply because I have the experience. I don't think I'd have seen it on the spot 2 years ago.

Reply
  • The language of international business is bad English. Don't worry, you're in good company.

    Const and pointers can be confusing. A deep understanding of what the compiler does with these things can be very helpful. As long as you keep on following up on the things that confuse you, this understanding will with your experience.

    I'm not familiar with any of the ARM architectures, yet your issue was obvious to me, simply because I have the experience. I don't think I'd have seen it on the spot 2 years ago.

Children