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


Issue when import programme from MBED

Hello OpemSTM community!

I’m trying to import mbed software to eclipse, I followed the tuto and need to configure more include path because i’m using bluetooth library from STM, now the project build correctly exept for the linker who gcc say me that :
---
‘Invoking: MCU G++ Linker’
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -T”C:\Users\thier\Projets\10 - workspace\Pebble2STM\mbed_Pebble2STM\STM32F401RETx_FLASH.ld” -Wl,-Map=output.map -Wl,--gc-sections -fno-exceptions -fno-rtti -lm -o “mbed_Pebble2STM.elf” @”objects.list”
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-abort.o): In function `abort’:
abort.c:(.text.abort+0xa): undefined reference to `_exit’
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-signalr.o): In function `_kill_r’:
signalr.c:(.text._kill_r+0xe): undefined reference to `_kill’
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.3.0.201507241045/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-signalr.o): In function `_getpid_r’:
signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid’
collect2.exe: error: ld returned 1 exit status
make: *** mbed_Pebble2STM.elf Error 1
----

It seem that the link don’t find the stdlib and i don’t know how to specify the correct path. I search on forum and try to change
LinkerScript.ld by STM32F401RETx_FLASH.ld in -T option (${workspace_loc:/${ProjName}/STM32F401RETx_FLASH.ld}
without any sucess

Thanks for your help!

Thierry

Tunisia

Hello Thierry,
Have you tried adding syscalls.c to your project ?

Update: try adding “-specs=nosys.specs” to linker miscellaneous flags (Project Properties > C/C++ Build > Settings > Tool Settings TAB > MCU GCC Linker > Miscellaneous > Linker flags)

Thanks Tarek, with -specs=nosys.specs it compile now completly biggrin, but when I debug the software is in infinit loop cry

with first message :


Warning: the current language does not match this frame.
No source file named C:\Users\thier\Projets\10 - workspace\Pebble2STM\Pebble2STM\Src\main.c.



And loop when I pause the debugger:
Default_Handler:
Infinite_Loop:
b Infinite_Loop
.size Default_Handler, .-Default_Handler

any idea ?

Thierry,

Hello,

I find the issue, by comparaison with working project generated by workbench I add this -specs=nano.specs to linker miscellaneous flags (Project Properties > C/C++ Build > Settings > Tool Settings TAB > MCU GCC Linker > Miscellaneous > Linker flags).

now it work! biggrin

Thanks againTarek to put me on the good lane !

Thierry,

I also have the same error after updating the plugin today.

This GDB was configured as “--host=i686-linux-gnu --target=arm-none-eabi”.

“Warning: the current language does not match this frame.”

And once you continue you get:

Error: JTAG failure -4
Error: JTAG failure -4
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 6300ms

I do have the same error, I come from Arduino Background, so it look odd and new to me.

Hello STM Team

For information for other user that want to import mbed projet, to proper execusion you need to use the ld file generated by mbed export not de default on generated by the project creation.

For my application the file is here :
./mbed-src/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/TOOLCHAIN_GCC_ARM/STM32F401XE.ld

I just modify the location to put in same place as LinkerScript.ld and change in Project>property>MCU G++ Linker>General field LinkerScript (-T) : to change the file name

I think this thing could be added to the tuto How to import mbed project (Bernard it’s for you redface)

Thierry


Hi Guys,
So I am trying to compile an exported mbed project to a Nucleo STM32L476RG board. Followed the instructions for importing then compiling throws the undefined reference to `_exit’ and also _kill and _getpid described above. So I tried adding -specs=nano.specs and also changing the load script, also as recommended above. Neither of these seems to have much effect, with compile giving the same errors as indicated below.

Somewhat stuck now so be grateful for any further suggestions.

Best wishes, Ron


Building target: lorawan-lmic-app.elf
Invoking: MCU G++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -specs=nano.specs -T”/home/ron/ac6workspace/lorawan-lmic-app/STM32L476XX.ld” -Wl,-Map=output.map -Wl, - -gc-sections -fno-exceptions -fno-rtti -lm -o “lorawan-lmic-app.elf” @”objects.list” ----
/home/ron/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.7.0.201602291252/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-abort.o): In function `abort’:
abort.c:(.text.abort+0xa): undefined reference to `_exit’
/home/ron/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.7.0.201602291252/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-signalr.o): In function `_kill_r’:
signalr.c:(.text._kill_r+0xe): undefined reference to `_kill’
/home/ron/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.7.0.201602291252/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-signalr.o): In function `_getpid_r’:
signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid’
collect2: error: ld returned 1 exit status
make: *** lorawan-lmic-app.elf Error 1

Answering my own question:

I had misunderstood that it is necessary to add both -specs=nosys.specs -specs=nano.specs to Miscellaneous -> Linker flags ... doh!

Now it works!


 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 20:13
  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. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs