Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAR compilation error with NUCLEO targets #482

Closed
bcostm opened this issue Sep 10, 2014 · 5 comments
Closed

IAR compilation error with NUCLEO targets #482

bcostm opened this issue Sep 10, 2014 · 5 comments

Comments

@bcostm
Copy link
Contributor

bcostm commented Sep 10, 2014

I have this error when compiling NUCLEO_F401RE target with IAR:

Compile: FilePath.cpp
[Error] FileSystemLike.h@86: [Pe120]: return value type ("void *") does not match the function type ("mbed::DirHandle *")
[Error] FilePath.cpp@20: [Pe144]: a value of type "void *" cannot be used to initialize an entity of type "char const *"
[Error] FilePath.cpp@20: [Pe144]: a value of type "void *" cannot be used to initialize an entity of type "mbed::FileBase *"
[Error] FilePath.cpp@56: [Pe120]: return value type ("void *") does not match the function type ("mbed::FileSystemLike *")
[Error] FilePath.cpp@69: [Pe120]: return value type ("void *") does not match the function type ("mbed::FileLike *")

  virtual DirHandle *opendir(const char *name) { return NULL; };
                                                        ^

"C:\GitHub\mbed\build\mbed\FileSystemLike.h",86 Error[Pe120]: return value type ("void *") does not match the function type ("mbed::DirHandle *")

FilePath::FilePath(const char* file_path) : file_name(NULL), fb(NULL) {
^
"C:\GitHub\mbed\libraries\mbed\common\FilePath.cpp",20 Error[Pe144]: a value of type "void *" cannot be used to initialize an entity of type "char co
nst *"

FilePath::FilePath(const char* file_path) : file_name(NULL), fb(NULL) {
^
"C:\GitHub\mbed\libraries\mbed\common\FilePath.cpp",20 Error[Pe144]: a value of type "void *" cannot be used to initialize an entity of type "mbed::F
ileBase *"

  return NULL;
         ^

"C:\GitHub\mbed\libraries\mbed\common\FilePath.cpp",56 Error[Pe120]: return value type ("void *") does not match the function type ("mbed::FileSystem
Like *")

  return NULL;
         ^

"C:\GitHub\mbed\libraries\mbed\common\FilePath.cpp",69 Error[Pe120]: return value type ("void *") does not match the function type ("mbed::FileLike *
")

  • Compilation command: workspace_tools\build.py -t IAR -m NUCLEO_F401RE
  • IAR Embedded Workbench for ARM version: 7.10.1.6735
  • IAR Embedded Workbench common components: 7.0.2.3053
  • private_settings.py file:
    from os.path import join
    ARM_PATH = "C:\Keil_v5\ARM\armcc"
    ARM_BIN = join(ARM_PATH, "bin")
    ARM_INC = join(ARM_PATH, "include")
    ARM_LIB = join(ARM_PATH, "lib")
    IAR_PATH = "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm"

For information, same command line and settings with LPC1768 works fine.

@bcostm
Copy link
Contributor Author

bcostm commented Sep 11, 2014

The error is due to a different definition of NULL in ST HAL driver (void* 0) compared to the one defined in stddef.h for example (0).

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 11, 2014

If you have fixed it, please close this issue. Thanks

@bcostm
Copy link
Contributor Author

bcostm commented Sep 17, 2014

No, it is not fixed yet.

@bcostm
Copy link
Contributor Author

bcostm commented Oct 16, 2014

The STM32Cube driver of all Nucleo targets must be corrected to compile with IAR: change NULL by HAL_NULL. The pull request #560 corrects it on the F411RE target. Other targets correction are on-going...

@bcostm bcostm changed the title IAR compilation error with NUCLEO_F401RE IAR compilation error with NUCLEO targets Oct 16, 2014
@0xc0170
Copy link
Contributor

0xc0170 commented Oct 30, 2014

I believe this should be resolved now. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants