This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

No space in execution regions errors when using u8g2 library

Hi all. I'm trying to use the u8g2 library with ss1306 controlled OLED display. After I added the library to the project, Keill gave an error

Error: L6406E: No space in execution regions with .ANY selector matching u8g2_fonts.o(.constdata).
Error: L6407E: Sections of aggregate size 0x4ab32c bytes could not fit into .ANY selector(s).

This is more than 4MB in RAM, while nRF52 has 64kB RAM. But with an optimization level above zero, there were no errors, but nothing happened. Here is a screenshot of the state in which it hangs. How to fix this and how to compile large library files so that only the necessary part of the code is used?

image description

Here's the link (github.com/.../u8g2) to the library I'm using. If I do not use fonts then the size is significantly reduced but still not enough to fit in 64KB(only reduced when using the optimization level 0 on the other levels nothing changes) . I need Keil not to add non-used variables to the assembly. The font file occupies 13MB and it stands out from the individual arrays of variables of type unt8_t and about one thousand in size and there are several tens of such arrays but in the current project only one such array of 837 elements is used. Also, in addition to the font file, there is a file with buffers, many buffers of huge sizes are declared in it, but only one is used.

Related