This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Prevent GPIO change in bootloader

My custom nRF52840 board uses the STmicro STM6601 push-button controller. To keep the nRF powered, the PSHOLD line must be kept high. I have a GPIO set as an output for that.

I am trying to incorporate the Open bootloader in my code.

Obviously using a reset (hard or soft) will change that GPIO to an input, causing the PSHOLD line to go low.

I can successfully call the boot loader directly without a reset, but it seems to reset the GPIO pin to an input anyway.

I would like a suggestion on how to keep that GPIO set through the bootloader initialization.

Where in the Open bootloader process does it reset the GPIOs?

Parents
  • Hi Kelly, 

    Could you tell which GPIO pin you use ? 

    Note that after a soft reset, a pin will be configured as input with input buffer disconnected. The level of the pin will be high impedance (floating). It's not driven low. You can have an external pull up for the pin. 

    Note that if you implement the GPIO configuration inside the bootloader, there would be a very short period when the pin is float. And because it's very short (microseconds) you can add a capacitor to keep the pin high during the period if pull up is not an option. 

  • The GPIO is P0.12

    When I step through the process using the debugger (from when the app calls the bootloader to when the bootloader enters its main loop), the GPIO stays high.

    But when I run it "stand-alone", the output goes low long enough for the system power to go off.

Reply Children
Related