I’m using a STPM33 on some of my boards with STM32F302 or STM32F303. With RIOT OS and my driver, I’m facing issues with SPI :
- Either I do spi_acquire() in the init process of the driver (bad practice) and everything works great. But after a while and only on some boards, I get constant values out of my STPM33. When I perform a soft (pm_reboot) or hard reset of the board, the values we get are correct again.
- If I do spi_acquire()/spi_release() before and after each transaction, I get only constant values or 3-4 different values but always the sames. I think the STPM33 doesn’t even get initialized.
- On EVALSTPM33 (the evaluation board from ST), if I do spi_acquire()/spi_release() before and after each transaction, everything works great. My driver is ok.
Before switching to RIOT OS, I was using a driver written by a student of my University based on ST HAL library. Everything was working very well. No issue with STPM33 with this driver.
Here are the drivers to compare:
- Old driver
spi.cfile : Functions of interest are : “spi_stpm33_init()”, “spi_stpm33_writebytes()” and “spi_stpm33_readbytes()”