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


Error 258 on CubeMX imported project


Hi,

I’m pretty new to SW4STM32, CubeMX and HAL libraries (so far I’ve been using Coocox IDE, with standard peripheral firmware).

In CubeMX, I’ve set up the simplest configuration for a NucleoF401 (all IPs to standard config) and carrefully followed all the steps to create/import CubeMX project into SW4STM32 (up to the Artifact name stuff).

Then, when I try to buid the project I’ve got this problem (see console output below).

Any clue ? I wonder why “arduino” is showing up... I’ve done nothing for that ! The project toolchain is Ac6 STM32 MCU GCC.

I’m using latest releases of both SW4STM32 and CubeMX (4.9).

Sorry, it’s probably something stupid...

Thanks for help.


13:01:50 **** Build of configuration Debug for project nucleoF401 Configuration ****
make all
Building file: D:/myworkspace/nucleoF401/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c
Invoking: MCU GCC Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Dweak=attributeweak -Dpacked=attributepacked -DUSE_HAL_DRIVER -DSTM32F401xE -I......\Inc -I......\Drivers\STM32F4xx_HAL_Driver\Inc -I......\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy -I......\Drivers\CMSIS\Include -I......\Drivers\CMSIS\Device\ST\STM32F4xx\Include -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF”Drivers/STM32F4xx_HAL_Driver/stm32f4xx_hal.d” -MT”Drivers/STM32F4xx_HAL_Driver/stm32f4xx_hal.o” -o “Drivers/STM32F4xx_HAL_Driver/stm32f4xx_hal.o” “D:/myworkspace/nucleoF401/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c”
“C:/Program Files/Arduino/hardware/tools/avr/utils/bin/sh.exe”: -c: line 1: syntax error near unexpected token `-Dweak=attribute__((’
“C:/Program Files/Arduino/hardware/tools/avr/utils/bin/sh.exe”: -c: line 1: `arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Dweak=attributeweak -Dpacked=attributepacked -DUSE_HAL_DRIVER -DSTM32F401xE -I......\Inc -I......\Drivers\STM32F4xx_HAL_Driver\Inc -I......\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy -I......\Drivers\CMSIS\Include -I......\Drivers\CMSIS\Device\ST\STM32F4xx\Include -Os -g3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF”Drivers/STM32F4xx_HAL_Driver/stm32f4xx_hal.d” -MT”Drivers/STM32F4xx_HAL_Driver/stm32f4xx_hal.o” -o “Drivers/STM32F4xx_HAL_Driver/stm32f4xx_hal.o” “D:/myworkspace/nucleoF401/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c”’
make: *** Drivers/STM32F4xx_HAL_Driver/stm32f4xx_hal.o Error 258

13:01:50 Build Finished (took 240ms)


Well, I removed “weak=attributeweak” and “packed=attributepacked” from the list of defined symbols within C/C++ Settings and my error is gone. I wonder why CubeMX does that.

Then, I had to change all the include paths into absolute paths, and finally browse for the .elf manually.

Now it is working on the target board !

Not sure I did things correctly anyway.

As a teacher, I’m looking for easy ways to help students having their hands on STM32 faster. CubeMX is wonderfull to understand IP settings. I hope that integration with SW4STM32 will be improved in the future.

Thanks for all the work that is done !

L.


Hello, Latorre.
Try to change (example for Eclipse and STSW4STM32) in Tool Settings - MCU GCC Compiler - Symbols,
from

__weak=__attribute__((weak))
__packed=__attribute__((__packed__))

to

'__weak=__attribute__((weak))'
'__packed=__attribute__((__packed__))'


And in Includes, from paths like

..\..\..\Inc
..\..\..\Drivers\STM32F1xx_HAL_Driver\Inc

to different slashes

../../../Inc
../../../Drivers/STM32F1xx_HAL_Driver/Inc



But other generated project compiled perfectly with all default settings...

2015-07-28
Possible reason - path to sh in system enviroment variable %PATH%. When sh accessible thru path, compilation failed and requires settings update (above).
If sh not accessible, compilation successful.

For me it was exactly the other way around.
I had to REMOVE the quotes around the symbols!

Using Windows 7 64 bit installer Version v2.4.

Since I took over the project from a colleague, I am not sure if he had changed that before.


I solved the problem by removing the “.metadata” folder from the workspace folder
then recreadte the workspace again
everything worked fine


i had yesterday the same problem with the 258 error. I have reinstalled windows from scratch and the problem was solved.

 

Newest Forum Posts

  1. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  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