Description
@stevew817 (At least I assume I should bother you with it)
If you look at random other target, the initial stack pointer is set to top of the RAM: https://developer.mbed.org/users/mbed_official/code/mbed-src/file/53297373a894/targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/TOOLCHAIN_ARM_MICRO/startup_MKL25Z4.S
For all EFM32 targets I checked it is not explicitly set, and I have no idea how the compiler handles it exactly: https://developer.mbed.org/users/mbed_official/code/mbed-src/file/53297373a894/targets/cmsis/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32WG_STK3800/TOOLCHAIN_ARM_STD/startup_efm32wg.S
What is the result? The zero gecko has, as long as it fits within compile time, ALWAYS 300-400B of memory to use at runtime. If you have an empty program, it has 300-400B available. If you define a global array of 1kB, it still has 300-400B available. This means you can allocate only an extremly limited amount of data at runtime.
For the wonder gecko a quick test showed me about 4kB of data, which is still way short of the amount of RAM it has.
A simple program which iterates until it crashes because it filled its own stack could do 21 runs on a zero gecko, while on an LPC812 it did 222 runs. Also the first 4 bytes of the flash are always the initial stackpointer, and that shows that that is indeed the problem.
And in addition to that there is the much higher memory usage at compile time than for other similar targets, any idea what causes that?