Here is an example for all of you that are still stuck with the same problem.
In the example, you can find the project file for STM32CubeIDE and STM32CubeMX.
I'aware of the fact that the code is clumsy but it will give you an idea on how to set some of the parameters for the MCU.
The example works with SDIO 1 bit mode.
Few things to be aware of:
- The code runs on a custom board where pull-up resistors of 10K are placed on the SD card pins :

- The SD card installed is 32GB, I first format the card with the PC and then plug it on the board. The first time f_open() gives an error, I reset the MCU and run the code again and from then on it works well, meaning I can create the file, write some text and read it back. Perhaps the time to set up the disk it too short the first time, I still have to debug it.
- Be aware of the SD card that you are using, I have also been using a 16GB card without success, only to later find out the card was corrupted.
Hope it helps.
Once again, thanks to everybody for the answers, they have been of great help anyway.