External power to STM32F4 Discovery board
From this answer: STM32F429I-DISC1 can not be powered by using ext. USB Battery


  There is/was a known issue with the ST-LINK firmware shipped with the F429I-DISC1 and F407-DISC1 boards, and perhaps others. The STM32 is held in reset by the debugger when not attached to a host computer, so charger/battery use cases failed. This can be remedied by updating to current firmware revisions, at the date of posting I'd recommend downloading the ST-LINK Utilities v3.9.0 and using that to update the firmware, this has solved issues I've seen with this.


I believe this sets grounds for what you did and why it worked.