cancel
Showing results for 
Search instead for 
Did you mean: 

Nightmare on Linked Resource street!

Robmar
Senior III

I added a Linked Resource and tested it on an include line, although the path is the same, it fails.
I have zero idea why, does it need another syntax?

Path variable:-> REPOSITORY_LOC set as C:\Users\Dev\STM32Cube\Repository

With GCC Copiler Include Paths this fails:- ${repository_loc}/STM32Cube_FW_H7_V1.11.1/Drivers/STM32H7xx_HAL_Driver/Inc

but this works:-

C:/Users/Dev/STM32Cube/Repository/STM32Cube_FW_H7_V1.11.1/Drivers/STM32H7xx_HAL_Driver/Inc

I tried with '\' and '/' no difference.

Why would this cause these errors:-

C:/Users/Dev/STM32Cube/Repository/STM32Cube_FW_H7_V1.11.1/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h7xx.h:282:11:
fatal error: stm32h7xx_hal.h: No such file or directory

282 | #include "stm32h7xx_hal.h"

| ^~~~~~~~~~~~~~~~~

4 REPLIES 4
Andrew Neil
Evangelist III

@Robmar wrote:

 

C:/Users/Dev/STM32Cube/Repository/STM32Cube_FW_H7_V1.11.1/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h7xx.h:282:11:
fatal error: stm32h7xx_hal.h: No such file or directory


So it can't find the file stm32h7xx_hal.h.

Use the Windows File Explorer (or whatever) to find if/where that actually exists on your hard drive

  • If it doesn't exist, then no amount of fiddling with the project settings can fix that.
  • If it does exist, make sure that location is in your Include Paths.
    Easiest way to do this is to find the folder in the CubeIDE Project Explorer, right-click it, and choose 'Add/remove include path'
TDK
Guru

Path variables are an Eclipse convention. Are they properly expanded before being passed to the compiler/linker? Show the full output of the Console tab so we get the full picture of what's going on. I doubt they're case sensitive, but that seems like an easy thing to get consistent.

If you feel a post has answered your question, please click "Accept as Solution".

As I wrote, with the linked path name "repository_loc" replaced with the same path text it works.

The problem is that the path name is the exact same path string, so why does it fail when the linked path "repository_loc" is used, as they are the same?

It all links perfectly until I add the linked resource path as indicted above and used it in an include.

Using the include path below, it throws up errors for the CMSIS directory**

${repository_loc}/STM32Cube_FW_H7_V1.11.1/Drivers/STM32H7xx_HAL_Driver/Inc

Error:-> **C:/Users/Dev/STM32Cube/Repository/STM32Cube_FW_H7_V1.11.1/Drivers/CMSIS/Device/ST/STM32H7xx/Include/stm32h7xx.h:282:11: fatal error file not found

repository_loc is set to C:\Users\Usuario\STM32Cube\Repository

If I put the include as: C:\Users\Usuario\STM32Cube\RepositorySTM32Cube_FW_H7_V1.11.1/Drivers/STM32H7xx_HAL_Driver/Inc then it all works (using same '/' or '\')