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


BLE warnings on ST example

Hi,

While trying to use ST example for BLE, I got 63 times this warning:
packed’ attribute ignored -Wattributes

I imported ‘SensorDemo’ project from X-CUBE_BLE1Question.
(youare wellcome to import it too in order to view all the warnings).
It is worth mentioning that this project version for IAR compiled free of warnings.


my HW:
stm32L476 NUCLEO + X-NUCLEO-IDB05A1.
OS:
Windows 10.
AC6:
1.14.1


Can someone assist?

Thanks.

Hi Udibit,


It happend beacuse your example use some files to compile according with IAR compiler.

The __packed attribute is kinda different on GCC compiler, as described here:

https://www.iar.com/contentassets/e20cfa542d1a4734aa6b234bea42f11a/example-5.pdfQuestion

To solve this, you can go to:

Project Proprieties -> C/C++ General -> Paths and Symbols -> (TAB) Symbols

and press to add a symbol, and:

name: __packed
value: attribute packed

You should do it to __weak too


I saw this on a generated project from STM32CubeMX.

Thanks danilopucci.

The suggested correction did not work.
Can you recheck the symbol value?
you wrote:
name: __packed
value: attribute packed?
(please atached image or file)

But, your direction did assist me, since I understood that this kind of warnings are probably due to some macro defined in the BlueNRG package that are already defined in the code generated by the GNU ARM Eclipse plug-in.
Therefore, I found the following workaround:
__packed is also defined in cdefs.h (file in Atollic installation directory) - I have commented that line (see attached file)

I am not completely satisfied with this solution because it makes changes in Eclipse file (which is common to different projects).

The archaic forum engine badly alters any entered source code to something intangible.

Yes, this is a programming related forum where we can’t paste code so we have to attach it as a picture...

You can use conditional definitions.

Edit:

Oops, sorry dear moderators, I just unintentionally pressed the “report” button on the parent post.


Hi Udibit,

Ooops, when I posted I didnt see that the format was corrupted, as Bugmenot said.

Yeah, this is a solution but not the best one, as you said.

See attached screenshots.

It is Project Proprieties -> C/C++ General -> Paths and Symbols -> (TAB) #Symbols


Yes, I have figured it out and try it - but no help, warnings remains.

As I wrote it is probably due to some macro defined in the BlueNRG package that are already defined in the code generated by the GNU ARM Eclipse plug-in (cdefs.h).


 

Newest Forum Posts

  1. reservation car service Seattle by Jamesprede, 2025-05-01 10:06
  2. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  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. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  10. Build a project in "release" mode by tang, 2025-02-20 10:36

Last-Modified Blogs