Using FatFS on internal flash of STM32f303 microcontroller
I want to use FatFS library using STM32F303 internal flash memory.


That's not going to work very well. I would recommend that you reconsider.

FatFS expects to be working with a block device where it's possible to write any 512-byte sector of the disk at any time. This is not how flash memory works on STM32 devices -- on the STM32F3 series, flash memory is organized as a set of 2 KB sectors (not the 512-byte sectors assumed by FAT!), each of which can only be written to as part of a program/erase cycle.

Writing to a single 512-byte subsector of the 2 KB flash sector will require an expensive, slow operation where you erase the entire flash sector, then re-write it with one sector modified. This will wear the flash memory very quickly, resulting in premature failure of the device.



That all being said, based on the FatFS code I looked at, FR_NOT_ENABLED does not appear to be a valid return value from f_mkfs(). Either you've read the error code wrong, or you're running into a bug in the version of FatFS you're using.