I have searched the forums and the internet to the best of my ability, but have failed to find the answer.
Is it possible to use printf when using the Simulator?
"Debug (printf) Viewer" remains empty no matter what I do. I have chosen TM4C129x as the "Device" but using Simulator mode so the device is not as relevant.
Any help, especially sample code would be much appreciated.
I have looked at https://www.keil.com/pack/doc/compiler/RetargetIO/html/_retarget__examples_er.html
Trying to recreate this project from scratch gives me a compilation warning that ARM_LIB_STACK is undefined. The .c and .s files are identical, so I am guessing that there is something different in the compiler directives....
ARM_LIB_STACK is defined in the scatter file (xxx.sct). This is a linker file.
Hi Yip,
did you enable retargeting of the STDOUT to the ITM?
Best regards, Milorad
Thanks. Adding the scatter file allowed me to replicate the example.
For TM4C129x, there is no scatter file produced by the linker when using the defaults, so still working to see how the example can be ported to TM4C129x.
Milorad Cvjetkovic said:
Retargeted STDOUT to EVR for event logging as suggested by the example.
That should work also, can you check in Event Recorder window if you are getting Event Recorder messages?
I am using TM4C129x (instead of ARMCM0) with the default settings and including the EventRecorder.h. The program compiles, but when I try to run it, I get an error message "Warning: Event Recorder not located in uninitialized memory" when executing "EventRecorderInitialize(EventRecordAll, 1);" statement.
You can check the example for RTOS and Cortex-M3 here:
https://github.com/ARM-software/CMSIS_5/tree/develop/CMSIS/RTOS2/RTX/Examples/Blinky
This does what you want, it uses Simulator and retargets printf to EventRecorder which can be observed in the Debug (printf) Viewer.