STM32-使用EEPROM的硬故障

时间:2018-08-08 13:30:48

标签: c stm32

我正在编写一个代码,用于在STM32F0上存储数据并将数据读取到EEPROM。我使用了意法半导体的示例:

#include "eeprom.h"

/* Virtual address defined by the user: 0xFFFF value is prohibited */
uint16_t VirtAddVarTab[NB_OF_VAR] = {0x5555, 0x6666, 0x7777};
uint16_t VarDataTab[NB_OF_VAR] = {0, 0, 0};
uint16_t VarValue = 0;

//other declarations here.....

int main(void)
{
  HAL_Init();

  SystemClock_Config();

  HAL_FLASH_Unlock();

  EE_Init();

//some EE_WriteVariable(); and EE_ReadVariable(); functions here.......
}

但是我的程序陷入了EE_Init();函数的困境。当我尝试调试时,它跳入了HardFault_Handler()文件的stm32f0xx_it.c函数中并停留在那里(因为此函数中有一个while(1))。任何想法可能有什么问题吗?我没有对示例代码进行任何更改,但无法正常工作。

我使用的示例是STM32CUBE示例的一部分。 page 26, EEPROM_Emulation

0 个答案:

没有答案