不知道有没有人用这个板子 还是问下
我的代码
{
U32 Write_Addr = FLASH_USER_START_ADDR; //FLASH_USER_START_ADDR=((uint32_t)0x0800E000)
uint64_t data64=0x1234567812345678;
EraseInitStruct.TypeErase = FLASH_TYPEERASE_PAGES;
EraseInitStruct.Page = FLASH_USER_START_ADDR;
EraseInitStruct.NbPages = (FLASH_USER_END_ADDR - FLASH_USER_START_ADDR) / FLASH_PAGE_SIZE;
HAL_FLASH_Unlock();
if (HAL_FLASHEx_Erase(&EraseInitStruct, &PageError) != HAL_OK)
{
//HAL_FLASH_Lock();
// return 0;----
}
HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, Write_Addr, data64);
}
|