Embedded STM32核子EEPROM仿真器ee_初始化问题
我正在努力使EEPROM模拟器从stm32工作。我遵循了stm32 l47x板的示例,但仍然遇到问题。当我调用EE_init时,我最终会遇到堆栈溢出。我对这个模拟器不太熟悉,我使用的是示例中的默认配置 这就是我初始化一切的方式Embedded STM32核子EEPROM仿真器ee_初始化问题,embedded,stm32,eeprom,nucleo,Embedded,Stm32,Eeprom,Nucleo,我正在努力使EEPROM模拟器从stm32工作。我遵循了stm32 l47x板的示例,但仍然遇到问题。当我调用EE_init时,我最终会遇到堆栈溢出。我对这个模拟器不太熟悉,我使用的是示例中的默认配置 这就是我初始化一切的方式 EE_Status ee_status = EE_OK; /* Enable and set FLASH Interrupt priority */ /* FLASH interrupt is used for the purpose of pages clean u
EE_Status ee_status = EE_OK;
/* Enable and set FLASH Interrupt priority */
/* FLASH interrupt is used for the purpose of pages clean up under interrupt */
HAL_NVIC_SetPriority(FLASH_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(FLASH_IRQn);
HAL_FLASH_Unlock();
if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) == RESET)
{
/* Blink LED_OK (Green) twice at startup */
LEDInterface_toggleColor(GREEN);
HAL_Delay(100);
LEDInterface_toggleColor(NONE);
HAL_Delay(100);
LEDInterface_toggleColor(GREEN);
HAL_Delay(100);
LEDInterface_toggleColor(NONE);
ee_status = EE_Init(EE_FORCED_ERASE);
if(ee_status != EE_OK)
{
while(1);
}
这是eeprom_emul_conf.h设置,我也没有更改
/* Configuration of eeprom emulation in flash, can be custom */
#if defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx)
#define START_PAGE_ADDRESS 0x08100000U /*!< Start address of the 1st page in flash, for EEPROM emulation */
#else
#define START_PAGE_ADDRESS 0x08080000U /*!< Start address of the 1st page in flash, for EEPROM emulation */
#endif
#define CYCLES_NUMBER 1U /*!< Number of 10Kcycles requested, minimum 1 for 10Kcycles (default),
for instance 10 to reach 100Kcycles. This factor will increase
pages number */
#define GUARD_PAGES_NUMBER 2U /*!< Number of guard pages avoiding frequent transfers (must be multiple of 2): 0,2,4.. */
/* Configuration of crc calculation for eeprom emulation in flash */
#define CRC_POLYNOMIAL_LENGTH LL_CRC_POLYLENGTH_16B /* CRC polynomial lenght 16 bits */
#define CRC_POLYNOMIAL_VALUE 0x8005U /* Polynomial to use for CRC calculation *
/
我确定我需要改变分配内存的位置,但最好的方法是什么。谢谢也许您需要增加堆栈大小。您使用的工具链是什么?例如,如果您使用的是Keil,那么堆栈大小可以通过启动源代码文件中的
stack\u size
设置来定义,名称为startup\u stm32l476xx.sal。因此,请确保您的EEPROM不会在使用过的RAM区域中增长。我曾经有过EEPROM模拟的覆盖问题
#if defined(DOXYGEN)
void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName )
#else
OSAL_WEAK_FN(void, vApplicationStackOverflowHook)( TaskHandle_t xTask, char *pcTaskName )
#endif
{
volatile char * name = pcTaskName;
(void)name;
while (1)
{
;
}
}