by sebraa » Wed Nov 04, 2015 10:15 pm
As far as I have seen (please correct me), e_init() and e_finalize() enable or disable the Epiphany clock, respectively. Obviously, after e_finalize(), there can't be any communication to the Epiphany unless you call e_init() again.
You need to call e_init(), e_open() in the beginning (but an additional e_system_reset() won't hurt), and it is a good idea to call e_close() and e_finalize() at the end of your program. These functions don't need to be called anywhere else, even if you want to reload the cores with a different application.
When starting a core, its startup code (from crt0.o) is run, which will produce a working C environment (setup stack pointer, initialize .bss and newlib, etc.) - this startup code will then call into main(). Since .data does not get copied from e.g. ROM, it gets overwritten while your program executes, and even a full reset will not reset globally initialized variables. So you'd need to reload the core anyway.
You should assume that all e-hal functions affect the Epiphany. After all, it is the Epiphany hardware abstraction and manages elementary functionality like turning the chip on/off, reading/writing special registers and memory, generating events (resets, interrupts) on specific cores etc.