SPI full duplex mode for Longan Nano

I am not able to get SPI1 working in full duplex mode for the Longan Nano. The problem is that the SCK clock signal is not appearing on the SCK1/PB13 pin.

A) Receive-only mode is working:

When I initialize the SPI1 peripheral in receive only mode like this:

    spi_init_struct.trans_mode           = SPI_TRANSMODE_RECEIVEONLY;
    spi_init_struct.device_mode          = SPI_MASTER;
    spi_init_struct.frame_size           = SPI_FRAMESIZE_8BIT;
    spi_init_struct.clock_polarity_phase = SPI_CK_PL_LOW_PH_2EDGE;
    spi_init_struct.nss                  = SPI_NSS_SOFT;
    spi_init_struct.prescale             = SPI_PSC_256;
    spi_init_struct.endian               = SPI_ENDIAN_MSB;
    spi_init(SPI1, &spi_init_struct);

then I can see with a logic analyzer that the SCK clock signal appears on the SCK1/PB13 pin when spi_begin(SPI1) is called.

B) Full duplex mode

When I only change the trans_mode member in the above initialization code to get full duplex mode:

spi_init_struct.trans_mode           = SPI_TRANSMODE_FULLDUPLEX;

then the SCK clock signal does not appear when spi_begin(SPI1) is called.

A full PlatformIO test project is available in my Longan Nano test code repository.

What is necessary to set up the SPI1 peripheral correctly for full duplex mode?

The problem was that the GPIO pin for the SPI MISO signal was initialized with GPIO_MODE_OUT_PP instead of GPIO_MODE_AF_PP. When using GPIO_MODE_AF_PP for the MISO pin the SCK signal does appear as expected in full duplex mode.