使用Event Recoder 调试

参考安富莱的教程,记录狂暴模式下的EventRecoder功能

1.添加EventRecoder

开启EventRecoder功能,STDOUT选择EVR

2

3

EventCoder.h文件中配置

4.Keil配置

将IRAM1分配一部分空间给IRAM2.IRAM2勾选为NoInit

5

选择为IRAM2

6添加代码

c 复制代码
int main(void)
{

  /* USER CODE BEGIN 1 */
	EventRecorderInitialize(EventRecordAll, 1U);
	EventRecorderStart();
  /* USER CODE END 1 */

  /* MCU Configuration--------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();
c 复制代码
// LED闪烁任务
void LED_Task(void)
{
//	SEGGER_RTT_printf(0,"LED_Task is Running, tick is %llu \r\n", get_system_time_64());
	printf("LED_Task is Running, tick is %llu \r\n", get_system_time_64());
}

// 按键扫描任务
void KeyScan_Task(void)
{
//  SEGGER_RTT_printf(0,"keyScan_task is Running, tick is %llu \r\n", get_system_time_64());
	printf("keyScan_task is Running, tick is %llu \r\n", get_system_time_64());
}

// 数据处理任务
void DataProcess_Task(void)
{
// SEGGER_RTT_printf(0,"DataProcess_Task is Running, tick is %llu \r\n", get_system_time_64());
	printf("DataProcess_Task is Running,tick is %llu \r\n", get_system_time_64());
}

// 显示任务
void Display_Task(void)
{
//	SEGGER_RTT_printf(0,"Display_Task is Running, tick is %llu \r\n", get_system_time_64());
	printf("Display_Task is Running, tick is %llu \r\n", get_system_time_64());
}

并且勾选使用微库

测试

可以看到正确被打印

使用时间测量功能


需要注意的是仿真器的trace的时钟要和mcu的时钟相同

相关推荐
不悔哥3 天前
开源OV-Watch:怎么做一个智能手表
单片机·开源·嵌入式
XiHongShi20163 天前
STM32F407 RTC定时器例程,建议保存
stm32·单片机·学习
深圳老胡3 天前
STM32F407 控制 L6470 步进电机驱动 —— 控制过程简介
笔记·stm32·单片机·嵌入式硬件·代码规范
女神下凡3 天前
嵌入式设计的各种存储芯片的硬件/软件设计规范,非常全面。
arm开发·单片机·嵌入式硬件
梅梅9663 天前
一款mipi转lvds的lcd调试(LT8912B)
单片机·计算机外设·电脑·显示器·pd芯片
开发笔记-阿牛3 天前
蓝牙音乐灯拆解,又一次拆到蓝牙音乐灯芯片CK6865L
人工智能·单片机·嵌入式硬件·音视频·音频
从零开始的嵌入式之旅3 天前
day47
arm开发·经验分享·笔记·嵌入式硬件
恒锐丰科技林技术员3 天前
EG1164 高压大电流升压同步整流芯片解析
经验分享·嵌入式硬件·硬件工程
CHENKONG_CK3 天前
破解制鞋打磨痛点:RFID赋能去毛刺工序自动化升级
网络·单片机·嵌入式硬件·网络协议·tcp/ip
祖力553 天前
ARM时钟
嵌入式硬件·arm·时钟·imx6ull