0
votes

I have a problem with STM32. I use System Workbench For STM32 and I inclue to my project Hal and FatFs (when I create a project I choose it). But after create a project have error:

Description Resource Path Location Type 'PPP_OK' undeclared (first use in this function) ppp_diskio_template.c /Hal_sd/Middlewares/Third_Party/FatFs/src/drivers line 98 C/C++ Problem

How can I build it? I want make an example project with FatFs but I can't build empty main.c.

2
Did you use Cube to generate the project? Which destination did you choose for the FAT FS?JMA

2 Answers

0
votes

I see you mention ppp_diskio_template.c.

FatFs is just a way to organize data on a storage, and access them via a "file abstraction". FatFs shows you "files", but at then end it's just bytes stored in a storage.

The diskio template is a file with some functions that you need to define so that the FatFs can read/write to the storage. Basically, it's the functions that FatFS will use to store the data "as bytes" when you provide a file.

The fact that PPP_OK is not defined means that perhaps ppp_diskio_template.h or ppp_diskio.h is unavailable, not at the right place or not included in the files of your project.

You can basically search it in all the .h you have to see which one you need to include.

-2
votes

I don't think the header file was added to your project.