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 after converting cube project to C++

== UPDATE ==
BUG REPORT, see “Answer to Question2” in reply below. There is a bug when converting C to C++ project. The linker script is removed
== END ==

Hi, I have to add some c++ code to my project. The project was created by latest STM32CubeMX for STM32L1. Works and runs on MCU. I followed steps in previous post how to convert project to C++. This works. But, get following linker errors:

undefined reference to `_exit’
undefined reference to `_close’
.....

I am using printf and other functions. I fixed problem by adding syscalls.c file with these functions.

Question 1

Is there a reference “syscalls.c” file to use with cube projects? I got one from the net, and don’t trust it at all!

Question 2

After adding the syscalls.c file mentioned above, project builds. But, now when I try to program the STM32L151RC I get following errors. Can anyone help?

‘’Programming Finished
Perify Started
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20008000
Error: checksum mismatch - attempting binary compare
diff 0 address 0x00008000. Was 0x82 instead of 0xf8
diff 1 address 0x00008001. Was 0x62 instead of 0xb5
diff 2 address 0x00008002. Was 0x98 instead of 0x00
..... Many more diff x lines .....’’

To anser my own questions:

Answer to Question 1

I got a syscalls.c from SW4STM by creating a new project, and using the generated “syscalls.c” file.

Answer to Question 2:

The problem was that after converting to C++ file, the linker file is removed from project properties. Have to go to section and give in the linker file again.


 

Newest Forum Posts

  1. Analog servomotors with nucleo f334r8 by SkelePaw, 2025-11-01 05:57
  2. So happy to finally meet you! by Danielrug, 2025-10-28 11:01
  3. STM32 MCU model shortlisting for Making RC remote by Palvish, 2025-07-07 15:05
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  6. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  7. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  8. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05

Last-Modified Blogs