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?

Parents
  • Don't worry, I found the cause. This was the content of mcuboot.conf

    # Enable bootloader logging
    CONFIG_LOG=y
    CONFIG_MCUBOOT_LOG_LEVEL_INF=y
    
    # Enable serial console for logging
    CONFIG_SERIAL=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    # Disable serial flash driver, not needed
    CONFIG_SPI_NOR=n
    
    # Disable flash patch for security
    CONFIG_DISABLE_FLASH_PATCH=y
    CONFIG_REBOOT=y
    
    # Getting warnings without this
    CONFIG_STREAM_FLASH=y
    CONFIG_IMG_MANAGER=y
    
    # Turn battery on
    CONFIG_REGULATOR=y
    

    CONFIG_REGULATOR depends on CONFIG_GPIO which was missing. All works as expected once that is added.

    # Turn battery on
    CONFIG_GPIO=y
    CONFIG_REGULATOR=y

Reply
  • Don't worry, I found the cause. This was the content of mcuboot.conf

    # Enable bootloader logging
    CONFIG_LOG=y
    CONFIG_MCUBOOT_LOG_LEVEL_INF=y
    
    # Enable serial console for logging
    CONFIG_SERIAL=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    # Disable serial flash driver, not needed
    CONFIG_SPI_NOR=n
    
    # Disable flash patch for security
    CONFIG_DISABLE_FLASH_PATCH=y
    CONFIG_REBOOT=y
    
    # Getting warnings without this
    CONFIG_STREAM_FLASH=y
    CONFIG_IMG_MANAGER=y
    
    # Turn battery on
    CONFIG_REGULATOR=y
    

    CONFIG_REGULATOR depends on CONFIG_GPIO which was missing. All works as expected once that is added.

    # Turn battery on
    CONFIG_GPIO=y
    CONFIG_REGULATOR=y

Children
No Data
Related