Is this a bug in the app or the HAL, support framework?
I'm seeing something very odd. I have a crude test app that exercises an EPS8266 plugged into my STM32F769 Discovery board.
The app runs and loops and does simple checks during execution, it runs fine every time I run it.
But if I simply comment out an unused local struct declaration and run it, it fails! It behaves differently.
I wondered if there is a bug in my code in which I was inadvertently writing to memory in that unused struct and removing it meant it was writing to some other part of the stack and so behaved differently.
However if I zeroize the struct and run, at no point do I see anything changing in the struct so I see no evidence the app is writing to this area, besides the app is simple and I see no code that looks suspect.
I'm using Visual Studio 2017 with Visual GDB, shall I post the source? is anyone interested in trying to repro? (it's a single source file, quite small).
Thx
...a short time later....
OK forget it, this is fixed!
The cause is that the second declared struct is a UART handle and although the code inits the UART it was not initializing all fields. Therefore the content of that struct (though some fields were initialized) was different when I removed the preceding unused struct declaration.
I now zeroize the UART struct before setting its various fields and initializing the UART and I get consistent soldi behavior no matter what I do with that unused struct.
All good (But the example code I copied this from is flawed)
