The discussion of standard IO dynamic switching among semihost, UARTx, and NULL on STM32
Hello,
Anyone want to involve the discussion?
There is one thing I need to find an answer.
What is the better way to deal with initialise_monitor_handles() ?
I had searched around, to enable semihosting when using System Workbentch toolchain, it required in user code to invoke initialise_monitor_handles() at early time, such as first in main(). This is only be a little inconvenient for users who certainly want to enable semihosting, but be a trouble for my implementation. As I find out, once invoke initialise_monitor_handles(), it has to be to have a debugger semihosting channel connected, or the Arm core was hanging.
As I mentioned, I want to implement a patch to newlib, which allow to redirect/retarget the standard Input/Output and Error Output between semihosting, Uartx, Null etc. So, I will like to hold off to invoke initialise_monitor_handles() as later as possible, until the moment it is absolute necessary. There is another question, is there a way to deinitialize semihosting/monitor_handles?