I have my serv cpu running and when a new irq comes (that I suppose that have to be enough long to be in an instruction cycle) my program goes to the MTVEC adress. But the current adress is not stored in the MEPC.
So when the interrupt handle finishes, it goes to the main function forgetting that we were in another function, thus overflowing the system stack, (since the SP is not reset).
I have my serv cpu running and when a new irq comes (that I suppose that have to be enough long to be in an instruction cycle) my program goes to the MTVEC adress. But the current adress is not stored in the MEPC. So when the interrupt handle finishes, it goes to the main function forgetting that we were in another function, thus overflowing the system stack, (since the SP is not reset).