voidflash_erase(uint32_tsector){uint32_tSectorError =0;// unlockHAL_FLASH_Unlock();// Clear pending flags (if any)__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);// erase the sector(s)FL...
使用SRAM1_BASE地址跳转到bootloader写入复位类型报错怎么解决? _FLASH_Unlock();HAL_FLASHEx_Erase(&p_erase_init, &page_error);HAL_FLASH_Lock();return;}当我使用 STM32_Programmer 手动删除页面时,我没有看到任何错误。STM32_Programmer.sh -c port=swd -e [7 25] ...
*/HAL_StatusTypeDefHAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit,uint32_t*SectorError){ HAL_StatusTypeDef status = HAL_ERROR;uint32_tindex =0;/* Process Locked */__HAL_LOCK(&pFlash);/* Check the parameters */assert_param(IS_TYPEERASE(pEraseInit->TypeErase));/* Wait for last op...
如果(HAL_FLASHEx_Erase(&pEraseInit, &SectorError) != HAL_OK){ /* 页面擦除时出错 */ ...
if (HAL_FLASHEx_Erase(&EraseInitStruct, &PageError) != HAL_OK){ retvalue = HAL_ERROR; /...
的地址My_Flash.NbPages=1;//说明要擦除的页数,此参数必须是Min_Data = 1和Max_Data =(最大页数-初始页的值)之间的值uint32_t PageError=0;//设置PageError,如果出现错误这个变量会被设置为出错的FLASH地址HAL_FLASHEx_Erase(&My_Flash, &PageError);//调用擦除函数擦除uint16_t Write_Flash_Data=my...
然后呢。 这位读者可能看到了,应该是非常不认可我的观点,于是把视频转发到了我的读者群里面。 昨晚已...
HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit) { HAL_StatusTypeDef status = HAL_OK; /* Process Locked */ __HAL_LOCK(&pFlash); /* If procedure already ongoing, reject the next one */ if (pFlash.ProcedureOnGoing != FLASH_PROC_NONE) { >>> here must be __...
HAL_FLASH_OB_Unlock();HAL_FLASHEx_OBProgram(&OBInit);HAL_FLASH_OB_Lock();HAL_FLASH_Lock();...
uint32_t Banks; /*!< Select banks to erase when Mass erase is enabled. This parameter must be a value of @ref FLASHEx_Banks */uint32_t Sector; /*!< Initial FLASH sector to erase when Mass erase is disabled This parameter must be a value of @ref FLASHEx_Sectors */...