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


System workbench not compiling .asm files

I am trying to compile my project that contains some assembly code. Each line of the assembly code has the following

Error: bad instruction

Im guessing b/c the IDE is not placing the correct options to compile the file. How can I compile the .asm files correctly?

France

Hi,

To be “compiled” correctly, assembly files must have extension “.s” or “.S” (the second will run the file through the C Pre-Processor), not “.asm”; I’m not sure how these are processed but, obviously, they are not recognized correctly by the compiler.

Hope this helps,

Bernard (Ac6)


I tried both extensions s and S. Still getting the same issue. It seems its complaining about almost every line. Every comment line that begins with a ; and has comments after it (for example)

Any other suggestions?


France

OK, now I understand.

In the ARM world there is two different syntaxes for ASM code: the ARM (UAL) syntax (used by Keil and IAR) and the GCC syntax.

As your comment start by semicolons, obviously your file use the ARM syntax, while System Workbench fr STM32 uses the GCC syntax.

There is a few differences between both:

  • Comments are introduced by sharp # characters in GCC
  • labels must be followed by a colon : and instructions do not have (but may be) indented
  • Immediate values may be introduced by ‘#’ or ‘$’ characters
  • ...

There is a good quick-reference paper at this addressQuestion; I suggest you look at it to convert your ASM files.

Sorry to not have a quick solution for your problem,

Bernard (Ac6)


 

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