使用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的时钟相同

相关推荐
CODECOLLECT13 小时前
京元 I62D Windows PDA 技术拆解:Windows 10 IoT 兼容 + 硬解码模块,如何降低工业软件迁移成本?
stm32·单片机·嵌入式硬件
BackCatK Chen13 小时前
STM32+FreeRTOS:嵌入式开发的黄金搭档,未来十年就靠它了!
stm32·单片机·嵌入式硬件·freertos·低功耗·rtdbs·工业控制
全栈游侠16 小时前
STM32F103XX 02-电源与备份寄存器
stm32·单片机·嵌入式硬件
Lsir10110_16 小时前
【Linux】中断 —— 操作系统的运行基石
linux·运维·嵌入式硬件
深圳市九鼎创展科技18 小时前
瑞芯微 RK3399 开发板 X3399 评测:高性能 ARM 平台的多面手
linux·arm开发·人工智能·单片机·嵌入式硬件·边缘计算
辰哥单片机设计18 小时前
STM32项目分享:车辆防盗报警系统
stm32·单片机·嵌入式硬件
小龙报20 小时前
【51单片机】从 0 到 1 玩转 51 蜂鸣器:分清有源无源,轻松驱动它奏响新年旋律
c语言·数据结构·c++·stm32·单片机·嵌入式硬件·51单片机
范纹杉想快点毕业20 小时前
嵌入式与单片机开发核心学习指南——从思维转变到第一性原理的深度实践
单片机·嵌入式硬件
Industio_触觉智能20 小时前
瑞芯微RK3566开发板规格书,详细参数配置,型号EVB3566-V1,基于RK3566核心板SOM3566邮票孔封装
嵌入式硬件·开发板·rk3568·rk3566·核心板·瑞芯微
czwxkn20 小时前
4STM32(stdl)TIM定时器
stm32·单片机·嵌入式硬件