Cannot revert from semihosting
Hello everyone,
I am building an application on a STM32H742 chip.
I can correctly enable the semihosting following this guide (How to use semihosting with STM32CubeIDE and STM32).
However, I want to be able to disable it because otherwise the code stops running as soon as I unplug the programmer (in release configuration).
I just use some printf so i expect those lines simply become uneffective when not in semihosting.
The point is that, making the steps backward (of the above guide), leaves something set on the compiler and as soon as it encounters a printf the code is trapped at _swistat().
Below the callstack of the trap:
_swistat()
_fstat_r()
__swhatbuf_r()
__swmakebuf_r()
__swsetup_r()
_vfprintf_r()
printf()
main()
Could anyone help me on this?
Thank you in advance,
Giacomo