FLASH_TYPEPROGRAM_DOUBLEWORD(双字:64 位),用户根据写入数据类型选择即可。 第二个入口参数 Address 用来设置要写入数据的 FLASH 地址。第三个入口参数Data 顾名思义 就是要写入的数据类型,这个参数默认是 64 位的,如果你要写入小于 64 位的数据比如 16 位, ...
&PageError);//删除页HAL_FLASH_Lock();//上锁if(status!=HAL_OK){;}//如果删除失败处理//写入操作,解锁-->写入-->上锁 FLASH_TYPEPROGRAM_DOUBLEWORD类型一次写入是8个字节,64bit数据HAL_FLASH_Unlock();//解锁status=HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLE...
HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, (uint32_t)&Key_Flash, Key_ID);HAL_FLASH_Lock(...
HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, startAddress + dataIndex *4, writeData[dataIndex]); } FLASH_Lock();// 上锁写保护}//从指定地址开始写入多个数据(64位)voidFLASH_WriteDoubleWordData(uint32_tstartAddress,uint64_t*writeData,uint16_tcountToWrite){uint32_toffsetAddress = startAddress - FL...
Param.EEParam.chksum= CalcChksum((unsignedchar*)&Param.EEParam.CentralFreq,PARAM_SIZE-1);while(Address < PROGRAM_END_ADDRESS)/*the Address was assigned in power-on stage*/{if(HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, Address, Param.eeparam[n]) ==HAL_OK){ ...
Flash编程函数:第一个形参写入的方式:FLASH_TYPEPROGRAM_HALFWORD(半字,一次写入16bit),FLASH_TYPEPROGRAM_WORD(字,一次写入32bit),FLASH_TYPEPROGRAM_DOUBLEWORD(双字,一次写入64bit). 1. 2. 3. 4. 5. 第二个形参,写入数据的起始地址,第三个形参是要写入的数据。
HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, flashwriteaddr, flashwritedata);//第四步:写入数据...
HAL_StatusTypeDefHAL_FLASH_Program(uint32_tTypeProgram,uint32_tAddress,uint64_tData); /** * @brief Program halfword, word or double word at a specified address with interrupt enabled. * @note The function HAL_FLASH_Unlock() should be called before to unlock the FLASH interface ...
ProgramWord函数),要写入的数据应为32位的无符号整数。对于双字大小的写入(FLASH_ProgramDoubleWord函数...
if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, addrbuf, DataBuf) == HAL_OK){ addrbuf += 4;...