cancel
Showing results for 
Search instead for 
Did you mean: 

[FEATURE REQUEST] Set SPI to open drain in master mode for STM32G0xxx

JoOb
Associate

I've updated the question as the answer was not suffient.

Using version 6.7.0 of STM32CubeMX and I want to set the SPI SCK and MOSI signals to open drain when in master mode. What I can see, this is not possible and I have to manually modify the configuration file.

The reason for this non-SPI standard configuration is that I'm using the SPI to access a LCD controller that don't speak SPI, but the protocols are similar enough on the logical layer, but not on the physical layer. So it would be great if the Cube could set a SPI master to "Alternate Function Open Drain".

2 REPLIES 2
Aymen ABBES
ST Employee

Hello @Johan Öberg​ ,

First let me thank you for posting.

According to the Reference Manual of STM32G0x1 page 1145/1390 :

As MISO pins of the slaves are connected together, all slaves must have the GPIO configuration of their MISO pin set as alternate function open-drain (see I/O alternate function input/output section (GPIO)).

And this was the subject the ticket that you have mentioned:

57520 [MX-SPI] Missing Alternate Function Open Drain in SPI configuration mode

In fact when selecting :

- SPI1 as Full Duplex Master.

- SPI2 as Full Duplex Slave.

- SPI3 as Full Duplex Slave.

SPI2,SPI3 should have as GPIO mode values : "Alternate Function Push Pull" and "Alternate Function Open Drain".

Regards,

Aymen

JoOb
Associate

Hi @Aymen ABBES​ , thanks for fast reply.

What I'm trying to do, is to access a LCD controller that has it's own custom serial protocol, i.e. not originally electrical compatible or serial compatible with normal SPI. Even though it's not SPI, the SPI controller is perfect for communication with the device, I need only to do some bit width reconfiguration after the first sent 5 bits, and manually control the chip select signal.

I understand that you want to help the CubeMX user and maybe not want to change the tool just for my corner case, but a "Advanced" checkbox could be handy to be able to do illegal configurations from the SPI standard point of view, but legal from the STM32 silicon point of view.

BR,

JoOb