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


STM32 assembly .ifdef not working?

Seems like no matter what I try the .ifdef does not work. It always takes the default path.

This happens with a symbol defined in the make settings as well as with symbols defined in any other way, including .equ and .set

I even tried using a label that I used for memory access a few lines down in the code. Same result, .ifdef used the default path and the memory access worked.

France

Hi,

Could you be a bit more explicit about how the symbol you want to test has been defined? What do you mean by “defined in the make settings”?

Note that a referenced symbol is not a defined symbol: it may assemble correctly, as an undefined symbol that will be resolved by the linker, but is not a defined symbol, as checked by .ifdef

Also the symbol must be defined in the same file, before being tested by .ifdef

Last option, sometimes more natural to C programmers, name your assembler source file with an uppercase S as extension and it will be preprocessed by the C preprocessor, so you could use all the C pre-processor directives (include, ifdef, etc...)

Hope this helps,

Bernard (Ac6)

Hi Bernard,
thank you, that was exactly the information I was missing.

I changed the files to .S and let the C pre-processor do the job. Now it works.

Primarily I code in assembly, but the project uses the ST libraries for some tasks, so I do have to mix the code.

Greetings
Guido


 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs