SDK_2.8.0_LPC845BREAKOUT
Board : LPC845_BREAKOUT
Host: Linux
Tools: ARM GCC
Defect: semihosting in arm-gdb
I'm just running the default demo programs in the SDK for the board above, using linux and I can successfully compile, run and debug one of the examples, but semihosting appears not to be working.
I've managed to compile and debug in linux (using CMAKE in the armgcc dir) the led_blinky example.
I can debug (arm-gdb), single step using the integrated debugger, etc.
When I compile the hello_world example, I can single step, but the PRINTF("hello world.\r\n"); (line 44 in hello_world.c) doesn't output anything to gdb.
after some searching I found this:
MCUXpresso SDK API Reference Manual: Semihosting
I've applied these changes, recompiled but still no output at the PRINTF.
Maybe there is some #define (or -DXXX) that I am missing in the linking or compilation, but with no mention in the docs.
Edit 25.8.2020
I figured out that I needed to add (please add to documentation, at least on the API reference, also the stack changes do not work, possibly the names for the platform are not the same).
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSDK_DEBUGCONSOLE") # Added
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -DSDK_DEBUGCONSOLE") # Added (not sure if this one is needed, should only be needed at compile not linking time)
Still semihosting still isn't working, I am using openocd to communicate with the CMSIS-DAP in the board.
(Open On-Chip Debugger 0.10.0+dev-01379-g6ec2ec4d3-dirty (2020-08-12-09:15))
When I set the SDK_DEBUGCONSOLE=1U
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSDK_DEBUGCONSOLE=1U") # Added
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -DSDK_DEBUGCONSOLE=1U") # Added
and connect a serial to USB adapter to the board, I can get the output "hello world"...
I'll check soon if with another debugger I can get semihosting to work.