Regulator in MCUboot

In my circuit I have a MOSFET which disconnects the battery. There is a GPIO pin which turns this device on and I'm using regulator-fixed to drive it during start-up. A short switch press turns on the MOSFET temporarily and the firmware then holds it on.

My DTS entry looks like this:

    bat_switch {
		compatible = "regulator-fixed";
        regulator-name = "lipo-battery-switch";
        enable-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
        regulator-boot-on;
    };

This works in the main code. It turns on at startup and I can use regulator_enable/disable to control it. However in MCUboot it is not activated and my short press gets as far as "Jumping to the first image slot" and runs out of juice. Looking on a scope I can see that the GPIO line has not been activated at all.

Any ideas?

Related