HAL_SPI_Init() needs some delay or will result in hard fault
Some strange behaviour that I can't explain but like to understand :
I am using an e-paper display via SPI, and to conserve power during sleep, I power down the display via a FET.
After waking up, I enable the power to the display, then initialize the SPI to talk to it.
gpio::enableGpio(gpio::group::enableDisplayPower);
MX_SPI2_Init();
gpio::enableGpio(gpio::group::spiDisplay);
If I add a 1ms delay between turning on the power to the display and enabling the SPI, then the hard fault never appears..
gpio::enableGpio(gpio::group::enableDisplayPower);
HAL_Delay(1);
MX_SPI2_Init();
gpio::enableGpio(gpio::group::spiDisplay);
Of course, if I debug/step through MX_SPI2_Init(); the hard fault doesn't appear as this is also adding delays..
Any idea what is going wrong or how I could further investigate ?
