We often use UART to print information, facilitate debugging and record information when the software is running.
Maybe you can use SEGGER's RTT function instead of serial printing, which is also more convenient. But RTT makes it must be use JLINK. With Event Recorder, there is no such restriction, and all kinds of LINKS take all. As long as it is supported by the MDK.
Event Recorder was added to MDK in version 5.22, and improved with MDK version 5.25, adding time measurement and power consumption measurement.
This debug component does not require the SWO pin and uses the standard download interface. Take our development board as an example, using VCC, GND, SWDIO, SWCLK, and NRST. You can use the three-wire JLINK-OB is no problem, only GND, SWDIO and SWCLK.
To use the Event Recorder in an application:
1. Select Compiler:Event Recorder using the dialog Manage Run-Time Environment. Click on the documentation link in the dialog for more details.
This adds the component class Compiler with the Event Recorder to the application and Project window.
2. Configure the Event Recorder using the file EventRecorderConf.h.
You can set the following configurations:Configure the Event Recorder using the file EventRecorderConf.h.
3. Initialize the Event Recorder in the application code
#include "EventRecorder.h" // Keil::ARM_Compiler
int main (void) {
// system configurations
EventRecorderInitialize (EventRecordAll, 1); // initialize and start Event Recorder
// other application code
}
- If you are using Keil RTX5, you can enable and configure Event Recorder settings using the RTX_Config.h file. Refer to Event Recorder Configuration for more information.
4. Add or verify that a Component Viewer Description File is attached to the project.
5. Place the Event Recorder into a non-initalized memory area. In Options for Target - Target, use Linker function "Scatter File".
RW_IRAM2 0x2000F000 UNINIT 0x00001000 {
EventRecorder.o (+ZI)
}
6. Finally, make sure you have Use MicroLIB turned on.
Now, compile and debug run it, and you'll see the "printf“ in your code, printed in Keil's Debug (printf) Viewer window.
Comments
Please log in or sign up to comment.