As discussed in this thread, one needs to implement a work-around in order to zero-initialize undefined global and static variables.
My first try was to use the FILL directive in the linker file, which seemed to work at first, but did not work when running from flash. If I understand correctly, this is because the FILL directive only causes the memory to be initialized when running from JTAG, however, please explain if there is more I should know.
I got a tip about using memcpy to zero .ebss, but this would overwrite initialized variables. Is there a convenient method to run this before cinit?
Any other suggestions? It would be very nice if the various methods of accomplishing this was explained on the Wiki, together with the implications or pros/cons of each method.