Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » hal library header file but i cannot use the hal functions(the connection to libraries HAL does not work)
hal library header file but i cannot use the hal functions [message #1742900] Thu, 08 September 2016 09:12 Go to next message
Eclipse UserFriend
Hello!
can't connect to the HAL library in your modules, help

the connection to libraries HAL does not work

  • Attachment: error.jpg
    (Size: 104.27KB, Downloaded 392 times)
  • Attachment: error2.jpg
    (Size: 228.96KB, Downloaded 329 times)
Re: hal library header file but i cannot use the hal functions [message #1742934 is a reply to message #1742900] Thu, 08 September 2016 11:56 Go to previous messageGo to next message
Eclipse UserFriend
This may be off-topic here: Obviously you're attempting a cross-compilation for a STM32 microprocessor, and the trouble is in the ST libraries.
Re: hal library header file but i cannot use the hal functions [message #1742970 is a reply to message #1742934] Thu, 08 September 2016 20:18 Go to previous messageGo to next message
Eclipse UserFriend
Hello Tauno Voipio

Yes, I'm working with STM32 in sw4stm32 (eclipse modified)

in the main file everything is OK, the features work
  • Attachment: no error.jpg
    (Size: 279.76KB, Downloaded 688 times)
Re: hal library header file but i cannot use the hal functions [message #1742974 is a reply to message #1742970] Thu, 08 September 2016 21:11 Go to previous messageGo to next message
Eclipse UserFriend
I don't know if you've clipped the image in your first post but I don't see the compiler being told the include path for the HAL header. Is the -I option missing?

If so, where did the Makefile come from? Did Eclipse generate it?
Post the entire build log (copy and paste it) .
It wouldn't hurt to see the one that works, too.

Fixing this depends on project setup. You've left out a lot of details.




[Updated on: Thu, 08 September 2016 21:25] by Moderator

Re: hal library header file but i cannot use the hal functions [message #1742975 is a reply to message #1742974] Thu, 08 September 2016 21:26 Go to previous messageGo to next message
Eclipse UserFriend
10:26:00 **** Incremental Build of configuration Debug for project I2C ****
make all
'Building file: ../lcd1602/lcd1602.cpp'
'Invoking: MCU G++ Compiler'
C:\C++\CUBE MX32\Progekt9\I2C\SW4STM32\I2C\Debug
arm-none-eabi-g++ -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -std=c++0x -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" -DUSE_HAL_DRIVER -DSTM32F103xB -I"C:/C++/CUBE MX32/Progekt9/I2C/Inc" -I"C:/C++/CUBE MX32/Progekt9/I2C/Drivers/STM32F1xx_HAL_Driver/Inc" -I"C:/C++/CUBE MX32/Progekt9/I2C/Drivers/STM32F1xx_HAL_Driver/Inc/Legacy" -I"C:/C++/CUBE MX32/Progekt9/I2C/Drivers/CMSIS/Include" -I"C:/C++/CUBE MX32/Progekt9/I2C/Drivers/CMSIS/Device/ST/STM32F1xx/Include" -I../I2C/HAL/inc -I"C:/C++/CUBE MX32/Progekt9/I2C/SW4STM32/I2C/Debug" -I"C:/C++/CUBE MX32/Progekt9/I2C/SW4STM32/I2C/lcd1602" -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fno-exceptions -fno-rtti -MMD -MP -MF"lcd1602/lcd1602.d" -MT"lcd1602/lcd1602.o" -o "lcd1602/lcd1602.o" "../lcd1602/lcd1602.cpp"
../lcd1602/lcd1602.cpp:16:11: error: expected constructor, destructor, or type conversion before '(' token
HAL_Delay (500);
^
make: *** [lcd1602/lcd1602.o] Error 1

10:26:03 Build Finished (took 3s.152ms)


if you still need something tell me

can and remote access to give
  • Attachment: error3.jpg
    (Size: 254.93KB, Downloaded 357 times)
Re: hal library header file but i cannot use the hal functions [message #1743000 is a reply to message #1742975] Fri, 09 September 2016 05:53 Go to previous messageGo to next message
Eclipse UserFriend
Your code is plain wrong: the call to HAL_delay() does not match its declaration in the header file (which you do not show here).

This is actually a basic C/C++ question not directly related to Eclipse CDT.
Re: hal library header file but i cannot use the hal functions [message #1743008 is a reply to message #1743000] Fri, 09 September 2016 08:34 Go to previous messageGo to next message
Eclipse UserFriend
When make executes it would be in the Debug directory which is C:\C++\CUBE MX32\Progekt9\I2C\SW4STM32\I2C\Debug if I'm not mistaken.
The compile command has a relative include path -I../I2C/HAL/inc which, from what I can see in the project view in your images, doesn't exist.
It may be unimportant as the compiler isn't complaining about any non-found headers.
Why is it there?

Tauno has a point, though.
Does the call match the declaration?

I don't use HAL or anything related to it so I don't know although I'm curious to know why it works in main.cpp (from your no error.jpg) but not in lcd1602.cpp.
Or did it never work in main.cpp and you have just shown a listing of a file you have never compiled?
Is it misspelled and maybe should be HAL_delay vs. HAL_Delay?



[Updated on: Fri, 09 September 2016 08:45] by Moderator

Re: hal library header file but i cannot use the hal functions [message #1743316 is a reply to message #1743008] Wed, 14 September 2016 05:54 Go to previous messageGo to next message
Eclipse UserFriend
Hello David Vavra!
in the main.ccp this works and the code compiles
in the file lcd1602.cpp work functions that I made myself, as a function of HAL (Hardware Abstraction Layer) do not work

[Updated on: Wed, 14 September 2016 05:55] by Moderator

Re: hal library header file but i cannot use the hal functions [message #1743331 is a reply to message #1743316] Wed, 14 September 2016 08:54 Go to previous message
Eclipse UserFriend
Well then, Efim you need to find out what's different between the two builds.
I don't have your files and no other way of finding it for you.
This is not a CDT problem. This site is for dealing with CDT issues and not for debugging your code.
If you really need more help in this area you should ask around at other places.

Best of luck


Previous Topic:code analysis checkers and #ifdefs
Next Topic:Types could not be resolved
Goto Forum:
  


Current Time: Tue May 13 17:06:38 EDT 2025

Powered by FUDForum. Page generated in 0.04544 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top