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


You are viewing a reply to How do I compile a .h file?  

How do I compile a .h file?

Thank you for the response.

I have checked and main.h is included in multiple locations. Maininclude1 Maininclude2

I have also done what you suggested and searched for the ENABLE_MEMS symbol and I have found all instances of it. Even after I’ve rebuilt he program the macro is still showing it as a 0. ENABLE MEMS Macro

This is really frustrating as I have looked through the code and I can see (or at least believe) that the functionality to send Acc, Gyr and Mag data is there but I don’t understand enough about this code in order to get it to work and send all sensor data over.

France

Hi,

Have you checked that it’s your main.h file that is included; it may happen that there are several files of the same name in different directoies and that a given include get the wrong one... To test you may search for files named “main.h” and/or put a syntax error in your file and check that you get the error message.

If you really get the main.h where you define the symbol as 1 and the code that depends on it is not compiled, that may mean that it is redefined as 0 somewhere else and setting it on the command line will probably not help.

Bernard (Ac6)


France

Hi again,

BTW the fact that Eclipse shows the macro expanding as 0 (which is seen also as the code itself is grayed out) may be an artifact due to indexing problems. To check you may rebuild th eindex, or go in th efile where the #if shows the value as 0 and

  1. add a syntax error in the conditionnaly compiled zone to check if it is compiled or not
  2. search which “main.h” file Eclipse think you are including by double clicking on “main.h” in the file outline (right column in your workspace): this will open the main.h file and you can check if your macro is defined as 1 or 0 (you can get the full pathname by hovering on the editor tab title).


Hope this helps

Bernard (Ac6)


 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs