主题中讨论的其他器件:HALCOGEN
大家好、团队、
我正在编写代码、通过注入1位 和2位错误来测试 RAM ECC 的功能。 当 一个 SRAM 单一位错误发生时、也尝试触发 ESM 低电平中断。
请告诉我下面提到的步骤是否正确或是否缺少任何内容 。这些是我已经执行的步骤->
-
使用 RAMCTRL 启用 ECC 检测、启用单位错误状态捕获以及 ESM 通知和 ECC 存储器写入
RAMCTRL =((0xA << 0)|(0x1<< 4)|(0x1 << 8));
-
写入存储器->(*(volatile UINT32 *)(0x08000000)= 0x8421842184218421;
-
通过翻转一位插入1位 ECC 错误
uint32 ecc1 =*(volatile uint32 *)(0x08400000U)^ 0x01; -
读取损坏的数据以生成单位错误
eccram_read1 =(*(volatile UINT32 *)(0x08000000)); -
检查 ESM 标志 Q:是否需要处理任何额外的步骤来检查 ESM 错误?
/* Include Files */
#include "HL_sys_common.h"
/* USER CODE BEGIN (1) */
#include "HL_reg_l2ramw.h"
#include <stdio.h>
/* USER CODE END */
/** @fn void main(void)
* @brief Application main function
* @note This function is empty by default.
*
* This function is called after startup.
* The user can use this function to implement the application.
*/
/* USER CODE BEGIN (2) */
void checkSinglebitECC(void);
void checkDoublebitECC(void);
/* USER CODE END */
int main(void)
{
/* USER CODE BEGIN (3) */
checkSinglebitECC(); /* function called to inject and check single bit error mechanism*/
checkDoublebitECC(); /* function called to inject and check Double bit error mechanism*/
/* USER CODE END */
return 0;
}
/* USER CODE BEGIN (4) */
void checkSinglebitECC(void)
{
volatile uint64 eccram_read1 = 0U; /* variable to hold the corrupted data to generate single bit error */
/* Enable ECC detection.
* Enable single bit error status capture and ESM notification.
* ECC memory writes are enabled. */
l2ramwREG->RAMCTRL = ((0xA << 0) | (0x1<<4) | (0x1 << 8));
(*(volatile uint32 *)(0x08000000 )) = 0x8421842184218421;
/* Force a single bit error */
uint32 ecc1 = *(volatile uint32 *)(0x08400000) ^ 0x01 ;
/* Read the corrupted data to generate single bit error */
eccram_read1 = (*(volatile uint32 *)(0x08000000 ));
//if((l2ramwREG->RAMERRSTATUS & 0x280000u) == 0x280000u) /* Check for error status
}
/* USER CODE END */
执行这些步骤后、我 检查了内存浏览器。 我无法使用上述位置找到更新。我还尝试从内存浏览器填充内存。
- 这里的问题是什么?
- 要在内存浏览器中检查、需要完成哪些配置?
- 如何验证错误注入是否成功?
请尽快回复


