Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


How to add an external library in a project?

Hi everyone,

I’m having issues in adding an external library to my project. The lib is for LoRa communication (SX1272), it’s in C++ as well as my project.
The lib folder contains the following folders : debug, enums, radio, registers, typedefs, sx1272 (with .h and .cpp source files).

1. I tried to simply paste the lib folder into my project folder -> the lib files generate errors at build.

2. I added the name and the path of the lib in project properties >> C/C++ Build >> Build settings >> MCU GCC Linker >> Libraries >> Libraries search path as I found in another post -> the lib files still generate errors at build.

Does anybody have another idea?

Thank you in advance for your help.

Hi,

I have had some problems with that as well. You should go to the project properties >> C/C++ General >> Paths and Symbols

In the includes tab select the GNU C++ and Add the location of your library, can be relative and just add the ‘lib/LoRa’ for example if that is the location

In the Source Location tab add the folder of the library.

This should work. Let me know if it work for you.


Thank you a lot, it works! I wasn’t adding the lib paths to the right place!
Do you know how to procede with symbols?? I’m adding them here :
project properties >> C/C++ General >> Paths and Symbols >> Symbols
But it doesn’t work at all.


Glad to help. Unfortunately I dont know about the symbols.

For those who may have the same problem regarding symbols, I have understood my mistake:

To define them properly, define them in Project > Properties > C/C++ General > Paths & Symbols
Configuration : | All configurations | (this is where I wasn’t doing it correctly)

If you have to declare a symbol for a #if / #endif, add a value (1 for expl) to your symbol. Else, it won’t work.
If you have to declare a symbol for a #ifdef, you don’t need to add a value, as soon as you define it in the properties.

Hope it helps!

Also, if you’ve done what explained above but your compiler still can’t find your symbols, try:

projet > C/C++ Index > Freshen All Files
projet > C/C++ Index > Rebuild

It worked for me.


 

Newest Forum Posts

  1. Можно ли установить камин на балконе или лоджии? by Grand3kpdErorb, 03:38
  2. reservation car service Seattle by Jamesprede, 2025-05-01 10:06
  3. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  5. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  6. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  7. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  8. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05

Last-Modified Blogs