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 .....’’