cancel
Showing results for 
Search instead for 
Did you mean: 

Semihosting on RUN mode

Kim.Andy
Associate III

Hello,

I have enabled the semihosting.

The semihosting is running on the debug mode properly.

And debug message by printf() is displayed on the console window of the cubeide.

But if the project is ran on the run mode(run, not debug),

my code is not proceeded.

I set the parameters to use the semihosting as the debug mode.

I can't use the semihosting on the run mode?

Thanks

4 REPLIES 4
KnarfB
Principal III

Semihosting requires a debug agent attached to the MCU, see https://developer.arm.com/documentation/dui0471/g/Bgbjjgij for more details. If you want printf logging in production mode (no debugger attached), either redirect printf to an UART which works with any terminal prog or use SWO (Serial Wire Output) which needs dedicated hard&software. See also AN4989

Application note

STM32 microcontroller debug toolbox

hth

KnarfB

Ethan HUANG
ST Employee

Hello @AK.12.26im​ 

I saw another question (here) regarding redirection today and think it is the right time to do some tests and make/share the summary.

I think OpenOCD+GDB (as shown in page 18 of the attachment) or OpenOCD-only (as shown in page 19 of the attachment) is what you need.

Ethan HUANG
ST Employee

Here is the attachment.

Thanks alot.