I think I've messed up again with the N-Mosfet.
The idea is to disconnect the stepup regulator (U3 = LTC3525D) when the output of the op-amp (U2 = MAX9015) is low, and viceversa.
The problem is that the LTC3525 V_OUT is a strange 0.98V instead of 3.3V, when the V_IN is 2.2V and the op-amp out is high. Between GND pin 2 of LTC3525 and GND of C4 (supercap) I measure 1.9V.
I am not sure if I connected the N-mosfet properly. Do you see any mistake from the circuit in the picture?
Thank you very much for your help.