Jump to content
Sign in to follow this  
mamurtaza

Trouble in compiling ELM Chan FatFs

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...