Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:12 Go to next message
Efim Ginter is currently offline Efim GinterFriend
Messages: 6
Registered: September 2016
Junior Member
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 362 times)
  • Attachment: error2.jpg
    (Size: 228.96KB, Downloaded 303 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 15:56 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
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.


--

Tauno Voipio
Re: hal library header file but i cannot use the hal functions [message #1742970 is a reply to message #1742934] Fri, 09 September 2016 00:18 Go to previous messageGo to next message
Efim Ginter is currently offline Efim GinterFriend
Messages: 6
Registered: September 2016
Junior Member
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 540 times)
Re: hal library header file but i cannot use the hal functions [message #1742974 is a reply to message #1742970] Fri, 09 September 2016 01:11 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
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: Fri, 09 September 2016 01:25]

Report message to a moderator

Re: hal library header file but i cannot use the hal functions [message #1742975 is a reply to message #1742974] Fri, 09 September 2016 01:26 Go to previous messageGo to next message
Efim Ginter is currently offline Efim GinterFriend
Messages: 6
Registered: September 2016
Junior Member
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 307 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 09:53 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
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.


--

Tauno Voipio
Re: hal library header file but i cannot use the hal functions [message #1743008 is a reply to message #1743000] Fri, 09 September 2016 12:34 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
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 12:45]

Report message to a 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 09:54 Go to previous messageGo to next message
Efim Ginter is currently offline Efim GinterFriend
Messages: 6
Registered: September 2016
Junior Member
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 09:55]

Report message to a 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 12:54 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
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: Fri Apr 26 22:10:28 GMT 2024

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

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

Back to the top