stm32 release mode not reading spi device correctly, but debug mode works perfectly
I am using a STM32L031F6P6 device, with a microchip port expander: MCP23S17, off the SPI
bus. I am using the device in interrupt mode, so when a gpio changes state, it sets its int line, which is tied
back to my stm part. In my int handler, all I do is set a flag, which is then picked up in the main loop.
If the flag is set, the main loop will then perform a read of the gpio device to get the port value..etc.
All of this worker 100% perfectly when I compile my app for DEBUG. However, when I compile it under
release it is not working, the values read from the port expander are bad.
Here is what I can confirm:
all of the variables used in the INT hander/main loop are Volatile.
Both serial(rs232 ) and SPI are working correctly under both release and debug.
I have other spi gpio devices on the same spi bus that are "outputs" that are working fine.
I have tested the same code under both STCube IDE environment and the VScode (cmake) env...same exact result.
Has anyone ran into this before??, It appears like there is something in the ST spi driver code that maybe timing related,,,?.. thanks .
