Hi..in my case I found that the microcontroller is powered by +5V. I had to change the Power Rail Voltage to +3.3V.
I changed the voltage from the “Design->Configure Power rails” menu entry. From the drop down list, I picked VCC/VDD and changed the voltage from 5 to 3.3. Now it works correctly.