mamurtaza 0 Posted December 20, 2014 Share Posted December 20, 2014 Hi, I am trying to compile ELM Chen FatFs and I am getting identifier error in ff.h (line 157) for typedef struct DIR in code composer studio. It also leads to a type specifier error on line 215,216 and 217 which uses this identifier. Any help to sort it out will be highly appreciateable. The errors are below: Description Resource Path Location Type#41 expected an identifier ff.h /SD_Up2 line 157 C/C++ Problem#80 expected a type specifier ff.h /SD_Up2 line 215 C/C++ Problem#80 expected a type specifier ff.h /SD_Up2 line 217 C/C++ Problem#80 expected a type specifier ff.h /SD_Up2 line 216 C/C++ Problem thanks Quote Link to post Share on other sites
pabigot 355 Posted December 20, 2014 Share Posted December 20, 2014 The msp430 MCU headers that have USB support define DIR as a preprocessor symbol containing the value for the USB Data Response Bit. A solution is to include ff.h before anything includes msp430.h, or to not include both in the same file at all. mamurtaza 1 Quote Link to post Share on other sites
mamurtaza 0 Posted December 21, 2014 Author Share Posted December 21, 2014 Hi pabigot, It worked. thanks a lot for the help. You got an awesome insight. Can you please help me solve the last problem. I am getting error "identifier "BOOL" is unidentified" defined in diskio.c even though I have defined #include <stdbool.h> and the error donot go even if I compile it with -fg flag. Do you have any idea why is that the case. Description Resource Path Location Type#20 identifier "FALSE" is undefined diskio.c /Orignal line 187 C/C++ Problem#20 identifier "TRUE" is undefined diskio.c /Orignal line 194 C/C++ Problem#20 identifier "BOOL" is undefined diskio.c /Orignal line 180 C/C++ Problem#20 identifier "TRUE" is undefined diskio.c /Orignal line 218 C/C++ Problem#20 identifier "BOOL" is undefined diskio.c /Orignal line 201 C/C++ Problem#20 identifier "FALSE" is undefined diskio.c /Orignal line 204 C/C++ Problem Thanks again Quote Link to post Share on other sites
pabigot 355 Posted December 21, 2014 Share Posted December 21, 2014 The name of the type provided by <stdbool.h> is bool (lower case). Its constants true and false are also lower-case. You're apparently using PetitFS rather than FatFS; older versions of that had this in a header integer.h: /* Boolean type */ typedef enum { FALSE = 0, TRUE } BOOL; That sort of thing was mostly removed from FatFS releases around 0.9, and PetiteFS around 0.02a. My archival repository at https://github.com/pabigot/FatFs/tree/ff/master would be one way to see the changes per version. mamurtaza 1 Quote Link to post Share on other sites
mamurtaza 0 Posted December 22, 2014 Author Share Posted December 22, 2014 Thank you Peter for help. It would have taken more than a while to figure it out on your own. Thanks again Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.