Just call printf(“RTC counter = %ld\n”, wvt_rtc_counter++);
I’ve attached call stack, it gives clear explanation of the problem: WriteRawFastSemihostingData() is called from IRQ before InitializeFastSemihosting() finished.
No problem, we have published an update to the profiler framework that introduces a new setting: Disable interrupts during semihosting operations.
Please try updating the framework and then set the new option to “Yes” in order to automatically disable interrupts during the execution of WriteToFastSemihostingChannel().