Used manual ranges in IAR Memory Configuration setup and created a new Read/Write region on all available rest memory (until 0xFFFFFFFF
). Then attached this region in linker for heap / stack. Is it proper way to extend the available for the program memory resources on STM32 chip (IAR compiler)?
How to get as much memory as possible on the chip in case it will perform only mathematical calculations on standard library functions set?
The algorithm uses a lot of intermediate buffers which are allocated in dynamic memory now (e.g. heap), is it a proper way on embedded systems? I suppose that arrays are so big that C VLA will take too much stack place. The data is dynamic, e.g. we don't know the size of arrays and can't statically preallocate it.
I have also found out that there are a lot of SFR typed chunks in Memory Configuration (about 256 Mb each one!) marked as ExtDev*. How it can be a memory if it is 'Special function register'? What's the sense of this memory area and can I write to them?
Thank you
How to get as much memory as possible on the chip in case it will perform only mathematical calculations on standard library functions set?
You cannot change the amount of RAM inside a microcontroller, without switching for a chip with more memory. Therefore you need to use the RAM you have in the optimal way.
allocated in dynamic memory now (e.g. heap), is it a proper way on embedded systems?
No, because it doesn't make any sense to use it on microcontrollers. See this.
The data is dynamic, e.g. we don't know the size of arrays and can't statically preallocate it.
Of course you know the size of the arrays in advance. The size is less than the RAM you have available on the chip. Therefore you need to specify a maximum allowed value. Which in turn means that you can and must statically pre-allocate the space, because you need to handle the case where the array size == maximum allowed.
If you were to use the heap you would still need to have that much memory available for the worst case, so the heap is not helpful here, nor does it save you any memory. Get rid of the heap entirely and use that memory in better ways.