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


Syntax error: Unterminated quoted string

France

Hi,

The syntax error here is neither in main.c or in main.o but in the command line itself; the problem is that parentheses are someway special when using the external builder. Can you try reverting to the Internal builder?

BTW I just hecked and, on Windows, I can build successfully with the project as generated by CubeMX (that is with quotes around the value of the packed symbol) both with the internal and external builder. Looking at your traces (and especially the %CD% thing) it seems you are running on Linux; could you confirm that?

In fact here we seem to fall into one difference between the internal builder and external builder on Linux:

  • The internal builder strips one level of quotes in arguments, wherever they are located
    • -Dfoobar=”FooBar” is seen as -Dfoobar=FooBar and expanded as FooBar (an identifier) by the C compiler
    • “-Dfoobar=FooBar” is (also) seen as -Dfoobar=FooBar and expanded the same
  • The external builder will strip one level of quotes, but only if they enclose the whole parameter:
    • -Dfoobar=”FooBar” is seen as -Dfoobar=”FooBar” and expanded as “FooBar” (a character string) by the C compiler
    • “-Dfoobar=FooBar” is seen as -Dfoobar=FooBar and expanded as FoBar (an identifier) by the C compiler


The problem is that, currently, it is not possible to generate the second form in a project; thus CubeMX will probably only work using the internal builder; I will look at the problem on Linux to confirm and look for a solution there.

Bernard (Ac6)