IO port always readuing 0v in release mode.
Hi
I am using a STM32L433 and have a digital input pin, which is checked on bootup and enables the USB if 3.3v is in the pin. When working in debug mode, it always works, but when I switch to release mode , using stm32CubeIDE , it always reads 0v, and my optimization is None. Below is my code .
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOBEN; //Enable Port B clock
GPIOB->MODER &= ~GPIO_MODER_MODE12; //PB12 as input, check for usb interaction
inSetupMode=(GPIOB->IDR >> 12 )& 1; //=1 when using USB
Can anyone let me know what the issue is?
Many thanks
Scott
