one thing about cubemx & sw4stm32, the boiler plate initialisation and de-initialisation are handled. plenty of sections labelled as user supplied.
Big but, the user bits still need to be supplied to handle the spi/i2c/uart/usart device, the guts are still required to get it to work. e.g. a tft lcd still needs the code to perform the initialisation sequence, that then needs write command, write data, read data functions; each may be a 8bit &| a 16bit function.
Development environment specific, Arduino, Eclipse, VS2013,Em::Blocks etc