NewLib and Semihosting on LPCOpen project

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by acinfo32 on Tue Jul 01 04:42:36 MST 2014
Dear all,

Can someone tell what can go wrong while using semihosting on LPCOpen?

I created a new C++ LPCOpen project with the wizzard (v720) on a custom board. Then I switched the library to NewLib (semihosting). Set in Path and Symbols the symbols DEBUG_ENABLE and DEBUG_SEMIHOSTING. In the board library I did the same.

Then I started debugging with JLink, the debugging works but when stepping over printf nothing happens or it crashes.

"Can't find a source file at "F:\jenkins-slave\workspace\LibrariesFresco\Newlib_hostings\newlib_stub_semihost\armv7-m/../src/swi.h" "

1) Do I need to write code to implement the semihosting or should it work out of the box?
2) Which paths do I need for stdio.h
   - C:\Programs\LPCXpresso_7.2.0_153\lpcxpresso\tools\arm-none-eabi\include
   - C:\Programs\LPCXpresso_7.2.0_153\lpcxpresso\tools\arm-none-eabi\include\c++\4.8.3\tr1
   - C:\Programs\LPCXpresso_7.2.0_153\lpcxpresso\tools\arm-none-eabi\include\sys
3) Do I need to link to libcr_semihost.a or libcr_newlib_semihost.a? Although it doesn't work.
4) ....?

(when using CoIDE semihosting works so the hardware is ok)