2019-01-20 05:47 PM
On the STM32L073 Nucleo board, I configured pin A5 as follows:
Under these conditions, the voltage on pin A5 is driven to 1.76V.
Why 1.76V and not 3.3V (VCC on the Nucleo board)?
If I change the mode from alt function to output (MODE5 = 0x01), and set the output value to 1, pin A5 is driven to 3.25V. If I leave the alt function as 0 (SPI) and enable the SPI controller, the clock swings from 0-3.25V as expected during the transfer. Clearly, the STM32L073 can put >3V on this pin, but the internal pull-up isn't strong enough to get there when the pin is connected to the SPI controller but a SPI transfer is not running. Adding an external 4.7k pull-up to this pin doesn't help -- something much stronger is holding or clamping it.
Note that the STM32F303 does not behave this way: its SPI1 SCK pin can be pulled all the way up to VCC with the internal pull-up.
I checked the errata and there is nothing to indicate that this pin has any known defects. The schematic for the STM32L073 Nucleo board also does not show anything else on this net that could be driving it.
This is causing me problems because I need the SPI SCK to idle high when CPOL=1. I am driving the SPI chip select as a GPIO, and between when the chip select is asserted and the SPI controller is enabled, SCK must remain high or the slave device may detect an edge. Since SCK is stuck at around 1.8V, its logical value at the slave device (VCC=3.3V) cannot be guaranteed to be 0 or 1. I have unsuccessfully tried a couple of workarounds:
Any idea what is going on here?
2019-06-30 04:28 AM
Is this something that anyone at STMicro can confirm? I am now seeing boards fail because the STM32L073 cannot communicate with another chip via SPI when CPOL=1 and I believe this to be the cause. This appears to be a serious defect in the STM32L073 but it is not mentioned in the errata.