In a barebone S32DS project not using the RTD SDK or the Configuration Tool the speed on the semihosted stdio channel used by printf() seems to be almost instantaneous, but when enabling semihosted in an RTD project the speed is very slow, visibly printing character by character on the console.
What is required to get the semihosted channel to behave similarly as in a standalone project?
Hi @Henrik-Wires,
Could you share which device + SW version you are using (RTD and S32DS)?
Do you have semihosting enabled inside the debugger configuration? Solved: how to use the printf function in S32DS.3.5 ? - NXP Community.
Printf is quite slow for debugging. There are some examples in community on how to use the UART instance inside of the S32K devices through the USB connector on the EVBs:
The first one uses a lpuart.c library to print through printf function, while the lpuart interrupt echo example uses the UART functions alone.
Hope this helps.
Best regards,
Julián
seems to be the difference between newlib_nano semihosted vs newlib semihosted. Switching to newlib however causes the application to hardfault at the second call to printf() for no apparent reason.
Yes semihosting is enabled in the debug settings.
The performance from newlib (not newlib_nano) is sufficient for what I am doing. It is a debug session, providing more formatted data than what is realistic to configure in the debugger gui.
Not sure why the mentioned project crashes with a hardfault during printf. Created another MEX and that works just fine. Will analyze the crashing mex configuration later but guessing it is some other unrelated problem.