You have an interesting question. I could not find a menu/command that could be used with Creator to limit app memory size. But, maybe there is a way to work around this.
Let's say FLASH memory is 32k and you want to limit app size to 2k. You could #include a dummy data file that contains 30k bytes of data. When the project is built, maybe Creator will complain when app size + dummy data exceeds 32k. This would be the indication the app has exceeded its 2k size limit.
I'm guessing, the dummy data file would be placed in the same folder as main.c. I've never tried this.
Not a great answer to your question, but maybe this would result in the same outcome.
I work with Dima.
Thank you for your kind response.
It is an interesting solution but it does not answer our requirement.
We need to have an empty section in the flash. So by filling it with a dummy data file, it does not meet our needs.
BTW, the dummy file could be all FF's, which leaves the FLASH available for programming from an app.
Instead of a dummy file, an array of constants ($ff) would also work.
Creator outputs a line of text to indicate memory usage for both code and data spaces after it builds a load. Maybe you can build a script to detect/interpret this text. This text is stored in a log file.
I've still not come up with a good answer for using Creator to do the work of limiting project memory space. If you want to dig deeper, you can control the compile/build process from command scripts.
There's also a thread about this:
I forgot to mention, the dummy data file is only used to get a warning from Creator when project exceeds available FLASH size. For the final Build, delete the #include and FLASH space is restored for whatever future programming is needed.
You can edit the memory regions in the linker script. For the GNU linker, it is the MEMORY command in the .ld file. Once you have defined a region of memory named mem, you can direct specific output sections there by using a command ending in `>mem' within the
SECTIONScommand. If the memory overflows the linker will throw an error. There is no setting to stop allowing compilation of code though.