May be I am very late to answer this. :; In order to use 'float' type with 'scanf' and 'printf' functions in CubeIde, you need to enable it in project settings. Hopefully this solves your issue. And this will parse float 'string' to a float variable.
This worked for me. However "&" is missing in this comment. It should be something like (as in the link provided) *((__IO uint8_t *)&SPIx->DR) = value;