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

相关推荐
国科安芯8 小时前
可更换的心脏:ASP4644S2B电源模块与模块化卫星在轨可维护供电架构
单片机·fpga开发·架构·电源模块·低轨卫星·抗辐射
国科安芯9 小时前
看不见的地基:ASP4644S2B四通道电源模块与星载电源分配网络的完整性设计
网络·嵌入式硬件·fpga开发·adc·电源模块·抗辐射·载荷
意法半导体STM3214 小时前
【官方原创】全新升级的STM32Cube生态,支持STM32C5
stm32·单片机·嵌入式硬件·stm32cubemx
威嵌神州15 小时前
NXP P2020核心板技术解析:PowerPC架构与VxWorks存量项目迁移指南
嵌入式硬件·微服务·云原生·架构
Zwawa16 小时前
步进电机路径规划:梯形曲线与S型曲线
c语言·单片机·嵌入式
女神下凡1 天前
芯参谋(119):凌阳(Sunplus)_开发指南
linux·arm开发·stm32·单片机·嵌入式硬件
炸膛坦客1 天前
单片机/C/C++八股:(三十三)取别名
c语言·c++·单片机
_upupup3 天前
GPIO输出(STM32)
stm32·单片机
Brilliantwxx3 天前
【STM32】 DAC 数模转换器(理论 + 外设 + 四个实验案例)
笔记·stm32·单片机·嵌入式硬件
无敌贵点大王3 天前
从寄存器层面重学STM32(15)——IIC理论
stm32·单片机·嵌入式硬件