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


Strange compiler error/warning flagging [SOLVED]

France

Hi,

If your code is as you show, the error is normal: the last line ( CliCmd.num = 0; ) is an assignment; it can’t be placed at global file level, but must be inside some function.

If you want to statically initialize CliCmd by just setting num to 0, you must replace your last two lines by cli_cmd CliCmd = { .num = 0 };

Be careful not to forget the dot before num; if you need to also initialize other fields separate them by commas inside the braces (the order does not mind).

Note however that, if you want to initialize all fields to zero, you may as well do nothing, as the C compiler will initailize all non-initialized variables and fields to 0.

Bernard (Ac6)