AnsweredAssumed Answered

unable to drive SPI port using STMCube generated code

Question asked by p.ben on Dec 10, 2014
Latest reply on Feb 5, 2015 by RSky
Hi,
I am trying a simpleexperiment using my STM L1 Discovery board. I have created a project using the STMCubeMX GUI that has the SPI port enabled as Master. The clocks have been configured correctly and I have a GPIO port enabled as well.

All I am trying to do is to repeatedly send data on the SPI port (SPI2) using the "HAL_SPI_TransmitReceive" function. When doing so I see no activity on the SPI CLOCK or MOSI pins of the board.

The necessary SPI initialization function is indeed present (MX_SPI2_Init()).
I can also toggle my GPIO pin successfully which shows that the system clock has been configured.
I also removed the LCD from the board as indicated in the board datasheet to make sure that has been taken out of the picture.

Any idea what might be going on here? I'm thinking it is some gotcha that I am running into.

If anybody can point to sample SPI code for the L152RC part that would be helpful.
I am most concerned about the port assignment. My understanding is that the cube routines should do this automatically (within the HAL_SPI_MspInit function), but I'd like to try a known example.

Thanks,
Ben

Outcomes