I just encountered a similar situation, unable to stop the device (18). You may need to check the code problem. It may be that some IO ports have serious conflicts.
This post has been translated from Chinese to comply with the ST Community guid...
我也遇到了此问题,可以试着将#include “ff_gen_drv.h”移动到sd_diskio.h,目前我这的报错已经消失且编译通过,这一操作对你来说也许可以解决问题
Translation:
I also encountered this problem. You can try to move #include "ff_gen_drv.h" to sd_diskio.h. At present, the error has disappeared and the compilation ...